This page has been robot translated, sorry for typos if any. Original content here.

Three lines of spam protection

It all began on the verge of centuries in 2000, when the CssMagic cascading style sheet editor was written. In the support mailbox of this program, which by the way we showed guest books without regard to all forums, the number of advertising letters is more than the number of useful messages. The box was abandoned here, but the support address in the program body was changed. And also just recently, for curiosity, we looked that blah blah with him (with the old box) is going on. Well, undoubtedly, as you might guess, he is clogged up to the negation. He cleaned it and measured the capacity of receipts: in the region of hundreds of letters per day. All messages are spam. Well, it’s even interesting - will this universal evil be defeated?

We categorically set the fundamentally following goal: openly and unencoded to inform this dead address in several forums and also set up the work with the mailbox in such a way that you never get spam, but useful messages from strangers would be nice to somehow receive, but messages acquaintances in order that no matter how it was. Judging by the neglect of the situation, a defense in depth will be required. There are three points where spam is allowed to be destroyed. This is a mail program, anti-spam software is also a mail server. Consider it (defense) in more detail.

The main spectacular line. SpamPal, a royalty- free program, does a very good job of checking mail against lists of DNSBL servers (especially malicious ones are pretty good at filtering out, but at the same time it’s not very smart spammers at all - these are those who are not able to hide their IP either beautifully or just stupidly sending spam from a "fake" domain). The program adds the specified keyword to the message subject. The default is ** SPAM **. Let it remain so. Further, the mail customer is forced to deal with this message.
The second spectacular milestone. We take the most powerful program in the universe for work with mail. In my case, it’s TheBat !, but it also tastes like paint - you yourself know, therefore options are possible. For TheBat! The following manipulations have been done.
In the properties of the mailbox, we will configure work through SpamPal, for which we specify the name of the POP server localhost, but we will add the real POP server to the username through the dog, for example: login@pop.mail.ru (this is the standard SpamPal setting).

In order for spam messages to be automatically deleted without downloading, we will set the position "Mailbox -> Configure Mail Sorter -> Selective Download". Here we create a rule that, if the subject line ** SPAM ** is in the Subject field, will eliminate the message from the server.

It is clear that with this setting, letters that are mistaken for spam may well get caught. To visually record this event, enable the message manager: "Mailbox properties -> Mail management - Message manager - Call automatically at each scan." Today TheBat! will illustrate that it has also come that he is going to delete without downloading from the server (here is the opportunity to make adjustments to his actions).
We try the work of the first pair of lines: in three days 245 letters were received in the box (238 of which were advertising content, the rest were mine from other mailboxes). The resulting bundle identified also deleted 195 letters. The original target has not been fully achieved, at least some results are all blah blah. Moving on. Today it is necessary to solve two problems: to automatically finish off the remaining spam is also the essence, to exclude the removal of non-spam.
The third frontier is the most powerful. Here filtering on the server side resorts to help. We do so. In all forums, etc. too. leave your address in the form login@mail.ru&subject=NOSPAM. For strength, it is allowed to explain to forum users in PS that the expression NOSPAM must exist in the subject line of the message. Next, configure the filters. On the sample mail.ru:
Filter 1. All possible logins (or fragments thereof) of important senders from your address book are listed. Act - send a copy of the message somewhere. In my case, it is an SMS to a cell phone. When the filter is triggered, do not continue to use other filters. Filter 2. If the topic contains the phrase "NOSPAM", then simply do not continue to apply other filters.
Filter 3. If you eat @ in the Recipient field (that is, none of the first two filters worked in any way), then forward a copy of the message to a specialized (garbage) address without deleting the message itself. Continue to apply other filters. This filter, in principle, is not particularly needed. Just for every adventure we save all automatically destroyed correspondence in a special mailbox.
Filter 4. And finally, if you eat @ in the field “Recipient” (we continue to deal with suspected spam), then delete the message and reply automatically: “Your message has been destroyed by the anti-spam system. If you want the message to reach the destination, login @ mail.ru, then repeat your message, and include in your subject line in any convenient room the key phrase NOSPAM ".

Setting up filters on a Mail.ru sample

So. Scribbling robot spammer. Almost always, the return address is linden. The phrase "NOSPAM" is unlikely to become the topic, it is also very unlikely that the spammer’s login will match the logins of my "snow-white" list. As a result, a message will be sent to the fake return address with a request for a repeat of the message. A spammer will have to contact you manually. Extremely unlikely.
The case is different. Scribbles a friend or forum member. A snow-white list will work on the server, and a list of letters will appear in TheBat! Message manager. The final decision - whether or not to receive the message data is up to the user, but SpamPal is also TheBat! will do everything possible so that the necessary marks on downloading or deleting letters are already standing.
If all blah blah some kind of cunning robot learned to break through the guards, it’s enough to replace the expression “NOSPAM” with any other, the guards will be at your service again.
Of course, all this is allowed to be done only with the help of a mailer, but eliminating 100 spam letters even without downloading is 3-8 minutes, plus viewing message topics is still the same. So on the server side, all the dirty work is more convenient.
That, in fact, is also all. For a week of work with the described settings, we received only one instruction to study the next English language course, and the notes on its removal were in the message manager even before the download. Not bad. What I also want for everyone.