The following config will reject a message when more than 10 recipients are in the TO: and/or CC: fields.
/etc/postfix/main.cf:
# restrict based on message header content header_checks = pcre:/etc/postfix/header_checks
/etc/postfix/header_checks:
/^To:([^@]*@){10,}/ REJECT Sorry, your message has too many recepients.
/^Cc:([^@]*@){10,}/ REJECT Sorry, your message has too many recepients.Solution based on a post at linuxquestions.org.
I’ve always used telnet for SMTP testing. Finally, got sick of copy/pasting and decided to write a quick script. But scripting telnet is a pain. Netcat to the rescue!
Call the script with the following arguments:
$ ./smtp.netcat.test mx.example.com 25 from@example.com to@example.com
And here’s the script:
I haven’t been getting any SPAM lately, so I thought I’d turn on catch-all to see what happens. Accepting mail for invalid recepients (e.g. anything @mydomain) caused about twice as much SPAM to be attempted, but still nothing got through to my Inbox:
------------------------------------ Stats for Feb 2010 ------------------------------------ Ham SpamC SpamR SpamM HamC 192 126 1951 0 0 -------------------------------------------------------------- 2269 Total messages 2077 Total Spam (Caught + Missed + Rejected) 91.53% Spam as % of all mail 93.93% % of Spam rejected by Postfix at SMTP time 0% False positive rate (Ham misclassified as Spam) 0% False negative rate (Spam misclassified as Ham) 100.00% Spam catch rate (Spam filter accuracy) --------------------------------------------------------------
As you can see, Postfix got most of it, then SpamAssasin got the rest. I heart Postfix and SpamAssassin.
Dec 09 was the first month I had achieved 100% spam catch rate since I started filtering my own mail a few years ago. Thanks, SpamAssassin Bayes plugin! Merry Xmas to you as well!
------------------------------------ Stats for Dec 2009 ------------------------------------ Ham SpamC SpamR SpamM HamC 160 392 1273 0 0 -------------------------------------------------------------- 1825 Total messages 1665 Total Spam (Caught + Missed + Rejected) 91.23% Spam as % of all mail 76.45% % of Spam rejected by Postfix at SMTP time 0% False positive rate (Ham misclassified as Spam) 0% False negative rate (Spam misclassified as Ham) 100.00% Spam catch rate (Spam filter accuracy) --------------------------------------------------------------
Cooked up a little shell script to produce monthly email statistics such as amount of email received, how much of it was spam, percentage of spam correctly identified, etc. Previously, I had manually ran the numbers and input into OpenOffice Calc to get the stats — boring!
Example output:
root@dpork:~# spam-stats-month Aug 2009 ------------------------------------ Stats for Aug 2009 ------------------------------------ Ham SpamC SpamR SpamM HamC 151 122 3444 7 0 -------------------------------------------------------------- 3724 Total messages 3573 Total Spam (Caught + Missed + Rejected) 95.94% Spam as % of all mail 96.38% % of Spam rejected by Postfix at SMTP time 0% False positive rate (Ham misclassified as Spam) .18% False negative rate (Spam misclassified as Ham) 99.80% Spam catch rate (Spam filter accuracy) --------------------------------------------------------------
I’m a big fan of RoundCube, the open source imap webmail client. While still in beta and lacking some features, it’s free, licensed under the GPL, easily customized look due to reliance on CSS for styling, works great for basic email and is definitely one of the sexiest webmail clients out there.
One issue that had been bugging me is that it wouldn’t search for Recipient (“To”) by default. Only for Sender (“From”) or Subject.