Sendmail Notes
17 Sep 2006
Authentication
I am currently using an AT&T Yahoo DSL connection, and configuring outgoing mail from my home machine requires going through their mail host, including authorization. Documentation for setting up the smarthost and authorization is available at SMTP AUTH in sendmail 8.10-8.13 under the section "Using sendmail as a client with AUTH". Further information is available from SMTP Authentication from the cf/README for sendmail.
Create a safe subdirectory, since the password and user will be kept in plain text.
In a file (suggestion: /etc/mail/auth/client-info), add:
AuthInfo:your.isp.net "U:root" "I:user" "P:password"
Use makemap to create a DB file:
makemap hash client-info < client-info
Add the following to sendmail.mc:
define(`SMART_HOST',`your.isp.net')dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl
Generate sendmail.cf from sendmail.mc.
Restart sendmail.
Basic Sendmail configuration
The following is the major part of the sendmail configuration that I had to add to a Ubuntu configuration, for a home machine using a SMART_HOST:
define(`confDEF_USER_ID', ``8:12'') define(`SMART_HOST',`smtp.sbcglobal.yahoo.com')dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl undefine(`UUCP_RELAY')dnl undefine(`BITNET_RELAY') dnl FEATURE(redirect)dnl FEATURE(always_add_domain)dnl FEATURE(use_cw_file)dnl FEATURE(local_procmail)dnl FEATURE(`nouucp', `reject')dnl FEATURE(allmasquerade)dnl FEATURE(masquerade_envelope)dnl dnl # FEATURE(`access_db',`hash -o /etc/mail/access')dnl MAILER_DEFINITIONS MAILER(`local')dnl MAILER(`smtp')dnl MAILER(`procmail')dnl MASQUERADE_AS(crsr.net)dnl include(`/etc/mail/tls/starttls.m4')dnl
This is based on the RedHat Sendmail HOWTO. The SMART_HOST is my ISP's SMTP server, I commented out the access_db feature because it was defined previously in the file. The final important part is the MASQUERADE_AS line; it puts my domain into the outgoing headers.
