custom postfix configuration for local email

  • Hi folks, I recently upgraded to 1.0 and have a question about the right way to change the postfix configuration in /etc/postfix/main.conf.


    I've configured Notifications correctly, and I have no problem getting emails from scheduled jobs in OpenMediaVault.


    My original problem was that after I installed denyhosts, I would get bounced emails like this one:


    I was able to solve the problem by adding the following line to /etc/postfix/main.cf:
    recipient_canonical_maps = regexp:/etc/postfix/recipient_canonical


    And creating /etc/postfix/recipient_canonical with:
    /.+/ firstname.lastname@gmail.com


    However, /etc/postfix/main.cf is overwritten any time I make configuration changes through the OMV user interface.


    The question is: Is there a way I can persist my change to /etc/postfix/main.cf so that it's not overwritten?


    The other solution is to configure denyhosts to send emails directly to a specific account instead of to "root@localhost", but I'd like to solve for the general case if I can.


    Any ideas?

  • I was looking for an answer to this question as well.
    I have made some tweaks to main.cf - and it's a little frustrating to have to remember to back those changes up, before making changes to parts of the webui-config.

    Atom 330 @ 1.6GHz, 4GB RAM
    2x3TB Data, 1x3TB Parity, SnapRAID + AUFS pool
    Latest OMV running on custom Debain Wheezy, 3.14 Backports kernel

  • I have the same problem with my main.cf
    here's what I do for this (not a fix but it's working)


    first make a copy of your main.cf


    cp /etc/postfix/main.cf /etc/postfix/main.cf.safe


    then edit your .bashrc file to add a new alias


    nano /root/.bashrc


    add the following line :


    alias fixmail='cp /etc/postfix/main.cf.safe /etc/postfix/main.cf;service postfix restart'


    now when you make changes in your OMV interface and it breaks your email just ssh your server as root and type : fixmail


    your mails are working again :)

  • The answer to your issue lies in /usr/share/openmediavault/mkconf/postfix.d/10main
    There are a lot of variables pulled from /etc/default/openmediavault there.
    The one you are interested in is OMV_POSTFIX_MAIN_SENDER_CANONICAL_MAPS


    Just add the following line to your /etc/default/openmediavault:


    OMV_POSTFIX_MAIN_SENDER_CANONICAL_MAPS="regexp:/etc/postfix/recipient_canonical"


    and regenerate OMV configs.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!