ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Zimbra SMTP Relay Through SendGrid

    IT Discussion
    zimbra email smtp smtp relay sendgrid mta
    2
    3
    14.9k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by scottalanmiller

      Setting up SendGrid as an SMTP Relay for Zimbra is not entirely obvious. But it can be done and is not too hard. Assuming that you have a SendGrid account already and you have made an SMTP API Key, we are ready to begin configuring Zimbra. SendGrid offers free accounts for this.

      First, we need to be the zimbra user for all of this. If you try to do this as root, you will get errors that LMDB is not supported in CentOS 7 (and many other OS releases.) This is because you need to be using Zimbra's own version of the tools, not the OS ones.

      su - zimbra
      

      Now we can begin. First we set the relay host.

      zmprov ms `zmhostname` zimbraMtaRelayHost smtp.sendgrid.net
      

      Now we need to set our password file. For SendGrid, the username for the key is called literally apikey. This is a little confusing to read.

      echo smtp.sendgrid.net apikey:your_actual_api_key > /opt/zimbra/conf/relay_password
      

      Now we need to process the map into an LMDB file.

      postmap /opt/zimbra/conf/relay_password
      

      We can test that this worked with this command.

      postmap -q smtp.sendgrid.net /opt/zimbra/conf/relay_password
      

      Now to create the map from that file.

      zmprov ms `zmhostname` zimbraMtaSmtpSaslPasswordMaps lmdb:/opt/zimbra/conf/relay_password
      

      Now we override the outgoing server name.

      zmprov ms `zmhostname` zimbraMtaSmtpCnameOverridesServername no
      

      Enable TLS

      zmprov ms `zmhostname` zimbraMtaSmtpTlsSecurityLevel may
      

      Zimbra will pick up these changes automatically within two minutes.

      dbeatoD 1 Reply Last reply Reply Quote 2
      • dbeatoD
        dbeato @scottalanmiller
        last edited by

        @scottalanmiller said in Zimbra SMTP Relay Through SendGrid:

        Setting up SendGrid as an SMTP Relay for Zimbra is not entirely obvious. But it can be done and is not too hard. Assuming that you have a SendGrid account already and you have made an SMTP API Key, we are ready to begin configuring Zimbra. SendGrid offers free accounts for this.

        First, we need to be the zimbra user for all of this. If you try to do this as root, you will get errors that LMDB is not supported in CentOS 7 (and many other OS releases.) This is because you need to be using Zimbra's own version of the tools, not the OS ones.

        su - zimbra
        

        Now we can begin. First we set the relay host.

        zmprov ms `zmhostname` zimbraMtaRelayHost smtp.sendgrid.net
        

        Now we need to set our password file. For SendGrid, the username for the key is called literally apikey. This is a little confusing to read.

        echo smtp.sendgrid.net apikey:your_actual_api_key > /opt/zimbra/conf/relay_password
        

        Now we need to process the map into an LMDB file.

        postmap /opt/zimbra/conf/relay_password
        

        We can test that this worked with this command.

        postmap -q smtp.sendgrid.net /opt/zimbra/conf/relay_password
        

        Now to create the map from that file.

        zmprov ms `zmhostname` zimbraMtaSmtpSaslPasswordMaps lmdb:/opt/zimbra/conf/relay_password
        

        Now we override the outgoing server name.

        zmprov ms `zmhostname` zimbraMtaSmtpCnameOverridesServername no
        

        Enable TLS

        zmprov ms `zmhostname` zimbraMtaSmtpTlsSecurityLevel may
        

        Zimbra will pick up these changes automatically within two minutes.

        Nice, I love it, it is almost as postfix since ZImbra uses postfix 🙂

        1 Reply Last reply Reply Quote 2
        • scottalanmillerS
          scottalanmiller
          last edited by

          Yup, basically just automating Postfix configs.

          1 Reply Last reply Reply Quote 1
          • 1 / 1
          • First post
            Last post