Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How do I tweak directly (without going through m4 or .mc files) to make gmail (with SMTP AUTH) my smart relay? Notes:

  • With Comcast, I just put "" in, 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, but prefer gmail's.

  • I've confirmed I can send email using gmail's server:

    > openssl s_client -connect

    [... lots of certificate stuff ...]

    220 ESMTP y7sm198769pbg.43 
    ehlo at your service, [] 
    250-SIZE 35882577 
    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 
    354  Go ahead y7sm198769pbg.43 
    Subject: Hi there 

    End of message 

  • 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 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...

share|improve this question
Why do you want to directly edit the .cf ? Have you lost the .mc and cannot recreate it? – adamo May 1 '11 at 18:45
That's correct. I've edited by hand quite a lot, so the mc file I have is not even close to the cf file. – barrycarter May 2 '11 at 4:03
If you've documented your edits, it is possible that one can produce a working .mc that does what you want. – adamo May 2 '11 at 5:15
I haven't (this file started in 1997), but that is an idea... try to recreate my by tweaking until the resulting matches. I may try this or just find a non-free-but-cheap POP-before-SMTP server I can use. – barrycarter May 2 '11 at 16:35
Hm... – adamo May 2 '11 at 17:35

1 Answer 1

Is it imperative to use Google's smtp as a relay? If not, maybe this article can help.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.