> Jari Fredriksson wrote:
>>> Hi there,
>>> Some spam is getting past the spamassassin.  So I;d like to devise a
scheme where I manually place the emails not caught by spamassass in
my
>>> 'spam-mail' folder.  Is there any way to get spamassassin to process the
>>> contents of the folder so I those accepted messages are considered
spam
>>> in the future?
>> It depends. If the "spam-mail folder" is a folder in a POP3 client, it is
>> not easy to automate it. if the "spam-mail folder" is a folder in a
IMAP-server, and the server uses Maildir format under Linux or other
Unix,
>> it is easy. The mails are plain text files in the server file system, and
>> a cron job can easily run sa-learn --spam with that folder.
>> If the server is some MS Exchange I have no idea. Maybe the folder
could
>> be downloaded periodically with fetchmail or such, and fed to sa-learn.
Anyway, SpamAssassin itself does not help besides sa-learn, so this
needs
>> scripting on your part.
>
> okay how do I script sa-learn to learn the contents of a particular
file.
>
> Cheers,
>
> Noah

If the user used to call spamc is noah, then this might do it. The last
parameter is file name or a folder name, in which case all files in the
folder will be learnt.

man sa-learn will tell more..



#!/bin/sh

/usr/bin/sa-learn -u noah --spam /home/noah/Maildir/spam-mail/cur






Reply via email to