|
fuschlberger.net - Scripts for mutt |
|||||||||||||||||||||||||
Two small scripts for mutt, spamassassin and procmail
On this page you will a find two tiny scripts:
Both of them are shellscripts, no perl etc. is needed. All comments, suggestions etc. are welcome. Please contact me at wf-hp@gmx.net.
Links: 1. muttalias2sawhitelist.shView the source What the script doesThe script reads mailaddresses from the alias file which is used by mutt and generates from these mailaddresses a whitelist entry in Spamassassin's preferences-file in order to avoid false-positives from known senders. The name of the aliasfile is searched in the following order: in
Aliases have to be written in one of the following ways:
NB: Group aliases, which are referencing user aliases, are ignored, since expanding them would mean producing dupes, which are afterwards dropped anyway The script will read the alias-definitions, isolate the e-mailaddresses
(recognized as such is everything between < and >) and replace all
newline-characters with space-characters. It will then write these
mailaddresses into a whitelist-definition, which will be written to
When run for the first time the script will copy the 'old'
Download the script here. Why I wrote the scriptBecause I did not find a similar script on the 'Net. :-) I was fed up with the spam I received which I could not filter effectively
because of the risk of false positives, ie mails from persons I know (whose
mailaddresses I have aliased in my The advantage of an automatically generated whitelist is that I now can
lower the number of hits required by spamassassin before a mail is considered
spam. 2. muttalias2procmail.shView the source What the script doesThe script reads mailaddresses from the alias file which is used by mutt
and generates from these mailaddresses a procmail-rule, which is written to
The name of the aliasfile is searched in the following order: in
Aliases have to be written in one of the following ways:
NB: Group aliases, which are referencing user aliases, are ignored, since expanding them would mean producing dupes, which are afterwards dropped anyway The script will read the alias-definitions, isolate the e-mailaddresses
(recognized as such is everything between < and >) and replace all
space-characters with newline-characters. It will then build from these
mailaddresses a procmail-rule, which will be written to
When run for the first time the script will write a backup of the 'old'
In short:
This is what the generated rule looks like:
This is the best way to implement a logical OR in
The target file
NB: Why I wrote the scriptWhen I had installed Spamassassin and played around a bit I discovered that
each mail caused a CPU-load of 100% for about 4-5 seconds on my P133, which
caused delays when several mails were arriving at once. So I decided I had to
sort out mails from known senders before they reached Spamassassin. The best
place to do so was Download the script here. [1] all filenames mentioned are the default values which can be easily changed in the scripts Written 2002-08-09 - last update: 2006-08-10 |
||||||||||||||||||||||||||
© echo date(Y); ?> by wf |