1

Topic: Autolearn sieve not working

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version : 1.6.2 MARIADB edition
- Deployed with iRedMail the downloadable
- Linux/BSD distribution : Rocky Linux 9.1
- Store mail accounts in : MARIADB
- Web server :NGINX
- Manage mail accounts with iRedadmin
======================================================

Hi,
My email folder is /media/data/vmail
I followed th instruction in setting up the spam autolearn as on the website "https://docs.iredmail.org/dovecot.imapsieve.html" , and adjusted the folders to /media/data/vmail instead of /var/vmail

When I move the message to "Junk" folder and check the imap.log, there is nothing there for sieve.

Jun  9 10:27:01 mail dovecot[3061839]: imap(My Email)<3110175><OqW+a6f9Hp3AqA9s>: copy from INBOX: box=Junk, uid=6362, msgid=<xxxxxxxxxx, size=15825, from="xxxxxxxxxx" <Some Email>, subject=xxxxxxxxxx, flags=()
Jun  9 10:27:01 mail dovecot[3061839]: imap(My Email)<3110175><OqW+a6f9Hp3AqA9s>: delete: box=INBOX, uid=28444, msgid=<xxxxxxxxxx, size=15825, from="xxxxxxxxxx" <Some Email>, subject=xxxxxxxxxx, flags=(\Deleted \Seen \Recent)
Jun  9 10:27:01 mail dovecot[3061839]: imap(My Email)<3110175><OqW+a6f9Hp3AqA9s>: expunge: box=INBOX, uid=28444, msgid=<xxxxxxxxxx, size=15825, from="xxxxxxxxxx" <Some Email>, subject=xxxxxxxxxx, flags=(\Deleted \Seen \Recent)

When I move the email from inbox to Junk , I see email in  /media/data/vmail/imapsieve_copy/spam/ which disappear after 10 minutes.

I still receive the same spam emails.
Please assist
Thank you

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Autolearn sieve not working

that's not how sa-learn works,it doesn't add any new detections and/or blocks more spam mails, aswell it needs a decent amount of mails to train to even make a slight difference

3

Re: Autolearn sieve not working

Cthulhu wrote:

that's not how sa-learn works,it doesn't add any new detections and/or blocks more spam mails, aswell it needs a decent amount of mails to train to even make a slight difference

Hi
around 150 spam email daily, I think this is decent enough.
specially that lots of email servers are not configured correctly and HELO will block most of them.

4

Re: Autolearn sieve not working

From the docs:

The bayesian classifier can only score new messages after it already learn 200 known spams and 200 known hams.

So have you moved more than 200 emails from inbox to junk AND 200 emails from junk to any other folder, except trash? You also need to leave those emails in place until the next sa-learn scan is finished.

5

Re: Autolearn sieve not working

RikuS wrote:

From the docs:

The bayesian classifier can only score new messages after it already learn 200 known spams and 200 known hams.

So have you moved more than 200 emails from inbox to junk AND 200 emails from junk to any other folder, except trash? You also need to leave those emails in place until the next sa-learn scan is finished.

Hi, and thank you for your reply,
This is what I am doing. and I deleted the mails in the junk folder after one week as it was too much, now for 3 days they are around 600 emails I moved to junk.

The issue is, I can't see anywhere in the log

sieve: pipe action: piped message to program `imapsieve_copy' 

or

 sieve: left message in mailbox 'Junk'

6

Re: Autolearn sieve not working

- No log lines with "imapsieve" in /var/log/dovecot/*.log?
- Any error or warning in /var/log/dovecot/dovecot.log?

7 (edited by promexce 2023-06-13 12:45:49)

Re: Autolearn sieve not working

ZhangHuangbin wrote:

- No log lines with "imapsieve" in /var/log/dovecot/*.log?
- Any error or warning in /var/log/dovecot/dovecot.log?


Hi ZhangHuangbin and thank you for your reply
no imapsieve in /var/log/dovecot/imap.log
can't find anywhere else may have the log
This is the result of command

grep sieve dovecot.log | tail

Jun 13 14:27:50 mail dovecot[1614]: imap(some_email): Debug: Module loaded: /usr/lib64/dovecot/lib95_imap_sieve_plugin.so
Jun 13 14:27:50 mail dovecot[1614]: imap(some_email): Debug: Module loaded: /usr/lib64/dovecot/lib95_imap_sieve_plugin.so
Jun 13 14:29:27 mail dovecot[1614]: imap(some_email): Debug: Module loaded: /usr/lib64/dovecot/lib95_imap_sieve_plugin.so
Jun 13 14:29:27 mail dovecot[1614]: imap(some_email): Debug: Module loaded: /usr/lib64/dovecot/lib95_imap_sieve_plugin.so
Jun 13 14:29:27 mail dovecot[1614]: imap(some_email): Debug: Module loaded: /usr/lib64/dovecot/lib95_imap_sieve_plugin.so
Jun 13 14:29:27 mail dovecot[1614]: imap(some_email): Debug: Module loaded: /usr/lib64/dovecot/lib95_imap_sieve_plugin.so
Jun 13 14:29:27 mail dovecot[1614]: imap(some_email): Debug: Module loaded: /usr/lib64/dovecot/lib95_imap_sieve_plugin.so
Jun 13 14:29:27 mail dovecot[1614]: imap(some_email): Debug: Module loaded: /usr/lib64/dovecot/lib95_imap_sieve_plugin.so
Jun 13 14:29:28 mail dovecot[1614]: imap(some_email): Debug: Module loaded: /usr/lib64/dovecot/lib95_imap_sieve_plugin.so
Jun 13 14:29:49 mail dovecot[1614]: imap(some_email): Debug: Module loaded: /usr/lib64/dovecot/lib95_imap_sieve_plugin.so

I noticed log file sieve.log is empty, since I implemented this steps.