All free Anti-Spam solution for sendmail using Spamcop, Spamhaus, Spam Assassin, Mailscanner and f-prot as anti-virus Imprimer

Since the amount of spam sent is constantly rising, we are constantly putting more resources to filter and avoid it. The last big move we did was to add zen.spamhaus.org sbl to the SpamCop one we were already using. We also added some of the latest sendmail options to our sendmail configuration to cut down on spam. Greeting Pause is definitly the most efficient of them.


We were against using zen.spamhaus.org before because it may block legitimate mail from people running mail servers without being registered as an official MX for some domain or from people running their mail server on an IP that is considered as a "home user" IP that should not send mail directly but instead forward it to their ISP mailserver.

Nevertheless, we have decided to give it a try and it is the latest addition to our restrictive spam filters. Well, it looks like we are going to keep it because this latest addition cut the spam we receive by 90% and we have received no complains from our customers so no senders had to be whitelisted yet. The great thing is that with RBLs ( real time black lists), the spammers do not even get a chance to upload their spam to our servers. The connection is dropped before that.

Other neat additions are the use of the following sendmail options: BAD_RCPT_THROTTLE, SMTP_MAILER_MAXMSGS, LOCAL_MAILER_MAXMSGS, RELAY_MAILER_MAXMSGS, MAX_RCPTS_PER_MESSAGE, greet_pause, ratecontrol, CONNECTION_RATE_WINDOW_SIZE, CONNECTION_RATE_THROTTLE, See what these mean here.

Basically, there is two ways to filter spam, before the spammers upload it to your server and after it has been uploaded. Here is our config file for sendmail that allow us to block spam before it is sent:

FEATURE(`use_cw_file')dnl
FEATURE(`use_ct_file')dnl
FEATURE(`virtusertable')dnl
FEATURE(`accept_unqualified_senders')dnl
FEATURE(`accept_unresolvable_domains')dnl
FEATURE(`access_db')dnl
FEATURE(`ratecontrol', ,`terminate')dnl
FEATURE(`greet_pause',15000)dnl wait 15 seconds before accepting mail
define(`confCONNECTION_RATE_WINDOW_SIZE',`1800')dnl
define(`confCONNECTION_RATE_THROTTLE', `1')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(`dnsbl',`bl.spamcop.net')dnl
FEATURE(`dnsbl', `sbl.spamhaus.org', `"Rejected due to Spamhaus listing see http://www.abuse.net/sbl.phtml?IP=" $&{clientaddr} " for more information"')dnl
define(`confMAX_MESSAGE_SIZE',`10000000')dnl
define(`confMAX_DAEMON_CHILDREN',`50')dnl
define(`confSMTP_LOGIN_MSG',`Javamail version 1.7.1_09')dnl
define(`confDOMAIN_NAME', `master.oc9.com')dnl
define(`confPRIVACY_FLAGS', `goaway')dnl
define(`confMAX_RCPTS_PER_MESSAGE',`15')dnl max rcpt in each message
define(`confSMTP_MAILER_MAXMSGS',`5')dnl max X message by outgoing connection
define(`confLOCAL_MAILER_MAXMSGS',`5')dnl max X message delivery by connection
define(`confRELAY_MAILER_MAXMSGS',`5')dnl max X message delivery by connection
define(`confBAD_RCPT_THROTTLE',`1')dnl sleep 1 sec at each X additional rcpt once MAX_RCPTS_PER_MESSAGE reached
define(`confMAX_RUNNERS_PER_QUEUE',`10')dnl max runner process
define(`confMAX_QUEUE_RUN_SIZE',`20')dnl max message to deliver by queue run
define(`confMAX_HEADERS_LENGTH',`32768')dnl max headers length

And here are the /etc/mail/access directives that go along with it:

GreetPause:192.168.1.101 5000
GreetPause:192.168.1.105 5000
GreetPause:127.0.0.1 50000
ClientRate:204.15.82.126 0
ClientRate:192.168.78.40 5

ClientRate: 10
Connect: 192.203.178.107 OK // whitelisting

To filter mail after the spammers has managed to upload it to our servers, we use Spam Assassin ran within Mail Scanner. We also use the free command line version of the f-prot antivirus to filter mail for viruses within Mail Scanner although you will need a commercial daemon version if you have a really high volume of mail coming into your server. Using the command line version of f-prot forks a new a process for every scan. Note that with the speed of computers today, you could probably handle a high volume of mail anyway with the command line version. It will nevertheless be less efficient than a daemon version that keeps on running all the time waiting for incoming messages to scan. Note that the command line version of f-prot lets you access the update site free, we setup a cron job (Linux scheduler) updating the virus list 3 times a day.

Mail Scanner link

Spam Assassin link

F-Prot Antivirus link

Ajouter votre commentaire / Add your comment

Votre nom / Your name:
Sujet / Subject:
Commentaire:
SPAM: Ne pas inclure de lien ou utiliser le stratagème suivant: "yahoo.com slash mapage.html"     Nous utilisons un filtre qui bloque les commentaires suspects avec une erreur 403. De même, du code de programmation ou sql peut provoquer des erreurs 403. Veuillez utiliser un lien vers votre code tel que: "pastebin.com slash jVNqLieD"    Merci!
Comment:
SPAM: Do not include any links in your post or use the following construct: "yahoo.com slash mypage.html"    We are using a filter that denies suspicious posts with a 403 error. Programming language or SQL code may also cause a 403 error. Please provide a link to your code instead like: "pastebin.com slash jVNqLieD"    Thank you! :
  Lettres de vérification; lettres minuscules seulement, pas d
Retaper les lettres affichées / Word verification:
Mis à jour / Last updated ( lundi, 27 octobre 2008 19:41 )