summaryrefslogtreecommitdiff
blob: 2ad40aa3d5ba62612cde3c60645d0c927332e3e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];

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

# This line is important because when we delete from Junk/Spam,
# messages get moved to Trash, which tirggers the "message moved out of
# spam" script (this script) which—usually!—trains the originally classified
# Spam as not-spam.
# BUT, this is just a delete! If we train our spam as not-spam on delete, that
# defeats our goals.
# In short, this always gets run on a message being moved out of Spam, but if
# the target mailbox is Trash, just don't run the trainer this time.
if string "${mailbox}" "Trash" {
  stop;
}

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

pipe :copy "train-ham.sh" [ "${email}" ];
Powered by cgit v1.2.3 (git 2.41.0)