Spamblock

UpDefinitions for mail
Sitemap
 

The purpose of this module is the automatic removal of any spam sent to me. In its current incarnation it does not delete the spam, but moves it into the 'junk' folder of my MH setup, via store2mh-folder. To change that the distributed code has to be altered.

A future variant might even plug into my POP client from Pool and delete spam while still on the server. This should reduce uptime and therefore phone costs too (only the headers are required for this).

It is implemented as a rule set using special predicates to detect the unwanted mail.

The directory <mainConfigDir>/spamblock is added to the list of paths searched for configuration files.

Predicates
Subcmd Description
unwantedSender

Reads the configuration variable spamblock/unwantedSender and interprets its contents as a list of regexp patterns describing the email addresses we don't accept any mail from.

Returns true if 'from:' matches at least one of the patterns.

localSender

Returns true if the mail came from a local account.

A local account is either one not containing @ in the address or one with @ in it and from the correct domain, as found in info hostname.

Under U*ix it would be possible to check the account against the passwd-file too.

localTarget

Returns true if the mail was sent to a local account. 'To:', 'Cc:' and 'Bcc:' are checked.

The addresses must either not contain an @, or the correct domain. A check against the passwd-file is not done, but might be in the future.

The configuration variable spamblock/localTarget is read too, and its contents interpreted as a list of addresses (regexp patterns). These explicitly declared addresses are considered to be local too.

Actions
Subcmd Description
junkit

This is a convenience action, just a wrapper around store2mh-folder junk; stop

The distributed rule set has the name spamblock and discards mail according to the following rules:

  • Mail without a valid 'To:' is spam and discarded.
  • Mail coming from an unwanted address is spam and discarded.
  • Mail neither coming from nor going to a local account is spam and discarded. The latter (not going to a local account) currently cuts 70% of the spam coming at me. The rest is spam containing my address, or going to mailing lists, which are dispatched to their folders before reaching the spam blocker. The latter is necessary to prevent them from getting discarded as they usually have the 'mailing address' in their 'To:' header.

See the last of the Examples too.


© Andreas Kupries
Last update at Thu Nov 11 21:48:40 MET 1999