LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Sendmail set up with Yahoo (http://www.linuxquestions.org/questions/linux-newbie-8/sendmail-set-up-with-yahoo-4175423741/)

milksnake12 08-24-2012 01:21 AM

Sendmail set up with Yahoo
 
I'm trying to get Sendmail to relay through Yahoo. I got it working with gmail after following some tutorials, but I'm hanging up on yahoo. I made certificates for the gmail one and left all the configurations I had for the gmail one but just inserted the Yahoo smtp stuff - but no go. My authinfo file looks like this:

AuthInfo:smtp.mail.yahoo.com "U:myUsername@yahoo.com" "I:myUsername@yahoo.com" "P:Password" "M:PLAIN"
AuthInfo:smtp.mail.yahoo.com:465 "U:myUsername@yahoo.com" "I:myUsername@yahoo.com" "P:Password" "M:PLAIN"

and the part of my sendmail.mc thats been changed is:

FEATURE(`authinfo',`hash /etc/mail/authinfo.db')
define(`SMART_HOST',`smtp.mail.yahoo.com')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 465')
define(`ESMTP_MAILER_ARGS', `TCP $h 465')
define(`confCACERT_PATH',`/usr/share/ssl/certs')
define(`confCACERT',`/usr/share/ssl/certs/ca-bundle.crt')
define(`confSERVER_CERT',`/usr/share/ssl/certs/sendmail.pem')
define(`confSERVER_KEY',`/usr/share/ssl/certs/sendmail.pem')
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')
define(`confAUTH_OPTIONS', `A')dnl


I left it how it was with gmail and redid the makemap hash on the authinfo and ran the m4 sendmail.mc>sendmail.cf and restarted sendmail and I get nothing. I can switch it back to gmail's info and it sends, but not Yahoo. My mail log has this in it after my last email attempt after redoing the authinfo and sendmail:

Aug 23 15:59:54 localhost sendmail[2857]: starting daemon (8.14.4): SMTP+queueing@01:00:00
Aug 23 15:59:54 localhost sendmail[2857]: STARTTLS=server: file /usr/share/ssl/certs/sendmail.pem unsafe: Group readable file
Aug 23 15:59:54 localhost sm-msp-queue[2867]: starting daemon (8.14.4): queueing@01:00:00
Aug 23 16:00:00 localhost sendmail[2873]: q7NN00qx002873: from=userName, size=216, class=0, nrcpts=1, msgid=<201208232300.q7NN00qx002873@localhost.localdomain>, relay=root@localhost
Aug 23 16:00:01 localhost sendmail[2874]: q7NN004O002874: from=<userName@localhost.localdomain>, size=487, class=0, nrcpts=1, msgid=<201208232300.q7NN00qx002873@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Aug 23 16:00:01 localhost sendmail[2873]: q7NN00qx002873: to=example@aol.com, ctladdr=userName (500/500), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30216, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q7NN004O002874 Message accepted for delivery)
Aug 23 16:00:21 localhost sendmail[2876]: q7NN004O002874: to=<example@aol.com>, ctladdr=<userName@localhost.localdomain> (500/500), delay=00:00:20, xdelay=00:00:20, mailer=relay, pri=120487, relay=smtp.mail.yahoo.com [98.138.84.55], dsn=4.0.0, stat=Deferred: Connection reset by smtp.mail.yahoo.com

I'm on CentOS 2.6.32-220.17.1.el6.x86_64 if that helps.

Anyone had any success using Sendmail and Yahoo to relay emails? Everything look ok in the authinfo and sendmail.mc? Not sure if any of those lines in the .mc need to be removed from the gmail setup I had or are they ok the way they are?

Thanks for any help on this, I've been stuck on this for a few days...

deep27ak 08-24-2012 02:17 AM

Since you have mention 465 as default port for sendmail you need to enable those port in sendmail.mc file to be able to send mail

One way is to comment those lines so that you can send mail on port 25.
Code:

define(`RELAY_MAILER_ARGS', `TCP $h 465')
define(`ESMTP_MAILER_ARGS', `TCP $h 465')

Secondly inside sendmail.mc

Change as following
Code:

dnl # DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
 DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl

 # uncomment for sendmail to listen on port 587
 DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl

 # uncomment for sendmail to listen on port 587
 DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl

check your firewall

Code:

#netstat -ntlp | grep sendmail

milksnake12 08-24-2012 02:49 AM

I got 465 from a website that said Yahoo smtp uses 465, should that be something different?
Quote:

Since you have mention 465 as default port for sendmail you need to enable those port in sendmail.mc file to be able to send mail
Comment as in comment them out, or change "465" to "25"
Quote:

One way is to comment those lines so that you can send mail on port 25.
Code:

define(`RELAY_MAILER_ARGS', `TCP $h 465')
define(`ESMTP_MAILER_ARGS', `TCP $h 465')


I made these changes and ran m4 again and still no emails made it through.
Quote:

Secondly inside sendmail.mc

Change as following
Code:

dnl # DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
 DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl

 # uncomment for sendmail to listen on port 587
 DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl

 # uncomment for sendmail to listen on port 587
 DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl


I turned it off just to make sure when I tested.
Quote:

check your firewall

Code:

#netstat -ntlp | grep sendmail

Any other ideas? Should I post my whole sendmail.mc?
And thanks for the help by the way!

deep27ak 08-24-2012 03:16 AM

Yes please post your sendmail.mc and maillog

I have not worked with yahoo mail server as I use smtp.gmail.com

For reference you can use this page
Sendmail error messages
Configuring Sendmail

milksnake12 08-24-2012 02:38 PM

I cut out everything that was commented out of the sendmail.mc to reduce the size. So here is what I got.

SENDMAIL.MC:
Code:

divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for linux')dnl
OSTYPE(`linux')dnl
define(`SMART_HOST',`smtp.mail.yahoo.com')dnl
define(`confDEF_USER_ID', ``8:12'')dnl
dnl define(`confAUTO_REBUILD')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST', `True')dnl
define(`confDONT_PROBE_INTERFACES', `True')dnl
define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
define(`STATUS_FILE', `/var/log/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
define(`confTO_IDENT', `0')dnl
FEATURE(`no_default_msa', `dnl')dnl
FEATURE(`smrsh', `/usr/sbin/smrsh')dnl
FEATURE(`mailertable', `hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
FEATURE(local_procmail, `', `procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db', `hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
DAEMON_OPTIONS(`Port=smtps, Name=MTA')dnl
dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl
dnl DAEMON_OPTIONS(`Name=MTA-v4, Family=inet, Name=MTA-v6, Family=inet6')
FEATURE(`accept_unresolvable_domains')dnl
LOCAL_DOMAIN(`localhost.localdomain')dnl
FEATURE(`authinfo',`hash /etc/mail/authinfo.db')
dnl define(`RELAY_MAILER_ARGS', `TCP $h 465')
dnl define(`ESMTP_MAILER_ARGS', `TCP $h 465')
define(`confCACERT_PATH',`/usr/share/ssl/certs')
define(`confCACERT',`/usr/share/ssl/certs/ca-bundle.crt')
define(`confSERVER_CERT',`/usr/share/ssl/certs/sendmail.pem')
define(`confSERVER_KEY',`/usr/share/ssl/certs/sendmail.pem')
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')
define(`confAUTH_OPTIONS', `A')dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
dnl MAILER(cyrusv2)dnl

My authinfo file is still the same.

Mail log looks like this:
Code:

Aug 24 05:25:18 localhost sendmail[3147]: q7OCPI8r003147: from=userName, size=216, class=0, nrcpts=1, msgid=<201208241225.q7OCPI8r003147@localhost.localdomain>, relay=root@localhost
Aug 24 05:25:19 localhost sendmail[3058]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA: cannot bind: Address already in use
Aug 24 05:25:19 localhost sendmail[3058]: daemon MTA: problem creating SMTP socket
Aug 24 05:25:24 localhost sendmail[3058]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA: cannot bind: Address already in use
Aug 24 05:25:24 localhost sendmail[3058]: daemon MTA: problem creating SMTP socket
Aug 24 05:25:24 localhost sendmail[3058]: NOQUEUE: SYSERR(root): opendaemonsocket: daemon MTA: server SMTP socket wedged: exiting
Aug 24 05:25:24 localhost sm-msp-queue[3069]: q7OCMu9b002954: to=example@aol.com, ctladdr=userName (500/500), delay=00:02:28, xdelay=00:00:50, mailer=relay, pri=120216, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection reset by [127.0.0.1]
Aug 24 05:25:24 localhost sendmail[3072]: q7OCOcv8003072: to=example@aol.com, ctladdr=userName (500/500), delay=00:00:46, xdelay=00:00:46, mailer=relay, pri=30216, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection reset by [127.0.0.1]
Aug 24 05:25:24 localhost sendmail[3147]: q7OCPI8r003147: to=example@aol.com, ctladdr=userName (500/500), delay=00:00:06, xdelay=00:00:06, mailer=relay, pri=30216, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection reset by [127.0.0.1]
Aug 24 05:25:24 localhost sm-msp-queue[3069]: q7OCLZ64002851: to=example@aol.com, ctladdr=userName (500/500), delay=00:03:49, xdelay=00:00:00, mailer=relay, pri=210216, relay=[127.0.0.1], dsn=4.0.0, stat=Deferred: Connection reset by [127.0.0.1]

Is this correct in my .mc file? Commented out ok? Should 465 be another number?
Code:

dnl define(`RELAY_MAILER_ARGS', `TCP $h 465')
dnl define(`ESMTP_MAILER_ARGS', `TCP $h 465')

And is the 465 in my authinfo the correct number after smtp:mail.yahoo.com in the second entry?

Sorry for all the questions guys >.< Trying to get my head around this.

deep27ak 08-25-2012 12:58 AM

check your firewall if it is listening for port 465 and other smtp ports

Code:

#netstat -ntlp | grep sendmail
Code:

#telnet smtp:mail.yahoo.com 465
#telnet smtp:mail.yahoo.com 567
#telnet smtp:mail.yahoo.com 25


milksnake12 08-25-2012 03:30 PM

I ran this netstat command and it didn't return anything. Not sure if that is desired or it was supposed to say something
Quote:

check your firewall if it is listening for port 465 and other smtp ports

Code:

#netstat -ntlp | grep sendmail


Quote:

Code:

#telnet smtp:mail.yahoo.com 465

returned this
Code:

[root@localhost Desktop]# telnet smtp.mail.yahoo.com 465
Trying 98.138.84.55...
Connected to smtp.mail.yahoo.com.

Quote:

Code:

#telnet smtp:mail.yahoo.com 567

returned this and never connected
Code:

[root@localhost Desktop]# telnet smtp.mail.yahoo.com 567
Trying 98.139.212.139...

Quote:

Code:

#telnet smtp:mail.yahoo.com 25

returned this
Code:

[root@localhost Desktop]# telnet smtp.mail.yahoo.com 25
Trying 98.138.84.55...
Connected to smtp.mail.yahoo.com.
Escape character is '^]'.
220 smtp213.mail.ne1.yahoo.com ESMTP

Not sure how to process that information but I'm hoping some more seasoned eyes know what to do with that.

milksnake12 08-27-2012 02:07 AM

My ISP is Comcast also. I've read that sometimes ISP's have an issue with port 25. Based on those telnet results, is 465 the way to go?

Spent another day on this and still nowhere >.<

I'm at your mercy brilliant Linux people... I've almost reached the end of the rope on this, I've tried everything I can think of in my limited knowledge. I'm open to any suggestions whatsoever *begs*.

deep27ak 08-27-2012 02:41 AM

try this command

Code:

#netstat -ntl | grep sendmail
The command and the switch may vary as per your distro as I use Redhat in my case.

You can remove these lines from your config file
Code:

define(`RELAY_MAILER_ARGS', `TCP $h 465')
define(`ESMTP_MAILER_ARGS', `TCP $h 465')

open your sendmail.cf and search for this line

Code:

Mrelay,        P=[IPC], F=mDFMuXa8, S=EnvFromSMTP/HdrFromSMTP, R=MasqSMTP, E=\r\n, L=2040,
                T=DNS/RFC822/SMTP,
                A=TCP $h 567

and restart your sendmail and make sure once you make changes in sendmail.cf don't use m4 command as it will again over write the file with new configuration in sendmail.mc

If 465 doesnot work out try with 567 as well and let me know the results along with the maillog

milksnake12 08-27-2012 02:59 AM

I found this line, it matches all except the 567 isn't there. The line is just "A=TCP $h". No port. Should I add a port directly to the .cf?
Quote:

open your sendmail.cf and search for this line

Code:

Mrelay,        P=[IPC], F=mDFMuXa8, S=EnvFromSMTP/HdrFromSMTP, R=MasqSMTP, E=\r\n, L=2040,
                T=DNS/RFC822/SMTP,
                A=TCP $h 567



deep27ak 08-27-2012 03:30 AM

yes add the port no. as I had showed you
try with 465 and 567 both


make sure your firewall and selinux is not blocking sendmail.

milksnake12 08-28-2012 04:10 PM

I tried that and I still can't get it to work....

milksnake12 08-29-2012 12:41 AM

Well I've got about 40+ hours of troubleshooting in this and still can't seem to get a result. I'm also considering switching to Postfix if someone has a working configuration with Yahoo, I would be forever indebted to you if you could post it. And thank you guys so much for taking the time to throw ideas out there! Just cant seem to get anything to work.

dhimes 02-02-2013 02:51 PM

Hey milksnake12,
I am working on this problem also. One of the things I've come across repeatedly is that yahoo doesn't allow this usage on non-premium accounts. I think their other servers are smtp.bizmail.yahoo.com and smtp.prem.yahoo.com. Alas, I am, however, still getting the error message on bizmail. So that's not the only problem...


All times are GMT -5. The time now is 11:46 PM.