set seen flag and junk moving a mail manually to JUNK

Ralph Seichter m16+dovecot at monksofcool.net
Tue Dec 4 13:46:24 EET 2018


* Jakobus Schürz:

> addflag "Junk";
> setflag "\\seen";

That's probably not what you want, because the 'setflag' command
replaces all existing flags. In any case, I recommend you use this
method instead:

  plugin {
    sieve_pipe_bin_dir = /etc/dovecot/sievepipe

    # Message moved into Spam folder
    imapsieve_mailbox1_name = Junk
    imapsieve_mailbox1_causes = COPY
    imapsieve_mailbox1_before = file:/etc/dovecot/sievepipe/report-spam

    # Message moved out of Spam folder
    imapsieve_mailbox2_name = *
    imapsieve_mailbox2_from = Junk
    imapsieve_mailbox2_causes = COPY
    imapsieve_mailbox2_before = file:/etc/dovecot/sievepipe/report-ham
  }

This was typed from memory, so I hope the syntax is correct.

-Ralph


More information about the dovecot mailing list