Yes. I did it the same way, Larry described. And i have in my sieve-script, which i use also for years the other notation i tried before, many times in use. The last month it did not recognize, that this rules won't work any longer. Today i played around a little, then i saw, it won't work to set the \Seen-Flag...
Please be aware, i can set Junk-Flag, and Thunderbird shows me the Emails marked as Junk. I can set the $label3-Flag, and Thunderbird shows me the Message marked as personal. Only the \Seen-Flag is not able to be set. Messages are always shown as Unseen. Sometimes also as Recent... Not when i set it in an own line with addflag. Not when i set it with setflag as the only Flag. Not when i set it together with other flags in one line. The other flags are set. Only \Seen is not set. BG Jakob Am 04.12.18 um 16:17 schrieb Aki Tuomi: > Did you notice the > > fileinto :flags > > usage? It comes from imap4sieve extension. > > https://tools.ietf.org/html/rfc5232#page-7 > > Aki > >> On 04 December 2018 at 17:13 Larry Rosenman <[email protected]> wrote: >> >> >> I've been using that recipe for YEARS, and it DOES work for me on FreeBSD >> (I'm also the port maintainer for dovecot and pigeonhole). >> >> Not sure exactly what you are doing wrong, but I use lmtp to deliver the >> mail to mbox formatted mailboxes. >> >> >> >> On Tue, Dec 4, 2018 at 9:11 AM Jakobus Schürz <[email protected]> >> wrote: >> >>> I tried it like you... doesn't work. The message gets all the other >>> flags, >>> but not the \Seen-Flag. >>> >>> My repo is >>> >>> https://repo.dovecot.org/ce-2.3-latest/debian/stretch stretch >>> dpkg -l|grep dove >>> ii dovecot-core 2:2.3.4-2~stretch amd64 secure POP3/IMAP server - >>> core files >>> ii dovecot-imapd 2:2.3.4-2~stretch amd64 secure POP3/IMAP server - >>> IMAP daemon >>> ii dovecot-ldap 2:2.3.4-2~stretch amd64 secure POP3/IMAP server - >>> LDAP support >>> ii dovecot-lmtpd 2:2.3.4-2~stretch amd64 secure POP3/IMAP server - >>> LMTP server >>> ii dovecot-lucene 2:2.3.4-2~stretch amd64 secure POP3/IMAP server - >>> Lucene support >>> ii dovecot-managesieved 2:2.3.4-2~stretch amd64 secure POP3/IMAP >>> server - ManageSieve server >>> ii dovecot-pop3d 2:2.3.4-2~stretch amd64 secure POP3/IMAP server - >>> POP3 daemon >>> ii dovecot-sieve 2:2.3.4-2~stretch amd64 secure POP3/IMAP server - >>> Sieve filters support >>> ii dovecot-solr 2:2.3.4-2~stretch amd64 secure POP3/IMAP server - >>> Solr support >>> >>> >>> >>> Am 04.12.18 um 16:04 schrieb Larry Rosenman: >>> >>> 2.3.4/0.5.4 (dovecot/pigeonhole) >>> >>> Note the casing on the \\Seen flag. >>> >>> On Tue, Dec 4, 2018 at 9:02 AM Jakobus Schürz >>> <[email protected]> >>> wrote: >>> >>>> Which version of dovecot are you using? >>>> >>>> >>>> jakob >>>> >>>> Am 04.12.18 um 15:44 schrieb Larry Rosenman: >>>>> I have the following, and it works: >>>>> require ["include","fileinto","imap4flags","variables"]; >>>>> global "MyFlags"; >>>>> if header :contains ["X-LERCTR-Spam-Flag","X-TNTSCAN-Spam-Flag"] "YES" >>>>> { >>>>> redirect "[email protected]"; >>>>> addflag "MyFlags" "\\Seen Junk"; >>>>> fileinto :flags "${MyFlags}" "SPAM"; >>>>> stop; >>>>> } >>>>> >>>>> FWIW. >>>>> >>>>> >>>>> On Tue, Dec 4, 2018 at 8:25 AM Jakobus Schürz < >>>> [email protected]> >>>>> wrote: >>>>> >>>>>> Now i tried an additional rule in my "normal" working sieve-filter: >>>>>> >>>>>> if address :domain :matches "from" "company.example" >>>>>> { setflag "\\seen"; fileinto :create "INBOX/foo/test"; stop; } >>>>>> >>>>>> and sent an email from my company-account. The folder INBOX/foo/test >>>> gets >>>>>> created, but the message inside is not marked as seen. >>>>>> >>>>>> So i think, this is a bug in dovecot/pigeonhole, which ignores the >>>>>> \\seen-Flag being set by sieve-script. >>>>>> >>>>>> I tried to set the seen-flag to the message with doveadm. This works >>>>>> correctly. >>>>>> >>>>>> >>>>>> BG Jakob >>>>>> >>>>>> >>>>>> >>>>>> Am 04.12.18 um 14:23 schrieb Jakobus Schürz: >>>>>> >>>>>> Ok. I tried another Thunderbird-specific Flag: >>>>>> >>>>>> require ["imap4flags", "vnd.dovecot.pipe", "copy", "imapsieve", >>>> "environment", "variables"]; >>>>>> if environment :matches "imap.email" "*" { >>>>>> set "email" "${1}"; >>>>>> } >>>>>> addflag "Junk"; >>>>>> addflag "\\seen"; >>>>>> addflag "$label3"; >>>>>> pipe :copy "learn-spam.sh"; >>>>>> pipe :copy "learn-spam-sa.sh" [ "${email}" ]; >>>>>> >>>>>> When i move an unflagged email to Folder Junk, it is shown in >>>> Thunderbird >>>>>> as "personal", Junk but Unseen. >>>>>> >>>>>> So, the rule is really working, except for the \\seen-Flag. >>>>>> >>>>>> I have the line >>>>>> >>>>>> addflag "\\seen"; >>>>>> >>>>>> from the dovecot-wiki! >>>>>> >>>>>> BG jakob >>>>>> >>>>>> >>>>>> >>>>>> Am 04.12.18 um 14:06 schrieb Jakobus Schürz: >>>>>> >>>>>> Hi Ralph! >>>>>> >>>>>> This is, what calls the correct sive-filter rules. I have that >>>>>> already >>>>>> in use. >>>>>> But the file >>>>>> file:/etc/dovecot/sievepipe/report-spam >>>>>> >>>>>> contains my sieve-script from my first posting. >>>>>> So, the difference from setflag to addflag is, setflag sets the >>>>>> flags, >>>>>> and only the given flags (removing all other flags), and addflag >>>>>> adds a >>>>>> flag to the existing flags... >>>>>> >>>>>> I fiddled around a little... >>>>>> The sieve-script sets the Junk-Flag, when it looks like: >>>>>> >>>>>> require ["imap4flags", "vnd.dovecot.pipe", "copy", "imapsieve", >>>>>> "environment", "variables"]; >>>>>> >>>>>> if environment :matches "imap.email" "*" { >>>>>> set "email" "${1}"; >>>>>> } >>>>>> >>>>>> addflag "Junk \\seen"; >>>>>> pipe :copy "learn-spam.sh"; >>>>>> pipe :copy "learn-spam-sa.sh" [ "${email}" ]; >>>>>> >>>>>> But the \\seen-Flag is not set. >>>>>> >>>>>> When i comment out the addflag-line, the Junk-Flag is not set. So the >>>>>> line works correct... but only for the Junk-Flag, not for the >>>> seen-Flag.. >>>> >>> >>> -- >>> Larry Rosenman http://www.lerctr.org/~ler >>> Phone: +1 214-642-9640 (c) E-Mail: [email protected] >>> US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106 >>> >>> >> -- Larry Rosenman http://www.lerctr.org/~ler >> Phone: +1 214-642-9640 (c) E-Mail: [email protected] >> US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106
