Results 1 to 4 of 4

Thread: Relay per Domain not working after upgrade to 8.0.0 OSE

Hybrid View

  1. #1
    Join Date
    Nov 2011
    Rep Power

    Exclamation Relay per Domain not working after upgrade to 8.0.0 OSE

    here's basic info and problem:

    Zimbra: Release 8.0.0.GA.5434.UBUNTU12.64 UBUNTU12_64 FOSS edition.

    Upgrade history:
    UBUNTU10_64 -> UBUNTU12.64

    Corporational network architecture. Zimbra is used as local (LAN) workgroup system and mail with localdomain (nor registered or visible in Internet) and mail traffic (SMNP/POP/IMAP) is not allowed outside corporate network.
    Beside that there are 10 mail shared accounts (like department accounts) in external domain hosted in remote server in WAN, but still not in Internet. Mail traffic from this server is allowed in/out corporate network.
    This external domain is reflected in Zimbra and mails from remote server are fetched and delivered in Zimbra to corresponding local accounts. This way using external accounts is easier for users - it is the same as local account.
    Local accounts in external domain are shared and users with rights to use it have created persona to send emails to the outside world. This accounts have main transport defined in settings as ( IP:y.y.y.y). In Zimbra 8 they are granted sendAs right.
    Only problem was relying mails from local copies of external accounts through remote server. It was solved per Relay per Domain - Zimbra :: Wiki

    After upgrade to 8.0.0 relaying per domain stopped working. Of course changes to Postfix configuration were reapplied after Zimbra upgrade.
    Investigation showed that after changes introduced/related to zimbraAllowFromAddress/sendOnBehalfOf/sendAs

    BUG67091 - Support creating persona for addresses for which user has been granted sendAs/sendOnBehalfOf rights
    BUG66387 - zimbraAllowFromAddress pref should exclude internal accounts

    all mails at postfix level are seen as sent by local user (even mails sent from external domain and mails sent with external account

    Before upgrade
    Nov 19 12:32:14 hermes opendkim[11339]: 1ED6FC22C7: no signing table match for ''
    Nov 19 12:32:14 hermes postfix/qmgr[16643]: 1ED6FC22C7: from=< >, size=1316, nrcpt=1 (queue active)
    Nov 19 12:32:22 hermes postfix/smtp[19025]: 8A70EC2BD1: to=< >,[y.y.y.y]:25, delay=0.18, delays=0/0/0.08/0.1, dsn=2.0.0, status=sent (250 Queued! 1353324742 qp 30605 < >)
    After upgrade
    Nov 19 11:48:04 hermes opendkim[2267]: 2BBAEC2D64: no signing table match for ''
    Nov 19 11:48:04 hermes postfix/qmgr[4453]: 2BBAEC2D64: from=< >, size=1571, nrcpt=1 (queue active)
    Nov 19 11:48:12 hermes postfix/smtp[8092]: 2BBAEC2D64: to=< >, relay=[]:10026, delay=8.5, delays=0.05/0/0/8.4, 
    dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[]:10025): 250 2.0.0 Ok: queued as 99581C2D60)
    Nov 19 11:48:42 hermes postfix/smtp[7609]: connect to[z.z.z.z]:25: Connection timed out
    Nov 19 11:48:42 hermes postfix/smtp[7609]: 99581C2D60: to=< >, relay=none, delay=30, delays=0/0/30/0, dsn=4.4.1, 
    status=deferred (connect to[z.z.z.z]:25: Connection timed out)
    Is there a workaround to the problem? Any suggestions? Is this a bug that should be reported? Any help appreciated.
    Last edited by b0rek; 11-27-2012 at 01:04 AM. Reason: not all visible in logs

  2. #2
    Join Date
    Nov 2012
    Rep Power



    Hope you have tried this before upgrade..

    0.) Change to zimbra user:

    sudo su zimbra

    1.) Add the following to /opt/zimbra/postfix/conf/ file:

    sender_dependent_relayhost_maps = hash:/opt/zimbra/postfix/conf/relaybysender

    2.) Create file /opt/zimbra/postfix/conf/relaybysender and put the maps for smarthost relays in it, for example:
    Code: [] []:submission []:submission

    NOTE: Adding "submission" at the end tells relay to use TLS over 587 port instead of port 25. Also be aware if you use "[" , "]" and ":submission" port here, you must use them also in Relay_passwords file!
    3.) Create hash file:

    postmap /opt/zimbra/postfix/conf/relaybysender

    4.) Not done yet!
    Now we create matrix for SMTP authentication usernames and passwords. Create file /opt/zimbra/postfix/conf/relaypasswords and put server userass combinations in it:

    [] usernameassword
    []:submission usernameassword
    []:submission usernameassword

    NOTE, how we preserved exact server notation, exactly as in previous file!
    5.) Create map for this one, too:

    postmap hash:/opt/zimbra/postfix/conf/relaypasswords

    6.) In previous file we edited postfix configuration file manually, but we can do it also this way:

    postconf -e smtp_sasl_password_maps=hash:/opt/zimbra/postfix/conf/relaypasswords

    7.) Configure postfix to use SSL authentication and try if available TLS:

    postconf -e smtp_sasl_auth_enable=yes
    postconf -e smtp_tls_security_level = may

    8.) ...and to use outgoing server name, rather than canonical name:

    postconf -e smtp_cname_overrides_servername=no

    9.) Reload postfix

    postfix reload

    10) Restart some Zimbra services, just for sure:

    zmmtactl restart

    So, in /opt/zimbra/postfix/conf/ you should see at the end of the file:

    smtp_tls_security_level = may
    sender_dependent_relayhost_maps = hash:/opt/zimbra/postfix/conf/relaybydomain
    smtp_sasl_password_maps = hash:/opt/zimbra/postfix/conf/relaypasswords
    smtp_cname_overrides_servername = no

    Test! Should work fine.
    See the logs for errors:

    tail -n 500 /var/log/

    You must repeat above steps after each Zimbra upgrade.

    This should work ..
    Let me know about it


  3. #3
    Join Date
    Nov 2011
    Rep Power


    Thanks Raunaq for answer. I've followed Relay per Domain - Zimbra :: Wiki and everything was working fine before upgrade to 8.0.0. In this version of Zimbra there were changes to MTA configuration that made this solution not working.
    I've searched forum before posting to no avail, but yesterday after second approach in searching from different angle I've came across new informations.

    1. In ZCS 8 file /opt/zimbra/postfix/conf/ is no longer used. To make changes to those settings zmlocalconfig should be used. For example

    zmlocalconfig -e postfix_smtp_sasl_auth_enable=yes
    zmlocalconfig -e postfix_smtp_cname_overrides_servername=no
    More here:

    2. For relay per domain I've run

    zmlocalconfig -e postfix_sender_dependent_relayhost_maps=hash:/opt/zimbra/postfix/conf/bysender
    zmmtactl restart
    But still mails from external accounts and personas were sent with local sender address.

    3. Then I've found Bug 40731 &ndash; Wrong MAIL FROM in SMTP dialog when using a Persona and pointe me to setting zimbraSmtpRestrictEnvelopeFrom

    SMTP behavior now switches based on the value of
    zimbraSmtpRestrictEnvelopeFrom. When it's set to TRUE, we force
    MAIL FROM in the SMTP session to be the address of the account.
    When it's set to FALSE, MAIL FROM is set to either the Sender or
    From header value in the outgoing message, in that order.
    after setting
    zmprov mc default zimbraSmtpRestrictEnvelopeFrom FALSE
    zmprov mc defaultExternal zimbraSmtpRestrictEnvelopeFrom FALSE
    mails sent by personas are correctly relayed as set in /opt/zimbra/postfix/conf/bysender but mails set from external account still have local address as sender and postfix tries to deliver them directly and mails ends deferred.

    I'm still looking for complete solution.


  4. #4
    Join Date
    Jun 2013
    Rep Power


    I'm facing the same issue with Zimbra 8, did you manage to resolve?


Similar Threads

  1. Relay per domain
    By xray0045 in forum Administrators
    Replies: 1
    Last Post: 11-30-2012, 01:01 AM
  2. [SOLVED] specify relay for a certain domain
    By maxxer in forum Administrators
    Replies: 2
    Last Post: 08-31-2010, 12:56 AM
  3. Use Zimbra as relay for one domain
    By zagg in forum Administrators
    Replies: 3
    Last Post: 11-26-2009, 08:30 AM
  4. Relay per Domain is not working
    By Savage82 in forum Administrators
    Replies: 0
    Last Post: 09-24-2009, 03:21 AM
  5. How to add relay domain to postfix
    By borispr in forum Administrators
    Replies: 2
    Last Post: 07-31-2008, 06:37 AM

Posting Permissions

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