Submitting spam mail for training SA

Jari Fredriksson jarif at
Thu Dec 13 09:55:17 CET 2012

13.12.2012 10:35, Nikolaos Milas kirjoitti:
> Hello,
> We have a Postfix 2.9.4 with Amavisd-new 2.8.0/ClamAV/Spamassassin on
> Centos 6.3 (x86_64) used as an incoming mail filtering gateway which
> relays clean (only) mail to an internal final destination mail server
> (Postfix/Dovecot).
> We are not using Maia or other such systems supporting per user
> filtering/spam rule settings. (We want to keep the setup as simple as
> possible and controllable by the admins.)
> I would like to setup a spam mailbox (like: spam at where
> users can submit what they deem as spam, and which can be used to
> train SpamAssassin. The idea is to receive reported spam as attachment
> (one per mail), so we can process it later, e.g. by saving spam mail
> files in a directory and running:
>    sa-learn --spam /path/to/spam/folder
> Questions:
>  * Do regular eml files (of spam mail messages) qualify for such use
>    (i.e. does sa-learn understand them properly)?
>  * What happens with spam messages forwarded from Outlook clients which
>    will forward as msg and not as eml? Do we need a msg-to-eml
>    converter script to process these files?
> Has anyone here set up something like that and could suggest/provide a
> script or similar, which would accomplish this task (I don't want to
> re-discover the wheel)?
> Any advice will be appreciated.
> Thanks in advance,
> Nick

The best solution might be an IMAP based mail server in the final server
for the Users. Each and every User should have a special folder for the
purpose. Then they could simply drag the Spam-to-train and possibly
Ham-to-train to the folders.

Separate Cron job then could process the samples and train the bayes.



Your mode of life will be changed for the better because of new developments.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the amavis-users mailing list