Hi, I recently noticed that some of my automatically processed mails do no longer show flags with current Dovecot builds. This used to work before, not sure what broke it or whether I used it in the wrong way. When the removeflag line is dropped *both* messages get flagged in the client, one in INBOX and one in Trash. With removeflag in place, *both* messages are unflagged, the one in INBOX and the one in Trash. This used to work differently before if memory doesn't fail me. #Test if address :is "From" "user at example.com" { addflag "\\Flagged $MailFlagBit1"; keep; removeflag "\\Flagged $MailFlagBit1"; fileinto "Trash"; } # 2.2.devel (01867a4): /etc/dovecot/dovecot.conf # Pigeonhole version 0.4.devel (3c071a4) # OS: Linux 3.16.0-4-amd64 x86_64 Debian 8.6 Regards Thomas -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 181 bytes Desc: Digital signature URL: <http://dovecot.org/pipermail/dovecot/attachments/20170113/faad59b5/attachment.sig>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, 13 Jan 2017, Thomas Leuxner wrote:> I recently noticed that some of my automatically processed mails do no longer show flags with current Dovecot builds. This used to work before, not sure what broke it or whether I used it in the wrong way. When the removeflag line is dropped *both* messages get flagged in the client, one in INBOX and one in Trash. With removeflag in place, *both* messages are unflagged, the one in INBOX and the one in Trash. This used to work differently before if memory doesn't fail me. > > #Test > if address :is "From" "user at example.com" > { > addflag "\\Flagged $MailFlagBit1"; > keep; > removeflag "\\Flagged $MailFlagBit1"; > fileinto "Trash"; > } >from point of "logic" I would turn around both actions: removeflag "\\Flagged $MailFlagBit1"; fileinto "Trash"; addflag "\\Flagged $MailFlagBit1"; keep; Because keep is an action at the end of script processing, so the removeflag superceeds the "add". Or use fileinto "INBOX"; - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEVAwUBWHiimXz1H7kL/d9rAQJJWggAnF/VfdP4LYIuH4eSG7Pzvu0iwYA4WHQ2 2aJzFzVmtnCNgidJ/SvN6CJ5VLF0K+SjbDT7/VmSV9tOaMjTh1cWqGe5jbJMhgBu emeHd6sy/XrVYqIhHeLadQGmR4pzT9SQo4Z/6rI5oDzhEhyZC8kXuxOqbtOtUOmr XyHorah814gxKDHzoTbbTZXeTRa7sCjy0gon60qBWEPEuom2mzyCGIPznLAmme7q YTfZWEfgfhuN4K6ENn0AJl/BAvpYQW2jUUH+My0ZykwDzqPPkOkOvmPiI/1yG0CB p34jJrM8f+z3CErWeg+sNXtCvQbjMUVtLRoWjy50ARGs+WekqYzezQ==3vQF -----END PGP SIGNATURE-----
* Steffen Kaiser <skdovecot at smail.inf.fh-brs.de> 2017.01.13 10:49:> from point of "logic" I would turn around both actions: > > removeflag "\\Flagged $MailFlagBit1"; > fileinto "Trash"; > > addflag "\\Flagged $MailFlagBit1"; > keep;Hi Steffen, that works thanks. Not sure why it worked before. Regards Thomas -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 181 bytes Desc: Digital signature URL: <http://dovecot.org/pipermail/dovecot/attachments/20170113/5a015297/attachment.sig>
Op 13-1-2017 om 9:15 schreef Thomas Leuxner:> Hi, > > I recently noticed that some of my automatically processed mails do no longer show flags with current Dovecot builds. This used to work before, not sure what broke it or whether I used it in the wrong way. When the removeflag line is dropped *both* messages get flagged in the client, one in INBOX and one in Trash. With removeflag in place, *both* messages are unflagged, the one in INBOX and the one in Trash. This used to work differently before if memory doesn't fail me. > > #Test > if address :is "From" "user at example.com" > { > addflag "\\Flagged $MailFlagBit1"; > keep; > removeflag "\\Flagged $MailFlagBit1"; > fileinto "Trash"; > } > > # 2.2.devel (01867a4): /etc/dovecot/dovecot.conf > # Pigeonhole version 0.4.devel (3c071a4) > # OS: Linux 3.16.0-4-amd64 x86_64 Debian 8.6That should just work. I tested this with the indicated versions using sieve-test and an empty user account: $ sieve-test -e -t - -Tlevel=matching ~/frop.sieve ~/message.eml ## Started executing script 'frop' 6: address test 6: starting `:is' match with `i;ascii-casemap' comparator: 6: extracting `From' headers from message 6: parsing address header value `User <user at example.com>' 6: extracting `all' part from address `user at example.com' 6: matching value `user at example.com' 6: with key `user at example.com' => 1 6: finishing match with result: matched 6: jump if result is false 6: not jumping 8: addflag command 8: add flags `\Flagged $MailFlagBit1' 9: keep action; store message in default mailbox 10: removeflag command 10: remove flags `\Flagged $MailFlagBit1' 11: fileinto action 11: store message in mailbox `Trash' ## Finished executing script 'frop' info: msgid=unspecified: stored mail into mailbox 'INBOX'. info: msgid=unspecified: stored mail into mailbox 'Trash'. sieve-test(stephan): Info: final result: success $ doveadm fetch flags mailbox "Trash" 1 flags: \Recent $ doveadm fetch flags mailbox "INBOX" 1 flags: \Flagged \Recent $MailFlagBit1 So, that performs as expected. However, when I test this with LDA, ? can reproduce your problem: $ doveadm fetch flags mailbox "Trash" 1 flags: \Recent $ doveadm fetch flags mailbox "INBOX" 1 flags: \Recent Will investigate more later today... Regards, Stephan.
* Stephan Bosch <stephan at rename-it.nl> 2017.01.13 13:50:> So, that performs as expected. However, when I test this with LDA, ? can > reproduce your problem: > > $ doveadm fetch flags mailbox "Trash" 1 > flags: \Recent > $ doveadm fetch flags mailbox "INBOX" 1 > flags: \Recent > > Will investigate more later today...Thanks for confirming Stephan. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 181 bytes Desc: Digital signature URL: <http://dovecot.org/pipermail/dovecot/attachments/20170113/1ba9e26f/attachment.sig>