1. Note that the default locations on Fedora (and many distros) for Sendmail installed files is "/etc/mail". sendmail.cf, sendmail.mc, access map, so on, are located at /etc/mail.
2. Check that your Sendmail binary has STARTTLS and SASL support:
sendmail -d0.1 -bv
Make sure STARTTLS and SASL are present in the output, this is the default on Fedora and other distors now so they are likely alread there - if you do not have these you need to backup and recompile sendmail to include them - see the aforementioned server oriented tutorials on this subject - Yes the client usage requires them.
3. Edit your sendmail.mc to include the "smart host" option. (If you use a hostname, don't use brackets, if you use an IP address, use brackets around it [].)
define(`SMART_HOST',`mail.bellsouth.net')
4. Edit your sendmail.mc to setup a map for "authinfo".
FEATURE(`authinfo',`hash /etc/mail/authinfo.db')
5. Check the rest of your sendmail.mc to make sure that things are sane and items relevant to STARTTLS and SASL are uncommented and valid. For example check to ensure you have the certificate related entries (and that these entries are valid - you may have to create the sendmail.pem cert - from the cert dir "make sendmail.pem" assuming you have the OpenSSL libraries available):
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')
Make sure you also have the auth mechanisms defined/uncommented (I am not sure this should be required just for the client - but I had to enable to get things working):
define(`confAUTH_MECHANISMS', `LOGIN PLAIN')dnl
define(`confAUTH_OPTIONS', `A p y')dnl
TRUST_AUTH_MECH(`LOGIN PLAIN')dnl
Also you should turn up the logging temporarily in order to verify things:
define(`confLOG_LEVEL', `20')dnl
6. Create the "authinfo" file in (the file that tells the SMTP_AUTH client what credentials to login with for what domain).
AuthInfo:mail.bellsouth.net "U:root" "I:user@bellsouth.net" "P:password" "M:LOGIN PLAIN"
7. With the newly edited "sendmail.mc" file use m4 (the sendmail macro burner) to create "sendmail.cf".
m4 sendmail.mc > sendmail.cf
8. With the newly created "authinfo" file make the authinfo.db which sendmail will use.
makemap hash /etc/mail/authinfo < /etc/mail/authinfo
9. Restart sendmail (default /etc/init.d/sendmail restart) and check the logs (default /etc/maillog) to make sure there are no issues/errors/warnings. Errors such as unable to find STARTTLS certificate need to be addressed before you proceed, really there should be no errors or warnings, these have meanings. ;)
10. Run a map test to ensure that the "authinfo" db is being correctly picked up by your new sendmail configuration.
echo '/map authinfo AuthInfo:mail.bellsouth.net' | /usr/sbin/sendmail -bt
If this is found and there is an entry then proceed, otherwise something is amiss with authinfo and that needs to be addressed.
11. Make an alias for the "root" user to go to an actual external email account (if not already done). For example in /etc/aliases change the line under "Person that should get root's email" to go to "root: user@gmail.com" where that is a valid external email account. Make sure to run "newaliases" to invoke.
12. Send an email to root and watch the logs.
mail root
Test
this is a test
.
Feb 17 21:08:45 totsp sendmail[27587]: k1I28jTQ027587: MAIL From: SIZE=29 AUTH=root@yourhostname.org.
Chatter
3 hours 35 min ago
16 hours 10 min ago
21 hours 55 min ago
2 days 4 hours ago
2 days 15 hours ago
3 days 1 hour ago
3 days 5 hours ago
3 days 5 hours ago
3 days 19 hours ago
4 days 5 hours ago