This will describe how I configured sendmail, concentrating on the way that I can accept any email sent to something like andrewFromYourName at greatcactus.org. This can be used as an anti-spam technique - you can give a different email address to everyone, and if one address ends up in the hands of evil spammers, you can just block it, and not have to tell everyone else that your email address has changed. It has worked very well for me, although it has sometimes been hard explaining to people that you really have to replace YourName with your actual name. This is not a full sendmail configuration description, and I assume you are familiar with standard Sendmail setup things like MX records.
The following documentation assumes that your domain is greatcactus.org. Of course your should change this to your real domain.
I assume here that you have the following set up:
CN=greatcactus.organd then (as root)
cp greatcactusKey.pem /etc/pki/tls/certs cp greatcactusCertificate.pem /etc/pki/tls/certs chmod 444 /etc/pki/tls/certs/greatcactusCertificate.pem chmod 400 /etc/pki/tls/certs/greatcactusKey.pemYou will then need to edit /etc/mail/sendmail.mc, and edit the following lines (there are similar ones already in the file; replace them with these) :
define(`confAUTH_OPTIONS', `A p y')dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl define(`confCACERT_PATH',`/etc/pki/tls/certs') define(`confCACERT',`/etc/pki/tls/certs/ca-bundle.crt') define(`confSERVER_CERT',`/etc/pki/tls/certs/greatcactusCertificate.pem') define(`confSERVER_KEY',`/etc/pki/tls/certs/greatcactusKey.pem')
GENERICS_DOMAIN(greatcactus.org cactus cactus.greatcactus.org)dnl FEATURE(virtuser_entire_domain)dnl FEATURE(masquerade_entire_domain)dnl FEATURE(masquerade_envelope)dnl FEATURE(allmasquerade)dnl MASQUERADE_AS(greatcactus.org)dnl dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnlNote that in the GENERICS_DOMAIN you list whatever domain(s) you have that you want dealt with. You will also need to set up the following conficuration files in /etc/mail:
FEATURE(`genericstable',`program /bin/sh /etc/mail/outgoingaddress.sh')dnl FEATURE(`virtusertable',`program /bin/sh /etc/mail/mailalias.sh')dnlYou will need to install these programs, and of course edit them to your preferences.
cp mailalias.sh /etc/mail/mailalias.sh cp outgoingaddress.sh /etc/mail/outgoingaddress.sh chmod 755 /etc/mail/*.sh touch SpammerList chmod 666 /etc/mail/SpammerList
cd /etc/mail make
/sbin/chkconfig --level 35 sendmail on /sbin/chkconfig --level 35 saslauthd on /sbin/service saslauthd start /sbin/service sendmail restart
Note on security - I am not aware of any security holes in this. Please tell me if you see any.
This is provided on an as-is basis with no guarantees. I've found it useful and non-obvious, and I hope you do too.