Need help integrating sendmail with SendGrid
I've just signed up for sendgrid using the SMTP relay method. I've used this method successfully with other smart hosts requiring authentication, but not with SendGrid. I'm hoping some LQ expert has configured sendgrid and can help me out.
My sendmail.mc file has: Code:
define(`SMART_HOST',`smtp.sendgrid.net')dnl Code:
AuthInfo:smtp.sendgrid.net "U:myapikey" "P:mypw" I built authinfo.db with 'makemap hash authinfo < authinfo'. Permissions on authinfo.db are -rw-r-----. I've created /etc/sasl2/Sendmail.conf containing: Code:
pwcheck_method: saslauthd saslauthd is running. maillog has: Code:
Mar 31 10:29:14 hiram sm-mta[19809]: STARTTLS=client, relay=smtp.sendgrid.net., version=TLSv1.2, verify=FAIL, cipher=ECDHE-RSA-AES256-GCM-SHA384, bits=256/256 More ... Actually, I just read that saslauthd is not needed unless someone is authenticating with me. Later: stopped saslauthd. Changed authinfo to Code:
AuthInfo:smtp.sendgrid.net "U:myapikey" "P:mypw" "M:PLAIN" Code:
Mar 31 10:55:20 hiram sm-mta[23284]: STARTTLS=client, relay=smtp.sendgrid.net., version=TLSv1.2, verify=FAIL, cipher=ECDHE-RSA-AES256-GCM-SHA384, bits=256/256 I tried putting the AuthInfo stuff in access.db. Same results. |
Hi,
Did you try to use port 587 (submission) to connect to the smarthost? See this for more details Regards |
Quote:
Code:
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl Code:
Apr 3 00:18:33 hiram sm-mta[5664]: STARTTLS=client, relay=smtp.sendgrid.net., version=TLSv1.2, verify=FAIL, cipher=ECDHE-RSA-AES256-GCM-SHA384, bits=256/256 port 587, as I understand it, is for TLS. This host does not have a TLS certificate. Before I go off and create one, would that be the problem with getting the "Deferred"? A certificate gets created for a specific domain. This host has several domains. If I need to create a certificate, do I just pick one of them? |
Hi,
Quote:
My advise to use the submission port (587), is because I use a similar setup using gmail as smarthost BTW looking again your /etc/mail/authinfo and that of the gmail setup, I think you should use something like: Code:
AuthInfo:smtp.sendgrid.net "U:root" "I:myapikey" "P:mypw" |
Quote:
I do have a ticket in, but nothing back from them yet. There is no support forum, or tech support email contact. You have to call sales! |
This SendGrid page seems fairly comprehensive.
Oops. My bad. That link is for postfix, not sendmail. Bathory posted the relevant page in #2. Sorry... |
I got some feedback from sendGrid tech support. Their setup page was confusing. I had to enter an Id string whereupon it returns a password. I understood the Id string to be the 'apikey', to correspond to "yourusername" in the link referenced in #2, and to be the U: parameter in the AuthInfo, but no. The U: parameter is literally "apikey"! Once I used that, it worked. Dunno what the Id string is used for, or why their documentation says "yourusername". It's not "yourusername".
|
All times are GMT -5. The time now is 03:01 PM. |