I found another FAQ (
http://www.cri.ch/linux/docs/sk0009.html) that gave me a step by step of how to set up smtp relay for sendmail.
The additional steps I took were as follows:
Added the following to the sendmail.mc file:
define(`SMART_HOST', `your-smtp-server')
FEATURE(authinfo)dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')
define(`ESMTP_MAILER_ARGS', `TCP $h 587')
Updated the sendmail.cf file
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
Defined my account info in the AuthInfo file:
AuthInfo:<your-smtp-server> "U:<your-smtp-user>" "P:<your-smtp-password>" "M
IGEST-MD5"
Im not sure if the "M:" is correct since the server that I would be logging into would be over TLS port 587 and usually just does a login challenge and nothing more. I don't know if I just need to specify login.
Updated the authinfo.db file
makemap hash /etc/mail/authinfo < /etc/mail/authinfo
Created a userdb for header rewriting
user:mailname
foo@bar.com
Created the userdb.db file
makemap btree /etc/mail/userdb.db < /etc/mail/userdb
Sendmail, Tested, and got the following output:
[root@FC4FW mail]# /usr/sbin/sendmail -bv root@localhost
root@localhost... deliverable: mailer local, user root
[root@FC4FW mail]# /usr/sbin/sendmail -bv
lovell.mcilwain@gmail.com
lovell.mcilwain@gmail.com... deliverable: mailer relay, host foo.barr.com, user
user@foo.com
This would leave me to belive that this was successful from what I see in the output. But then I take a look at /var/log/maillog and find the following:
Feb 14 18:37:04 localhost sendmail[12272]: k1EEWlrh009414: to=<lovell.mcilwain@gmail.com>, ctladdr=<root@localhost.localdomain> (0/0), delay=09:04:17, xdelay=00:00:01, mailer=relay, pri=945174, relay=foo.bar.com [11.222.333.444], dsn=5.0.0, stat=Service unavailable
Feb 14 18:37:04 localhost sendmail[12272]: k1EEWlrh009414: k1ENb3vE012272: sender notify: Service unavailable
I thought the tutorial has gotten me closer to where I wanted to be but can anyone else tell me what else Im missing to get this to work properly? The things I noticed off the top of my head were:
1.The authentication method is wrong but I can't see any documentation that states that the entry "M:login" will work.
2. It still looks like the return mail is showing as
root@localhost.localdomain when I thought the usersdb.db file was supposed to take care of this. Did I need to restart sendmail or re run the m4 command to update that there is now a usersdb.db in existance?
3. Could this be an issue of not specifying the port number correctly for sendmail to talk with the relay server properly?
I know this was a bit lengthy but any help is appreciated