How do I tweak sendmail.cf directly (without going through m4 or .mc files) to make gmail (with SMTP AUTH) my smart relay? Notes:
With Comcast, I just put "DSsmtp.comcast.net" in sendmail.cf, since they authenticate by IP, and don't require "SMTP AUTH"
I'm now w/ Qwest, and want to use gmail's SMTP AUTH server. I realize I could use smtp.q.com, but prefer gmail's.
I've confirmed I can send email using gmail's server:
> openssl s_client -connect smtp.gmail.com:465 CONNECTED(00000003) [... lots of certificate stuff ...] 220 mx.google.com ESMTP y7sm198769pbg.43 ehlo 250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH 250 ENHANCEDSTATUSCODES auth plain AGNhcnRlci5iYXJyeQxxxxxxxxxx 235 2.7.0 Accepted mail from: 250 2.1.0 OK y7sm198769pbg.43 rcpt to: 250 2.1.5 OK y7sm198769pbg.43 data 354 Go ahead y7sm198769pbg.43 Subject: Hi there End of message QUIT DONE
Based on the above, the sendmail changes I need are:
connect on port 465, not port 25 (although port 25 w/ STARTTLS also works)
connect using SSL
Send "auth plain AGNhcnRlci5iYXJyeQxxxxxxxxxx" after ehlo and before rcpt.
I know that tweaking the mc file and running m4 is the correct way to do this, but my .cf file is hand-customized and quite fragile, so I'm hoping to avoid that.
I realize I could have sendmail deliver to localhost:26 and have a Perl script running there that relays to smtp.gmail.com:465 using openssl (and passes data as is, except for the "AUTH PLAIN" line), but this seems ugly.
Other solutions appreciated. EG, if anyone knows of a free open relay...