Results 1 to 9 of 9

Thread: Weirdest Zimbra Problem Ever (postfix main.cf file changes)

  1. #1
    Join Date
    Jun 2007
    Location
    Burlingame CA
    Posts
    21
    Rep Power
    8

    Default Weirdest Zimbra Problem Ever (postfix main.cf file changes)

    Here's my strange dilemma. I am running ZCS open source version 6.0.7. I have a backup script that does the usual rsync, then stop zimbra, rsync again, then start zimbra back up.

    However, lately there is a new problem. When zimbra starts back up, postfix fails to run. Here's what's happening:

    When I look at the main.cf file in /opt/zimbra/postfix/conf/ it has a line that looks like this:

    smtpd_recipient_restrictions = reject_non_fqdn_recipient, permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_unlisted_recipient, reject_invalid_hostname, reject_non_fqdn_sender, permit

    However, when I run my backup script and stop/start services, most of the time the line blanks out like this:

    smtpd_recipient_restrictions =

    Which postfix does not like. It generates errors like:

    zimbra postfix/smtpd[6101]: fatal: parameter "smtpd_recipient_restrictions": specify at least one working instance of: check_relay_domains, reject_unauth_destination, reject, defer or defer_if_permit

    It's doing that because the list is blank. Is there anything in Zimbra that might be resetting this value to null upon restart?

    Here's how I fix it, for now, until a better solution comes along:

    1. cd /opt/zimbra/postfix/conf/
    2. cp main.cf.backup main.cf (I made a backup of the GOOD file)
    3. cd /opt/zimbra/bin/
    4. ./postfix stop && ./postfix start

    That seems to correct it. That tells me that somewhere in Zimbra it's rebuilding/reconfiguring the main.cf file.

    Any help would be appreciated with this very unusual problem.

    Thanks,

    Dennis McEntire

  2. #2
    Join Date
    Jul 2007
    Location
    Baltimore
    Posts
    1,649
    Rep Power
    11

    Default

    zimbra does indeed rewrite the main.cf upon each start. most postfix values can be controlled via localconfig keys. do

    Code:
    zmlocalconfig | grep postfix
    and you'll see them

  3. #3
    Join Date
    Jun 2007
    Location
    Burlingame CA
    Posts
    21
    Rep Power
    8

    Default Now how do I ...

    I don't see the directive in there, smtpd_recipient_restrictions in the zmlocalconfig list. Is there any way to ADD this in so that it might stick when I restart Zimbra?

    Are there separate configs somewhere containing the postfix parameters that are used to rebuild main.cf upon restarting?

    Thanks,

    Dennis

  4. #4
    Join Date
    Jul 2007
    Location
    Baltimore
    Posts
    1,649
    Rep Power
    11

    Default

    see

    /opt/zimbra/conf/postfix_recipient_restrictions.cf

    err not sure if thats the same in version 5.x, are you still using 5.0.6?

  5. #5
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    13
    Rep Power
    6

    Default

    I get the same problem this morning, I don't know why it's not updating properly but there is a workaround. According to zmmta.cf :
    POSTCONF smtpd_recipient_restrictions FILE postfix_recipient_restrictions.cf
    So looking into into postfix_recipient_restrictions.cf to get values, now see what do we have into it :
    reject_non_fqdn_recipient
    permit_sasl_authenticated
    permit_mynetworks
    reject_unauth_destination
    reject_unlisted_recipient
    %%contains VAR:zimbraMtaRestriction reject_invalid_hostname%%
    %%contains VAR:zimbraMtaRestriction reject_non_fqdn_hostname%%
    %%contains VAR:zimbraMtaRestriction reject_non_fqdn_sender%%
    %%contains VAR:zimbraMtaRestriction reject_unknown_client%%
    %%contains VAR:zimbraMtaRestriction reject_unknown_hostname%%
    %%contains VAR:zimbraMtaRestriction reject_unknown_sender_domain%%
    %%explode reject_rbl_client VAR:zimbraMtaRestrictionRBLs%%
    %%contains VAR:zimbraMtaRestriction check_policy_service unixrivate/policy%%
    permit
    The file is not empty but after a restart, smtpd_recipient_restrictions in postfix conf file looks like this :
    smtpd_recipient_restrictions =
    That's why we're getting those errors. I found a hack to get rid of this bug, it's not beautifull but it's working.
    You have to comment the line :
    # POSTCONF smtpd_recipient_restrictions FILE postfix_recipient_restrictions.cf
    And then to hard code informations into the main.cf :
    smtpd_recipient_restrictions = reject_non_fqdn_recipient, permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_unlisted_recipient, reject_invalid_hostname, reject_non_fqdn_sender, permit
    Last edited by Eno; 08-11-2010 at 09:45 AM.

  6. #6
    Join Date
    Jun 2007
    Location
    Burlingame CA
    Posts
    21
    Rep Power
    8

    Default Thank you!

    Thanks for researching this, and I've learned a lot about the zmmta.cf file that's very interesting. I hope that a pound sign (#) will comment out that line, that's what I changed so we'll see what happens.

    Funny that the problem happened to you as well, that's strange. The version I am using is 6.0.7 and it's the open source edition.

    Thanks again,

    Dennis

  7. #7
    Join Date
    Nov 2010
    Posts
    1
    Rep Power
    4

    Default

    I've got the same problem two days ago with 6.0.8 and got approximately to the same solution, but instead of commenting the line:
    Code:
    POSTCONF smtpd_recipient_restrictions FILE postfix_recipient_restrictions.cf
    I've just changed it to the values I wanted to be in main.cf:
    Code:
    POSTCONF smtpd_recipient_restrictions permit_mynetworks,reject_unauth_destination
    Then after Zimbra restart the main.cf has the proper line:
    Code:
    smtpd_recipient_restrictions=permit_mynetworks,reject_unauth_destination
    I put more details about it here:
    UNIX Systems Administration: Zimbra 6.0.8 mail processing issue

  8. #8
    Join Date
    Feb 2012
    Posts
    1
    Rep Power
    3

    Default How to stop recreating main.cf on every time zimbra restart

    Hello

    i am facing same type of problem. I edit main.cf file and save it. but if i restart zimbra or postfix main.cf file remain unchanged. all the changes i made are gone.

    can any one tell me how to stop recreating main.cf file after zimbra restart.

    Thanks.
    Rahim

  9. #9
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,587
    Rep Power
    58

    Default

    Quote Originally Posted by aajoob View Post
    i am facing same type of problem. I edit main.cf file and save it. but if i restart zimbra or postfix main.cf file remain unchanged. all the changes i made are gone.
    That's correct.

    Quote Originally Posted by aajoob View Post
    can any one tell me how to stop recreating main.cf file after zimbra restart.
    You should not modify any ZCS files directly. Did you read this thread on how to do what you need? You haven't really given much information about what you're trying to do nor any information about the ZCS version and release you're using.
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

Similar Threads

  1. [SOLVED] Postfix unavailable - queue down
    By pmona in forum Administrators
    Replies: 20
    Last Post: 01-21-2010, 09:03 PM
  2. [SOLVED] Moving Zimbra to a new server
    By krolen in forum Administrators
    Replies: 109
    Last Post: 02-05-2009, 10:38 AM
  3. Major Issue - 5.0RC2 NE to 5.0GA NE failed
    By DougWare in forum Installation
    Replies: 7
    Last Post: 01-06-2008, 08:56 PM
  4. Cleanup after many upgrades
    By tobru in forum Installation
    Replies: 1
    Last Post: 12-23-2007, 08:21 AM
  5. Replies: 22
    Last Post: 12-02-2007, 04:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •