Tuesday, May 24, 2005

Sendmail and SMTP Auth

On Mandrake ensure sendmail installed
Also using install package GUI, install all "sasl" containing packages.




Change directory to where your sendmail configuration files (sendmail.mc and sendmail.cf) are located, usually /etc/mail/.
Create a safe subdirectory (suggested name auth/):
# mkdir auth
# chmod 600 auth

Create a file with your authentication information (suggested name auth/client-info):
AuthInfo:your.isp.net "U:root" "I: user" "P: password" "M: PLAIN"

filling in your ISP's mail server, your user name, and your password. (Note: Earthlink, and perhaps other ISP's, requires your full e-mail address as a user name.)
Generate the authentication database and make both files readable only by root:
# cd auth
# makemap hash client-info (less than sign) client-info
# chmod 600 client-info*
# cd ..

NOTE: you may need to chmod to 740 before makemap on client-info* and auth



Add the following lines to your sendmail.mc file, filling in your ISP's mail server:
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:
# m4 sendmail.mc > sendmail.cf

Restart the sendmail daemon, e.g., (this depends on your OS):
# kill -HUP `cat /var/run/sendmail.pid`

No comments:

Post a Comment