1

Topic: Autolearn spam/ham

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

Hi,

I am trying to get spam autolearn to work, and I followed these directions :
dovecot.imapsieve.html  (sorry wont let me post the url) but its the official sites docs

And it just doesn't seem to work, even when I run the command line test.  Nothing shows up in the logs.   Is it supposed to run as root from cron, or as vmail?  The docs make it sound like it should run as root, but I am just not sure what's going on.   With no log entries it is super hard to troubleshoot.

Thanks for any help.

-F

----

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

2

Re: Autolearn spam/ham

Try to move some spams from INBOX (or other folders) to Junk, then check Dovecot log files (especially "/var/log/dovecot/imap.log"), you should see log line with tag "imapsieve".

3

Re: Autolearn spam/ham

Ahh..okay, here is what I am seeing in the logs.  Which permissions do I need to check?

Jan 21 03:26:33 mail dovecot: imap(xxx@xxx.xxx)<26093><faebu73yRt5/AAAB>: Fatal: execvp(/etc/dovecot/sieve/pipe/imapsieve_copy) failed: Permission denied
Jan 21 03:26:33 mail dovecot: imap(xxx@xxx.xxx)<26093><faebu73yRt5/AAAB>: program exec:/etc/dovecot/sieve/pipe/imapsieve_copy (26094): Terminated with non-zero exit cod
e 84
Jan 21 03:26:33 mail dovecot: imap(xxx@xxx.xxx)<26093><faebu73yRt5/AAAB>: Error: sieve: failed to execute to program `imapsieve_copy': refer to server log for more information. [2023-01-21 03:26:33]

4

Re: Autolearn spam/ham

Okay looking at it, it seems the permissions didn't get set correcyly..   They were rw...r..r  So the step where I set them to executable didnt stick.. I did copy pasta that, so maybe something screwed up.

5

Re: Autolearn spam/ham

Is it supposed to flag or mark the spam emails in the junk folder once the task is run, or maybe delete them?

6

Re: Autolearn spam/ham

fratm wrote:

Is it supposed to flag or mark the spam emails in the junk folder once the task is run, or maybe delete them?

If you follow our tutorial strictly, a copy of email moved from other folders to Junk will be saved for further auto-learn.

It waits for end-user's operation to trigger the auto-learn, it doesn't scan all users' Junk/Spam folders automatically and proactively.

7

Re: Autolearn spam/ham

ZhangHuangbin wrote:
fratm wrote:

Is it supposed to flag or mark the spam emails in the junk folder once the task is run, or maybe delete them?

If you follow our tutorial strictly, a copy of email moved from other folders to Junk will be saved for further auto-learn.

It waits for end-user's operation to trigger the auto-learn, it doesn't scan all users' Junk/Spam folders automatically and proactively.


yeah I read that, I think I just had trouble wrapping my head around it.  But it makes sense now.  Also just finally got a spam message to put in junk, and watched this pop into the logs

Jan 20 20:04:16 mail scan_reported_mails: [SPAM] Learned tokens from 1 message(s) (1 message(s) examined)


So yay! it is working, it was just the file permissions set incorrectly.

Thank you for you help, you rock!

-F