1

Topic: SPAM Autolearn/dovecot: Spam-Ham-Spam move question

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.1
- Deployed with iRedMail Easy or the downloadable installer? installer
- Linux/BSD distribution name and version: Debian 10
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello all!

We are planning to use "Auto learn spam/ham with Dovecot imap_sieve plugin" as described on https://docs.iredmail.org/dovecot.imapsieve.html

While testing, I can observe email files being put into the according folders spam and ham for learning.
Thats very nice!

Nevertheless I found that when moving an email back and forth between folders, those get duplicated in the according spam/ham folders.

I don't know how SpamAssassin handles duplicates in SPAM and HAM learning.
Data gets duplicated and disk space wasted (possible DoS cause due to bad behaving customers).


Is this intended behaviour?
What if I enhance the imapsieve_copy script to use an unique identifier for each message instead of "${RANDOM}${RANDOM}"?
This would allow to check for existing messages and delete re-classified SPAM messages from HAM.


Best regards,
Bernhard

BTW: Moving folders into Junk does not cause anything to happen. Is this desired?

2

Re: SPAM Autolearn/dovecot: Spam-Ham-Spam move question

broth wrote:

I don't know how SpamAssassin handles duplicates in SPAM and HAM learning.

Duplicate messages is like only one message.

broth wrote:

Data gets duplicated and disk space wasted (possible DoS cause due to bad behaving customers).

Messages will be removed after scanned/learnt, and the cron job is ran every 10 minutes (default interval in our tutorial), i don't think it's a big deal.

broth wrote:

Is this intended behaviour?

Yes.

broth wrote:

What if I enhance the imapsieve_copy script to use an unique identifier for each message instead of "${RANDOM}${RANDOM}"?
This would allow to check for existing messages and delete re-classified SPAM messages from HAM.

You're free to do such improvement.

broth wrote:

BTW: Moving folders into Junk does not cause anything to happen. Is this desired?

Moving "folders" instead of mesages to Junk?
hmm, i didn't test this before, and Dovecot document doesn't mention this either. I'm afraid what you see is what we can expect from Dovecot.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

3

Re: SPAM Autolearn/dovecot: Spam-Ham-Spam move question

Thanks for your quick feedback!

If SA treats duplicate messages as only one, I'm fine.

But is it treaten like SPAM or HAM when it's e.g. 2 times in SPAM and 1 time in HAM?

ZhangHuangbin wrote:

Moving "folders" instead of mesages to Junk?
hmm, i didn't test this before, and Dovecot document doesn't mention this either. I'm afraid what you see is what we can expect from Dovecot.

I just tried to test "classic" customer behaviour and mistakes.
When moving a folder, nothing happens and that's great smile

4

Re: SPAM Autolearn/dovecot: Spam-Ham-Spam move question

broth wrote:

But is it treaten like SPAM or HAM when it's e.g. 2 times in SPAM and 1 time in HAM?

Good question, but i'm afraid that i don't have a accurate answer for you. Here's my presume based on what i learn from SA website and experience, i cannot tell you whether it's correct right now because i didn't do exact tests/exams yet.

- 2 times spam, it's like only one spam since it's duplicate.
- If you feed SA with same message as HAM, then it overwrites old data (SPAM) and it becomes HAM.

FYI:

https://cwiki.apache.org/confluence/dis … adLearning

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee