spamassassin
Sendmail – Yes, You Can Send Your Own Email
Nov 29th

I’ve gone over sendmail several times, but ultimately it comes down to a couple of factors. Unless you are setting up an enterprise level email server, and require some login settings, and potential relaying, sendmail is relatively simple. You start by installing it:
sudo apt-get install sendmail
Sendmail operates on port 25 because it is an SMTP server. It will receive email and place it in /var/mail, and depending on how you setup virtual users, possibly with a virtusertable, the mail will go into a subfolder. With a virtusertable you map incoming addresses to particular users on the system, and you can use a catch all email address.
Enable the virtusertable as per this previous post:
http://www.bgevolution.com/blog/debian-sendmail-virtusertable/
Here is more info about how to configure the virtusertable:
http://www.bgevolution.com/blog/sendmail-consolidate-multiple-domains/
Go ahead and add some security by binding sendmail locally. This will allow your local email client to send and receive email locally. For the local machine itself set 127.0.0.1. My email server is in a virtual machine, therefore the host accesses the server by a local ip address. I also have to set sendmail to listen on the local ip address of the virtual machine.
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA-local')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=192.168.1.150, Name=MTA-network')dnl
Now if you have a php mailer script in your website it will have access to sendmail for email distribution purposes. Also your thunderbird will be able to connect to send mail. Now, even if you enable port forward sendmail should not respond. Any mail distribution requests originating from your external ip address, even if its forwarded to the local ip of the server, should not be responded to. You would have to create a daemon options line to access mail from the the external ip address.
There are other interesting things to deal with in sendmail. This is how you would integrate spamassassin into sendmail directly on the server. You can also integrate ClamAV, which I should get around to blogging about it soon. There are some tricky things to integrate ClamAV, on the server level, in Debian; but ultimately it relatively straight forward as compared to spamassassin.
Ubuntu – Debian Spamassassin Integrate into Sendmail
Jul 24th
Ive had a mail server for a long time. Ive always used the built in Spamassasin that Thunderbird uses. I recently got a blackberry and was receiving the spam even though Thunderbird was successfully filtering the spam to the Junk folder. This is because the MTA, Dovecot in my instance, was transferring the mail to Thunderbird and the Blackberry at the same time leaving the mail unfiltered on the Blackberry. To resolve this I required server side spam labeling and filtering. First the mails needed to be labeled as spam. Spamassasin does this nicely. Install Spamassasin using:
sudo apt-get install spamassassin spamass-milter
Then in your sendmail.mc config file add:
# spamassassin settings INPUT_MAIL_FILTER(`spamassassin',`S=local:/var/run/spamass/spamass.sock, F=,T=S:4m;R:4m;E:10m')dnl
Now your going to configure Spamassassin to label spam mails as such. Open the config file with:
sudo nano /etc/mail/spamassassin/local.cf
Remove the pound # sign to uncomment:
rewrite_header Subject *****SPAM***** required_score 5.0 use_bayes 1 bayes_auto_learn 1
Make sure you build the sendmail.cf file. Restart sendmail. Now you have to train Spamassassin. In Thunderbird you have to sort all known spam to a particular folder. Place 200 or so spam messages in the Junk folder completely without any good emails. Then run:
sa-learn --showdots --mbox --spam mail/Junk
The above snipped is run from your users root directory. You can cd to the mail directory and run:
sa-learn --showdots --mbox --spam Junk
Then place known good emails in a particular directory and run:
sa-learn --showdots --mbox --ham mail/temp
Run this every once in a while to increase the accuracy of your spam filter. I have excellent spam detection after only a couple of days of training.
SPAM is Relentless and Practically Impossible to Get Rid of
Mar 14th
I though by implementing some blackhole lists that spam would significantly reduce. Technically it has from several hundred to several dozen, but wow, spam is relentless. Spam still finds it way to my inbox, no matter how well trained Thunderbird is. I currently have no 100% solution, and its driving me crazy. I usually figure things out, but to eliminate 100% of spam is proving to be an unsurmountable task. I mark new spam messages every day, but they still find there way in. Simply wow.