Rate this page:

Sendmail

Sendmail requires libsasl in order to properly send authentication requests to SendGrid servers. The saslauthd server daemon is not required unless you plan to receive authentication requests to the same server. For more information on configuring sendmail for SASL support, check the official documentation.

Set the authorization credentials in /etc/mail/access

We have had reports that some customers have needed to install cyrus-sasl-plain in order to avoid authentication issues as well. We have not validated this requirement, so please make sure your system administrators, Ops, and/or InfoSec people approve this change before you make it!

AuthInfo:smtp.sendgrid.net "U:apikey" "P:yourAPIKey" "M:PLAIN"

Define the Smart Host in /etc/mail/sendmail.mc You should add these lines just after the commented "#dnl define('SMART_HOST', 'smtp.your.provider')dnl" line in the file

define(`SMART_HOST', `smtp.sendgrid.net')dnl
FEATURE(`access_db')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl

Update sendmail.cf and access.db files

(You will need to run these commands as 'su' or 'root')

$ cd /etc/mail
$ m4 sendmail.mc >sendmail.cf
$ makemap hash access.db < access

On older distros, you can run restart sendmail like so:

$ /etc/init.d/sendmail restart

If, however, you're using a newer version, do the following to restart:

$ service sendmail restart
Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the SendGrid tag on Stack Overflow.

        
        
        

        Thank you for your feedback!

        We are always striving to improve our documentation quality, and your feedback is valuable to us. Please select the reason(s) for your feedback or provide additional information about how we can improve:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        Step 1

        Get link

        Get a free personal referral link here

        Step 2

        Give $10

        Your user signs up and upgrade using link

        Step 3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more