Introduced auto. spam learning & global sieve filter#835
Introduced auto. spam learning & global sieve filter#83517Halbe wants to merge 6 commits intodocker-mailserver:masterfrom
Conversation
johansmitsnl
left a comment
There was a problem hiding this comment.
Could you verify the foldername and add some new lines to the end?
| # AntispamWithSieve (Derived from: https://wiki2.dovecot.org/HowTo/AntispamWithSieve) | ||
|
|
||
| # From elsewhere to Spam folder | ||
| imapsieve_mailbox1_name = Spam |
There was a problem hiding this comment.
There was a problem hiding this comment.
You are so right.. Never base decisions on assumptions!!
|
|
||
| # From Spam folder to elsewhere | ||
| imapsieve_mailbox2_name = * | ||
| imapsieve_mailbox2_from = Spam |
There was a problem hiding this comment.
| @@ -0,0 +1,2 @@ | |||
| #!/bin/sh | |||
| exec /usr/bin/sa-learn -u ${1} --ham No newline at end of file | |||
There was a problem hiding this comment.
Add a newline to the end of the file
| @@ -0,0 +1,2 @@ | |||
| #!/bin/sh | |||
| exec /usr/bin/sa-learn -u ${1} --spam No newline at end of file | |||
There was a problem hiding this comment.
Add a newline to the end of the file
| set "username" "${1}"; | ||
| } | ||
|
|
||
| pipe :copy ".sa-learn-ham.sh" [ "${username}" ]; No newline at end of file |
There was a problem hiding this comment.
Add a newline to the end of the file
| set "username" "${1}"; | ||
| } | ||
|
|
||
| pipe :copy ".sa-learn-spam.sh" [ "${username}" ]; No newline at end of file |
There was a problem hiding this comment.
Add a newline to the end of the file
|
Good PR and much wanted! Not sure how to test this though. |
|
I don't know on those tests. |
|
I tried testing but I have 2 questions:
|
|
Yes, the respective mail will be piped to sa-learn. And you are right. dbpath has to be set, I wasn't actually aware that we weren't using user specific spam-DBs. |
|
Please don't merge yet. I'll give this a try on a real mailserver.. Will take some time though. I'm really in a busy 2 months right now. |
|
Since learning every single mail at the time of movement is quite expensive (SA has to be started for every mail) I would suggest moving spam mails to a separate folder and delay learning to once a day by cron. |
|
That sounds a good idea. On the wiki there is already something about this but it is only for one folder, not for all folders. #592 |
|
@17Halbe will you update this branch or do you provide a new PR? |
|
Sorry for leaving you hanging! I really only get to work on this project while I‘m travelling. There‘s a lot of work related stuff I got to do till Friday. Thereafter I‘ll probably got a week off. |
|
@17Halbe was just asking, no hurries ;) |
|
Sorry for the "long time no see". I was sick and away for it. I won't be able to contribute for some time. Sorry. Feel free to close this one. |
Introduced auto-spam-learning via sieve.
Spam is automatically trained to spamassassin, when moved via imap-only to the spam folder.
And so is "Ham" when it's moved out of the Spam folder.
Additionally two new optional config files have been introduced:
The former being a global sieve file which is going to be executed before the user specific rules are applied and the later, you might have guessed it, is applied, after the user specific rules have been executed.
Attention:
This has not been tested with actual Spam, Ham movement. We need a testcase or at least someone to test it before merging, alone I don't know how to programmatically move mails between two imap-folders. Anyone else has a hint? Or can try this out?
Tests are passing on my machine.
closes #384