how to use gmail smtp server for outgoing mail

Kevin J. Cummings cummings at kjchome.homeip.net
Tue Jan 18 07:13:13 UTC 2011


On 01/18/2011 01:28 AM, Donald Russell wrote:
> I have a domain associated with my comcast IP address (I use dyndns.org
> <http://dyndns.org>)
> 
> I installed sendmail on Fedora 14 and I can receive mail OK, but when I
> try to send outgoing mail, gmail.com <http://gmail.com> rejects it with
> the following error:
> 
>    ----- Transcript of session follows -----
> ... while talking to smtp.gmail.com <http://smtp.gmail.com>:
>>>> MAIL From:<don at drussell.dnsalias.com
> <mailto:don at drussell.dnsalias.com>> SIZE=634
> <<< 530-5.5.1 Authentication Required. Learn more at
> <<< 530 5.5.1 http://mail.google.com/support/bin/answer.py?answer=14257
> v19sm7563260wfh.0
> 554 5.0.0 Service unavailable
> 
> I've tried to update /etc/mail/auth/client-info
> and run makemap -r has /etc/mail/auth/client-info.db < client-info
> /etc/mail/make
> service sendmail restart
> 
> but not having any success. :-(
> 
> Obviously I don't have it configured properly for when sendmail is
> acting as a client. :-(
> 
> Here are the changes I've made to sendmail.mc <http://sendmail.mc> (and
> then cd /etc/mail; make)
> 
> #diff sendmail.mc <http://sendmail.mc> sendmail.mc.original
> 26d25
> < dnl # DNR 2011-01-12 Specify gmail, and add 2 lines to use port 587
> 28,30d26
> < define(`SMART_HOST', `smtp.gmail.com <http://smtp.gmail.com>')dnl
> < define(`RELAY_MAILER_ARGS',`TCP $h 587')
> < define(`ESMTP_MAILER_ARGS',`TCP $h 587')
> 88,89d83
> < dnl # DNR 2011-01-16 Add auth file
> < dnl FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl
> 122,124c116
> < dnl # DNR 2010-12-29 Accept mail from anywhere, not just local host
> < dnl # DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
> < DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
> ---
>> DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
> 157,158c149
> < dnl # DNR 2011-01-17 Remove following line as per above recommendation
> < dnl FEATURE(`accept_unresolvable_domains')dnl
> ---
>> FEATURE(`accept_unresolvable_domains')dnl
> 169d159
> < dnl # DNR 2010-12-29 Masquerade...
> 171d160
> < MASQUERADE_AS(`drussell.dnsalias.com <http://drussell.dnsalias.com>')dnl
> 175,176c164
> < dnl # DNR 2010-12-29 turn on following feature
> < FEATURE(masquerade_envelope)dnl
> ---
>> dnl FEATURE(masquerade_envelope)dnl
> 180,181c168
> < dnl # DNR 2010-12-29 turn on following feature
> < FEATURE(masquerade_entire_domain)dnl
> ---
>> dnl FEATURE(masquerade_entire_domain)dnl
> 
> 
> Any suggestions?

Donald,
	I just went through this exercise with my new ISP.  See my thread from
1/12/11 entitled:
		Sendmail needs authentication with Smart Host

Joe Zeff pointed me to:

	http://www.sendmail.org/m4/smtp_auth.html

It suggested I create /etc/mail/authinfo and put the authentication
information for the remote server in there.  Then build the hashed file
using:

	makemap hash /etc/mail/authinfo < /etc/mail/authinfo

Don't forget to add a FEATURE for authinfo to your sendmail.mc:

	FEATURE(`authinfo', `hash -o /etc/mail/authinfo.db')dnl

(Looks like you were trying to do this with your client-info file....
 check the options.  Notice I have a -o above and my makemap command
line looks different from what you are trying....)

And from the page listed above, I found a link to:

	http://www.jonfullmer.com/smtpauth/

While this second page is more about setting up a server that requires
authentication, it includes a blurb on how to test the authenticating
server.  Once I successfully sent a test message (using telnet) directly
to the outgoing server, getting the local configuration right was easy.

> Thank you

Good luck.

-- 
Kevin J. Cummings
kjchome at verizon.net
cummings at kjchome.homeip.net
cummings at kjc386.framingham.ma.us
Registered Linux User #1232 (http://counter.li.org)


More information about the users mailing list