0

Have dovecot+sieve. It's most often recommended that users train spamassassin/rspamd in the following way: A Spam folder is created in each mailbox (Junk type) Further, through the imap_sieve plugin, we look, if the letters are moved to this folder, then we consider them spam and call the script (in this case, spam.sh)

require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];

    if environment :matches "imap.user" "*" {
      set "username" "${1}";
      }

      pipe :copy "spam.sh" [ "${username}-spam" ]; 

If these are normal emails, then when moving FROM the spam folder to any other, we consider them ham and call the ham.sh script

require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];

  if environment :matches "imap.mailbox" "*" {
  set "mailbox" "${1}";
}

  if string "${mailbox}" "Trash" {
  stop;
}

  if environment :matches "imap.user" "*" {
  set "username" "${1}";
}

pipe :copy "ham.sh" [ "${username}-ham" ]; 

So the question is, how does this normally work? Emails after "Antispam" that scored average points are usually placed in the inbox marked SPAM. If it's really spam, we move them to the Spam folder, everything is ok here. But what if SPAM mark received a normal email? In order for the ham script to work, you need to place them first in the spam folder and then move them from there to another, and you get two script calls for one email (both spam and ham), makes no sense for me.

cozby
  • 7
  • 3
  • It trains on the whole folder when you call it. You can force run `ham.sh` periodically if you really want to, but simply amortizing it so that it gets retrained whenever there is a false positive is often sufficient. – tripleee Feb 01 '23 at 08:29
  • call ham.sh in what folder? inbox? for all users? If we see at spam folder, what will be with spamassassin if we will give it same mail as spam and ham? Is it ok for bayes? If not i don't understand why this method is good (in main post) – cozby Feb 01 '23 at 08:38
  • For the user who wants to retrain it. – tripleee Feb 01 '23 at 08:39
  • How they will trigger retrain (ham.sh)? – cozby Feb 01 '23 at 08:42
  • You'll probably need to set up some additional infrastructure if you want to expose that to end useers. – tripleee Feb 01 '23 at 08:44

0 Answers0