How To Configure Outgoing SMTP Authentication on Zimbra 8.5

Home » Zimbra » How To Configure Outgoing SMTP Authentication on Zimbra 8.5
Zimbra 70 Comments

This guidance will describe how to configure outgoing smtp authentication on Zimbra 8.5. If you have Zimbra 8.0, you can see at the following link : http://www.excellent.co.id/product-services/zimbra/tips-zimbra-mta-relay-menggunakan-user-authentication-pada-zimbra-8/

INFORMATION

SMTP Relay : mailrelay.example.com
username   : relay@example.com
password   : RelayExample
port       : 587/465

Copy and paste this command to your Zimbra server

echo mailrelay.example.com relay@example.com:RelayExample > /opt/zimbra/conf/relay_password
postmap /opt/zimbra/conf/relay_password
postmap -q mailrelay.example.com /opt/zimbra/conf/relay_password
zmprov ms `zmhostname` zimbraMtaSmtpSaslPasswordMaps lmdb:/opt/zimbra/conf/relay_password
zmprov ms `zmhostname` zimbraMtaSmtpSaslAuthEnable yes
zmprov ms `zmhostname` zimbraMtaSmtpCnameOverridesServername no
zmprov ms `zmhostname` zimbraMtaSmtpTlsSecurityLevel may
zmprov ms `zmhostname` zimbraMtaSmtpSaslSecurityOptions noanonymous
zmprov ms `zmhostname` zimbraMtaRelayHost mailrelay.example.com:587

Don’t forget to change all information system on above with your system. Updates configuration will be automatic within 2 minutes. This is example log on my Zimbra mail server when sending to outside

to=<xxxxx@gmail.com>, relay=mailrelay.example.com[103.xx.xxx.xxx]:587, delay=7.7, delays=0/0.01/0.16/7.5, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 636893D40E1)

Good luck and hopefully useful 😀

Source : http://wiki.zimbra.com/wiki/Outgoing_SMTP_Authentication

70 thoughts on - How To Configure Outgoing SMTP Authentication on Zimbra 8.5

  • hi after doing this i lost incoming emails id there a connection with this commands? how can i undo this command thanks

  • im sory local mail is working but may outgoing smtp still not sending out side thanks im using zimbra 8.5 im receiving host not found, do i have to configure may router for outgoing smtp?

    • Hi Beph,

      For sending email to outside, you should have some information below :

      1. You should have a real domain
      2. You should have internet connection
      3. Your internet connection not blocking port 25 outgoing
      4. Your public IP not blocked on RBL

  • Hey this has been hectic to me.. I need to setup only a smtp server to relay emails on our network. We have blocked port 25 and would like to use authentication + ssl. we have several users with different domain names ie xxx1.com, bvgs.com

    i have managed to install zimbra on centos6. may be i missed foundamental requirements at the start stage. I kindly need help

  • i have a followed these two guides but i hit the rock: How To Install Zimbra 8.6 on Ubuntu 14.04 Part 1 & How To Install Zimbra 8.6 on Ubuntu 14.04 Part 2

  • Am stuck

    i run a small isp with clients that require smtp to relay their emails.
    I have extra free public ips on a /29 from my isp
    My isp has blocked port 25, normally we use their smtp to relay emails on our network but we are so many that send junk/spam and make our public ip blacklisted. Now i ended up blocking port 25 on my network. unlisted the ip from RBL. Now i require to set up an smtp server that each client has his/her authentication credentials so as to know who is spamming and i can deactivate their account

    I need to achieve to create an smtp server only.

    Now this is what i have:
    1.valid domain name : ie- example.com
    2. i have internet connection with static ip
    3 . i decide to use host name as: nbi , so i head to my cpanel and create a subdomain nbi.example.com
    4. I have assigned my sever: 192.168.20.2 with gateway 192.168.20.1
    5. I install cento6.7
    6. Prepare my centos for zimbra with this :
    wget -c http://imanudin.net/wp-content/uploads/2015/08/prepare-zimbra-centos6.sh
    chmod +x prepare-zimbra-centos6.sh
    sh prepare-zimbra-centos6.sh
    7. after i get to install zimbra folloowing this : http://imanudin.net/2015/03/14/how-to-install-zimbra-8-6-on-centos-6-part-2/
    8. i hit a rock while nslookup nbi.example.com does not resolve to my local ip:192.168.20.2 but resolves to my web host shared ip.
    9. i proceed and not change the host and at last i get my emails look admin@nbi.example.com
    10 everything runs ok but am stuck not aware were to start from .
    11. am able to login to zimbra admin console.

  • Basically, we are using two email servers in techmech one is for internal emailing that is with extension 1@techmech-uae.com (Zimbra Email) and 2nd one is for external with extension 2@techmech.net on which only selected users have access.
    By rule, the uae.com email users are not allowed to send emails outside domain but they could send and receive emails from our second email techmech.net.
    Please let us know how you can configure this in Zimbra email.

  • Hi,

    how can I use different smtp accounts ?

    in zimbra i’ll import different accounts and I need that every account can send trought the same smtp external server but with his own user and pass

  • Dear Iman,

    Thank you for your explanation, i’m using zimbra 8.6 and i’ve try your command and try to test sending email to yahoo. I got a bounce back email from mailer-daemon the email says ” : host myinternetdomain.com[192.190.XX.XXX] said:
    550-Verification failed for 550-The mail
    server could not deliver mail to user@mylocaldomain.local. The
    account or domain may not exist, they may be blacklisted, or missing the
    proper dns entries. 550 Sender verify failed (in reply to RCPT TO command)

    I have set the ” echo mail.myinternetdomain.com user@myinternetdomain.com:Password > /opt/zimbra/conf/relay_password ” but why the bounce back mail is said 550-The mail
    server could not deliver mail to user@mylocaldomain.local. The
    account or domain may not exist, they may be blacklisted.

    Why mail deliver to local domain? Any wrong with my configuration?

    Thank you

    • Hello Dapid,

      You should use domain that recognized by internet. Your domain testing is mylocaldomain.local and i think your domain cannot recognized by internet

      • Dear Iman,

        I’m still confuse, newbie about this. How to make mylocaldomain.local could recognized by internet. My zimbra is using ip private, not ip public.

        Thank you

          • Dear Iman,

            I want to create my local mail server has a function to download email in user a@myinternetdomain.com to a@mylocaldomain.com and distribute to mail client, it is success using fetchmail. Then the problem is when i try to sending out the email i got the error bounce mail. Could i use the smtp.myinternetdomain.com for sending out mail from local server?

            Thank you

          • Hello Dapid,

            You can use real domain (local server or on the internet). When you sending email and get rejected by server, it’s caused your domain name could not recognized (mylocaldomain).

            You still can use Fetchmail although same domain (local and internet)

      • Dear Iman,

        Thank you, i just write a wrong port in my smtp relay configuration. It should using port 465. I still get stuck if i use smtp.myinternetdomain.com, i got the postfix status from zimbra log the mail is status=deferred lost connection with myinternetdomain.com while receiving the initial server greeting. But if i use the smtp.gmail.com, everything works good.

  • hi i have set up the zimbra here and its working internal/local

    we have an existing smtp email provider/host from using
    out MS outlook

    how can i point our local zimbra for outgoing msgs to our existing smtp email provider/host

    using our pop and smtp settings

  • Hi Iman,

    Thank you for your time to response my question before.
    I am still stuck with my smtp authentication.
    First let me explain my concept, i would like to create local mail server using zimbra at my office. My local mail server installed under nat and using ip private. I would like to create the local mail server has a function to download email from some user in my internet mail server. It success using fetchmail. But if i want to sending email out to all internet domain, i still get stuck. I have following your article above. I already have a domain that could be recognize from internet and already using static ip public. My local server could be accessed from another network using A record pointing to my ip public.
    My question is what should I have to prepare to apply my concept? Do I setting up my internet domain in my local server like your explanation before?
    Thank You…

    • Hello Dapid,

      Yes, you should configure internet domain on your local server. I can use imanudin.net domain on my local Zimbra. So, i can retrieve email by fetchmail and sending email directly from my local server (have connection internet or relay to relay server)

      • Hi Iman,

        Thanks for your response. I will try to reconfigure my local mail server. One more question, is it possible if i am using a sub domain from myinternetdomain.com for my local mail server?

        Thank you

        • Hi Iman,

          I have finished reconfigure my local mail server and set a sub domain from my intenet domain to my local mail server. I have try send and receive from and success. But i still stuck if i try to relay the smtp to myinternetdomain.com, i got bounce mail like this: 550 SMTP
          AUTH is required for message submission on port 587 (in reply to RCPT TO
          command)

          Please advise…

          Thank you

          • Many Thanks Iman,

            How about this error ” 550 SMTP
            AUTH is required for message submission on port 587 (in reply to RCPT TO
            command) ”

            I still not done when relay to myinternetdomain.com

          • Hello,

            Are you have been perform all process below?

            echo mailrelay.example.com relay@example.com:RelayExample > /opt/zimbra/conf/relay_password
            postmap /opt/zimbra/conf/relay_password
            postmap -q mailrelay.example.com /opt/zimbra/conf/relay_password
            zmprov ms `zmhostname` zimbraMtaSmtpSaslPasswordMaps lmdb:/opt/zimbra/conf/relay_password
            zmprov ms `zmhostname` zimbraMtaSmtpSaslAuthEnable yes
            zmprov ms `zmhostname` zimbraMtaSmtpCnameOverridesServername no
            zmprov ms `zmhostname` zimbraMtaSmtpTlsSecurityLevel may
            zmprov ms `zmhostname` zimbraMtaSmtpSaslSecurityOptions noanonymous
            zmprov ms `zmhostname` zimbraMtaRelayHost mailrelay.example.com:587
            
          • Hi Iman,

            Yes i already following all process below.

            Could you help me to track my problem?

            Thanks in advance

  • please i want to known if there is a way to receive email from internet with Zimbra Server without register over a dynamic DNS or domain ? (MX record configuration)

  • Hi Iman,

    I’m still have no deal with smtp authentication. Do you have another tips to make the recipients read my email address as @myinternetdomain.com address? Even the mail send through my local mail server with dns @local.myinternetdomain.com

    Thanks a lot

  • Hi Iman,
    Hope u r doing good…. I followed the steps to configure the Zimbra. I can able to receive all the mails to my newly configured mail ID but whenever i am sending to other domains most of the mails going in spam any few domains not receiving my mails. pls advice…

  • hi iman ,
    can you please me with the error i am facing
    few mails are going in to deffer and the error is

    time out while sending message body

    thanks

  • hi mas Iman,
    saya sedang membuat email server zimbra, saat saya test internal OK, test receive dari external juga OK, tapi pada waktu test sending gagal..

    dbi hasil log di zimbra :
    Mar 10 11:27:20 mail postfix/smtpd[6877]: connect from mail.domainx.in[10.150.x.xx]
    Mar 10 11:27:20 mail postfix/smtpd[6877]: NOQUEUE: filter: RCPT from mail.domainx.in[10.150.x.xx]: : Sender address triggers FILTER smtp-amavis:[127.0.0.1]:10026; from= to= proto=ESMTP helo=
    Mar 10 11:27:20 mail postfix/smtpd[6877]: 41DD8420D85: client=mail.domainx.in[10.150.x.xx]
    Mar 10 11:27:20 mail postfix/cleanup[6914]: 41DD8420D85: message-id=
    Mar 10 11:27:20 mail postfix/qmgr[12245]: 41DD8420D85: from=, size=834, nrcpt=1 (queue active)
    Mar 10 11:27:20 mail postfix/smtpd[6877]: disconnect from mail.domainx.in[10.150.x.xx]
    Mar 10 11:27:20 mail postfix/dkimmilter/smtpd[6980]: connect from localhost[127.0.0.1]
    Mar 10 11:27:20 mail postfix/dkimmilter/smtpd[6980]: 67D01420D86: client=localhost[127.0.0.1]
    Mar 10 11:27:20 mail postfix/cleanup[6914]: 67D01420D86: message-id=
    Mar 10 11:27:20 mail postfix/qmgr[12245]: 67D01420D86: from=, size=1319, nrcpt=1 (queue active)
    Mar 10 11:27:20 mail postfix/dkimmilter/smtpd[6980]: disconnect from localhost[127.0.0.1]
    Mar 10 11:27:20 mail postfix/smtp[6929]: 41DD8420D85: to=, relay=127.0.0.1[127.0.0.1]:10026, delay=0.25, delays=0.06/0.01/0.01/0.18, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10030): 250 2.0.0 Ok: queued as 67D01420D86)
    Mar 10 11:27:20 mail postfix/qmgr[12245]: 41DD8420D85: removed
    Mar 10 11:27:20 mail postfix/amavisd/smtpd[7134]: connect from localhost[127.0.0.1]
    Mar 10 11:27:20 mail postfix/amavisd/smtpd[7134]: EC931420D85: client=localhost[127.0.0.1]
    Mar 10 11:27:20 mail postfix/cleanup[6914]: EC931420D85: message-id=
    Mar 10 11:27:20 mail postfix/qmgr[12245]: EC931420D85: from=, size=1687, nrcpt=1 (queue active)
    Mar 10 11:27:20 mail postfix/amavisd/smtpd[7134]: disconnect from localhost[127.0.0.1]
    Mar 10 11:27:20 mail postfix/smtp[7005]: 67D01420D86: to=, relay=127.0.0.1[127.0.0.1]:10032, delay=0.56, delays=0.05/0.01/0/0.5, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as EC931420D85)
    Mar 10 11:27:20 mail postfix/qmgr[12245]: 67D01420D86: removed
    Mar 10 11:27:22 mail postfix/smtp[7136]: connect to gmail-smtp-in.l.google.com[74.125.200.27]:25: Connection refused
    Mar 10 11:27:22 mail postfix/smtp[7136]: connect to alt1.gmail-smtp-in.l.google.com[74.125.28.27]:25: Connection refused
    Mar 10 11:27:22 mail postfix/smtp[7136]: connect to alt2.gmail-smtp-in.l.google.com[74.125.30.27]:25: Connection refused
    Mar 10 11:27:22 mail postfix/smtp[7136]: connect to alt3.gmail-smtp-in.l.google.com[173.194.197.26]:25: Connection refused
    Mar 10 11:27:22 mail postfix/smtp[7136]: connect to alt4.gmail-smtp-in.l.google.com[173.194.219.26]:25: Connection refused
    Mar 10 11:27:22 mail postfix/smtp[7136]: EC931420D85: to=, relay=none, delay=1.5, delays=0.01/0.01/1.5/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[173.194.219.26]:25: Connection refused)

    kira2 masih ada kurang dimana yah mas? bisa kasih advicenya

    terimakasih

    • Hi mas,

      Jika dicek di log, pesannya connection refused. Coba pastikan beberapa info berikut :

      – Pastikan port 25 outgoing open di firewall-nya Linux. Jika sudah open
      – Pastikan port 25 outgoing open di firewall/router. Jika sudah open
      – Coba tanya pada provider internet koneksi apakah port 25 outgoing ditutup sehingga tidak bisa kirim email

  • Hi Iman

    Thank you for the great tutorials. I have followed many of your tutorials. But currently i’m having some trouble with my Zimbra 8.7 server, that is it is sending mails from unknown user/domain which showing the “Origin Host” as localhost.localdomain so I want to enforce authentication to sending mails from localhost.localdomain. Can you kindly give me a way how can I do it?

    Thank you,
    Hamid

  • Hello Iman. Thank you very much for your guide. Would this guide work on Zimbra 8.7?

    I have DKIM, SPF, DMARC and PTR perfectly configured for my domain. However all e-mails still arrive to spam. Before switching to an external sender, I was wondering
    Do you think this could have any effect on the e-mails arriving to the spam folder?

    Received: from localhost (localhost.localdomain [127.0.0.1])
    by mydomain.com (Postfix)
    How could I correct it? I’ve already set the hostname properly via /etc/hosts and zimbra already states my domain is the hostname…

    Any advise?

    • Hi Daniel,

      Where you found information like that? whether from full header? if yes, it’s ok because i am also have same information from full header

  • how can i set up may account for outgoing email in my iphone using zimbra..can i ask what is the host name ? i already set my incoming email .

    • Hi Vergel,

      You can configure with SMTP SSL/TLS with port 465 or 587. The hostname refer into your server that has been defined on Public DNS like mail.imanudin.net.

      You can configure outgoing email same as incoming email. Iphone need trusted SSL on your email server. So, please install SSL Certificate on your server such as Symantec, Godaddy, Comodo, Digicert and etc

  • Help me, please
    I can help with this error, so far only happens to send email to info@planetavirtual.biz
    Centos 6
    Zimbra 8.6, DNSCACHE active.

    ———————————————————————————————–
    —– The following addresses had permanent fatal errors —–

    (reason: 550-Verification failed for )

    —– Transcript of session follows —–
    … while talking to planetavirtual.biz.:
    >>> DATA
    <<< 550-Verification failed for
    <<< 550-No Such User Here
    <<< 550 Sender verify failed
    550 5.1.1 … User unknown
    <<< 503-All RCPT commands were rejected with this error:
    <<< 503-Sender verify failed
    <<< 503 Valid RCPT command must precede DATA

LEAVE A COMMENT