sendmail.mc

Go Back
Braindump Index
Braindump Home

These are the .mc files I use to generate the sendmail.cf file for various operating systems. These allow me to use certain privacy options without modifying the sendmail.cf after it has been generated.

  1. cd to your sendmail source directory: sendmail-x.xx.x/cf/cf
  2. create a new file called hostname.mc with the contents of all the configuration directives you would like to use
  3. Generate the sendmail.cf file: m4 hostname.mc > /etc/mail/sendmail.cf
Linux
include(`/usr/lib/sendmail-cf/m4/cf.m4')
VERSIONID(`unclejax')dnl
OSTYPE(linux)dnl
DOMAIN(generic)dnl
FEATURE(local_procmail)dnl
FEATURE(always_add_domain)dnl
FEATURE(virtusertable)dnl
FEATURE(nouucp,reject)dnl
FEATURE(access_db)dnl
FEATURE(relay_hosts_only)dnl
define(`confSMTP_LOGIN_MSG', `')dnl
define(`confPRIVACY_FLAGS', `goaway')dnl
define(`SMART_HOST', `smtp.bellnexxia.net')
define(`ALIAS_FILE', `/etc/aliases')dnl
define(`confTO_CONNECT', `1m')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
MAILER(local)dnl
MAILER(smtp)dnl
BSDI
include(`../m4/cf.m4')
VERSIONID(`rotate')dnl
OSTYPE(bsdi)dnl
DOMAIN(generic)dnl
FEATURE(always_add_domain)dnl
FEATURE(virtusertable)dnl
FEATURE(nouucp,reject)dnl
FEATURE(access_db)dnl
FEATURE(relay_hosts_only)dnl
define(`confSMTP_LOGIN_MSG', `')dnl
define(`confPRIVACY_FLAGS', `goaway')dnl
define(LOCAL_MAILER_PATH,'/usr/libexec/mail.local')dnl
MAILER(local)dnl
MAILER(smtp)dnl

You can insert the lines:

FEATURE(dnsbl,`blackholes.mail-abuse.org',` Mail from $&{client_addr} rejected, see http://mail-abuse.org/cgi-bin/lookup?$& {client_addr}')dnl
FEATURE(dnsbl,`relays.mail-abuse.org',` Mail from $&{client_addr} rejected; see http://mail-abuse.org/cgi-bin/nph-rss?$& {client_addr}')dnl
FEATURE(dnsbl,`dialups.mail-abuse.org',` Mail from dial-up rejected; see http://mail-abuse.org/dul/enduser.htm')
to enable mail-abuse.org's spam blocking (to the latest Sendmail).


To enable SMTP AUTH, download and install the cyrus-sasl libraries:
ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/

Add the following lines to your sendmail source devtools/Site/site.config.m4:

APPENDDEF(`confENVDEF', `-DSASL')
APPENDDEF(`conf_sendmail_LIBS', `-lsasl')
./Build sendmail
(more detailed instructions are at: http://www.sendmail.org/~ca/email/auth.html)

Insert the following lines into your .mc file, and run m4:

define(`confAUTH_MECHANISMS', `LOGIN PLAIN GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5')dnl
TRUST_AUTH_MECH(`LOGIN PLAIN GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5')dnl



Last modified: Wednesday, December 31 1969 @ 19:00 EST
Google
WWW braindump.MrZesty.net
© Ian Samuel, 2010
http://braindump.MrZesty.net