[Dovecot] Antispam plugin + scriptsieve
Hi,
I wrote a little python program that works with antispam plugin, to create or remove sieve rules based on "From:" of any e-mail that is moved to some folder configured in dovecot.conf.
He works fine with "Felamimail" the email program of "eGroupware".
After setup, is very simple:
If an user move a message to "blocked" folder, is appended a rule in the script sieve of this user. If the message is deleted or moved out that folder, the rule is removed too.
The setup is very simple: (after setup antispam plugin)
Change this in dovecot.conf:
protocol imap { mail_plugins = antispam }
plugin { antispam_spam = Blocked antispam_mail_sendmail = /usr/libexec/dovecot/blockthis.py antispam_mail_sendmail_args = -u;%u antispam_mail_spam = -a antispam_mail_notspam = -d }
Hooo... this script create a "include global script" statament in script sieve... If you don't want this feature, just comment this 2 lines:
sievelist.append('require ["fileinto", "include"];\n') sievelist.append('include :global "global.sieve";\n')
Here this is very useful! :D
This script was created to suit my needs, so, have some paths in the code... It's not very "user friendly" yet... but if have intereting I will implement others features (like a config file).
Download here: http://allan.cassaro.googlepages.com/blockthis.py
Regards.
On Wed, Dec 3, 2008 at 5:46 PM, Allan Cassaro allan.cassaro@gmail.com wrote:
Hi,
I wrote a little python program that works with antispam plugin, to create or remove sieve rules based on "From:" of any e-mail that is moved to some folder configured in dovecot.conf.
He works fine with "Felamimail" the email program of "eGroupware".
After setup, is very simple:
If an user move a message to "blocked" folder, is appended a rule in the script sieve of this user. If the message is deleted or moved out that folder, the rule is removed too.
The setup is very simple: (after setup antispam plugin)
Change this in dovecot.conf:
protocol imap { mail_plugins = antispam }
plugin { antispam_spam = Blocked antispam_mail_sendmail = /usr/libexec/dovecot/blockthis.py antispam_mail_sendmail_args = -u;%u antispam_mail_spam = -a antispam_mail_notspam = -d }
Hooo... this script create a "include global script" statament in script sieve... If you don't want this feature, just comment this 2 lines:
sievelist.append('require ["fileinto", "include"];\n') sievelist.append('include :global "global.sieve";\n')
Here this is very useful! :D
This script was created to suit my needs, so, have some paths in the code... It's not very "user friendly" yet... but if have intereting I will implement others features (like a config file).
Download here: http://allan.cassaro.googlepages.com/blockthis.py
Sorry, this link is broken... The correct link is:
http://allan.cassaro.googlepages.com/blockthis.py.gz
Regards.
participants (1)
-
Allan Cassaro