Relay Tips Based on User/Domain Receiver on Zimbra 8.5-8.6

Home » Zimbra » Relay Tips Based on User/Domain Receiver on Zimbra 8.5-8.6
Zimbra 21 Comments

I have a condition where my customers cannot sending email for some domain by directly. I give an advice to them for using Relay for all external delivery. But they do not want all external delivery using relay for security reason. They want just some domain receiver for using relay. Okay, because them using Zimbra 8.5/8.6, i can do relay for some domain only.

# Create transport for domain receiver that would be relay

su - zimbra
vi /opt/zimbra/postfix/conf/transportfile

Fill with the following example       :[]       :[] :[]

The above example, every sending email to and or, will be relay to If your relay server using port such as 465, 587 or another port, you can change like this []:587

# Postmap Transport

postmap /opt/zimbra/postfix/conf/transportfile

# Adding Transport table

zmprov ms zimbraMtaTransportMaps "lmdb:/opt/zimbra/postfix/conf/transportfile,proxy:ldap:/opt/zimbra/conf/"

Change with your hostname of email server. Or you can using `zmhostname` for independently

# Restart Zimbra Services

zmcontrol restart

Please try to sending email. Every sending email to and or, email server will be relay to if sending email to another domain, email server will directly without relay to relay server

Note : if adding/delete user or domain in transportfile, don’t forget to postmap and reload postfix Zimbra (postfix reload)

Good luck and hopefully useful 😀

21 thoughts on - Relay Tips Based on User/Domain Receiver on Zimbra 8.5-8.6

  • I recently upgraded zimbra from 8.0.7 to 8.5.1. Before upgrade, my customers were using outlook to relay outgoing emails through zimra. The SMTP settings required them first authenticate using their username and password.

    However, after upgrade, the outlook can only fetch emails from zimbra(POP3) but they cannot send emails anymore. Each time they try to send email, outlook pops up asking for username and password. It appears that Zimbra 8.5.1 does not authenticate SMTP from remote clients anymore.

    Help me.


    • Hi Stanmak,

      Could you please give me information on zimbra.log while you are sending email using Outlook? could you also sent to me how you configure your Outlook?

  • hi, thanks for your articles it works can you please give me link or article on how can i send emails on other domain emails

  • Very interesting this tip. Is exactly what I was looking for. I can not send messages from a server to Hotmail receives but does not put them in the users mailbox .
    But I can send messages to from another server that I own. Which in this case can be called

    I followed the steps but when I finish step 4, I get this message:

    “ERROR: account.NO_SUCH_SERVER (no such server:”

    Obviously I put here the correct mail server (no to do relay my messages to server.

    What is wrong?

  • Hi. Excellent post. Just what I was looking for. Could you please just give me the direction to add user/password authentication to use on the relay server? When I try to send emails through external relay, I get the message asking for authentication. Thanx

  • Hi Iman just a question. If I have 4 domains in my zimbra but i want to modify the relay for one of them I hace to declare de 4 domains in /opt/zimbra/postfix/conf/transportfile? or just the one that I want to modify?.

    I’m planing a migration and I want to createa domain in my zimbra and the accounts but I still need to deliver the mails to the actual smtp server if the users of the other domains in zimbra send emails to that domain.

  • Hi Iman, thanks. Mayby I didn’t explain well. I want to be sure. My english isn’t good.

    In my zimbra I have 3 domains:


    We have in external mail service the DomainD which we want to migrate to our zimbra server. But I need first to create the domain and all acounts, but meanwhile If any user from @domainA send an email to @domainD I want to deliver in the current relay which is still the external mail service.

    So, I understand I only need to declare @domainD in the .cf and the other domains will continue to working properly (delivering within zimbra).

    Thanks again.

    • Hi,

      Please use the following command

      zmprov ms zimbraMtaTransportMaps "proxy:ldap:/opt/zimbra/conf/"
  • hi, I’m using Zimbra 8.0.4 and follow step “adding transport table” return error:
    “ERROR: account.INVALID_ATTR_NAME (invalid attr name: invalid attr name – unable to modify attributes: zimbraMtaTransportMaps: attribute type undefined)”
    please help to fix that problems.