<div dir="ltr">I think you meant imap4flags, not imap4sieve.<div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Dec 4, 2018 at 9:17 AM Aki Tuomi <<a href="mailto:aki.tuomi@open-xchange.com">aki.tuomi@open-xchange.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Did you notice the<br>
<br>
fileinto :flags<br>
<br>
usage? It comes from imap4sieve extension.<br>
<br>
<a href="https://tools.ietf.org/html/rfc5232#page-7" rel="noreferrer" target="_blank">https://tools.ietf.org/html/rfc5232#page-7</a><br>
<br>
Aki<br>
<br>
> On 04 December 2018 at 17:13 Larry Rosenman <<a href="mailto:larryrtx@gmail.com" target="_blank">larryrtx@gmail.com</a>> wrote:<br>
> <br>
> <br>
> I've been using that recipe for YEARS, and it DOES work for me on FreeBSD<br>
> (I'm also the port maintainer for dovecot and pigeonhole).<br>
> <br>
> Not sure exactly what you are doing wrong, but I use lmtp to deliver the<br>
> mail to mbox formatted mailboxes.<br>
> <br>
> <br>
> <br>
> On Tue, Dec 4, 2018 at 9:11 AM Jakobus Schürz <<a href="mailto:wertstoffe@nurfuerspam.de" target="_blank">wertstoffe@nurfuerspam.de</a>><br>
> wrote:<br>
> <br>
> > I tried it like you... doesn't work. The message gets all the other flags,<br>
> > but not the \Seen-Flag.<br>
> ><br>
> > My repo is<br>
> ><br>
> > <a href="https://repo.dovecot.org/ce-2.3-latest/debian/stretch" rel="noreferrer" target="_blank">https://repo.dovecot.org/ce-2.3-latest/debian/stretch</a> stretch<br>
> > dpkg -l|grep dove<br>
> > ii  dovecot-core                      2:2.3.4-2~stretch              amd64        secure POP3/IMAP server - core files<br>
> > ii  dovecot-imapd                     2:2.3.4-2~stretch              amd64        secure POP3/IMAP server - IMAP daemon<br>
> > ii  dovecot-ldap                      2:2.3.4-2~stretch              amd64        secure POP3/IMAP server - LDAP support<br>
> > ii  dovecot-lmtpd                     2:2.3.4-2~stretch              amd64        secure POP3/IMAP server - LMTP server<br>
> > ii  dovecot-lucene                    2:2.3.4-2~stretch              amd64        secure POP3/IMAP server - Lucene support<br>
> > ii  dovecot-managesieved              2:2.3.4-2~stretch              amd64        secure POP3/IMAP server - ManageSieve server<br>
> > ii  dovecot-pop3d                     2:2.3.4-2~stretch              amd64        secure POP3/IMAP server - POP3 daemon<br>
> > ii  dovecot-sieve                     2:2.3.4-2~stretch              amd64        secure POP3/IMAP server - Sieve filters support<br>
> > ii  dovecot-solr                      2:2.3.4-2~stretch              amd64        secure POP3/IMAP server - Solr support<br>
> ><br>
> ><br>
> ><br>
> > Am 04.12.18 um 16:04 schrieb Larry Rosenman:<br>
> ><br>
> > 2.3.4/0.5.4 (dovecot/pigeonhole)<br>
> ><br>
> > Note the casing on the \\Seen flag.<br>
> ><br>
> > On Tue, Dec 4, 2018 at 9:02 AM Jakobus Schürz <<a href="mailto:wertstoffe@nurfuerspam.de" target="_blank">wertstoffe@nurfuerspam.de</a>><br>
> > wrote:<br>
> ><br>
> >> Which version of dovecot are you using?<br>
> >><br>
> >><br>
> >> jakob<br>
> >><br>
> >> Am 04.12.18 um 15:44 schrieb Larry Rosenman:<br>
> >> > I have the following, and it works:<br>
> >> > require ["include","fileinto","imap4flags","variables"];<br>
> >> > global "MyFlags";<br>
> >> > if header :contains ["X-LERCTR-Spam-Flag","X-TNTSCAN-Spam-Flag"]  "YES"<br>
> >> > {<br>
> >> >    redirect "<a href="mailto:spamtrap@spambouncer.org" target="_blank">spamtrap@spambouncer.org</a>";<br>
> >> >    addflag "MyFlags" "\\Seen Junk";<br>
> >> >    fileinto :flags "${MyFlags}" "SPAM";<br>
> >> >    stop;<br>
> >> > }<br>
> >> ><br>
> >> > FWIW.<br>
> >> ><br>
> >> ><br>
> >> > On Tue, Dec 4, 2018 at 8:25 AM Jakobus Schürz <<br>
> >> <a href="mailto:wertstoffe@nurfuerspam.de" target="_blank">wertstoffe@nurfuerspam.de</a>><br>
> >> > wrote:<br>
> >> ><br>
> >> >> Now i tried an additional rule in my "normal" working sieve-filter:<br>
> >> >><br>
> >> >> if address :domain :matches "from" "company.example"<br>
> >> >>   { setflag "\\seen"; fileinto :create "INBOX/foo/test"; stop; }<br>
> >> >><br>
> >> >> and sent an email from my company-account. The folder INBOX/foo/test<br>
> >> gets<br>
> >> >> created, but the message inside is not marked as seen.<br>
> >> >><br>
> >> >> So i think, this is a bug in dovecot/pigeonhole, which ignores the<br>
> >> >> \\seen-Flag being set by sieve-script.<br>
> >> >><br>
> >> >> I tried to set the seen-flag to the message with doveadm. This works<br>
> >> >> correctly.<br>
> >> >><br>
> >> >><br>
> >> >> BG Jakob<br>
> >> >><br>
> >> >><br>
> >> >><br>
> >> >> Am 04.12.18 um 14:23 schrieb Jakobus Schürz:<br>
> >> >><br>
> >> >> Ok. I tried another Thunderbird-specific Flag:<br>
> >> >><br>
> >> >> require ["imap4flags", "vnd.dovecot.pipe", "copy", "imapsieve",<br>
> >> "environment", "variables"];<br>
> >> >> if environment :matches "imap.email" "*" {<br>
> >> >>   set "email" "${1}";<br>
> >> >> }<br>
> >> >> addflag "Junk";<br>
> >> >> addflag "\\seen";<br>
> >> >> addflag "$label3";<br>
> >> >> pipe :copy "learn-spam.sh";<br>
> >> >> pipe :copy "learn-spam-sa.sh" [ "${email}" ];<br>
> >> >><br>
> >> >> When i move an unflagged email to Folder Junk, it is shown in<br>
> >> Thunderbird<br>
> >> >> as "personal", Junk but Unseen.<br>
> >> >><br>
> >> >> So, the rule is really working, except for the \\seen-Flag.<br>
> >> >><br>
> >> >> I have the line<br>
> >> >><br>
> >> >> addflag "\\seen";<br>
> >> >><br>
> >> >> from the dovecot-wiki!<br>
> >> >><br>
> >> >> BG jakob<br>
> >> >><br>
> >> >><br>
> >> >><br>
> >> >> Am 04.12.18 um 14:06 schrieb Jakobus Schürz:<br>
> >> >><br>
> >> >> Hi Ralph!<br>
> >> >><br>
> >> >> This is, what calls the correct sive-filter rules. I have that already<br>
> >> >> in use.<br>
> >> >> But the file<br>
> >> >> file:/etc/dovecot/sievepipe/report-spam<br>
> >> >><br>
> >> >> contains my sieve-script from my first posting.<br>
> >> >> So, the difference from setflag to addflag is, setflag sets the flags,<br>
> >> >> and only the given flags (removing all other flags), and addflag adds a<br>
> >> >> flag to the existing flags...<br>
> >> >><br>
> >> >> I fiddled around a little...<br>
> >> >> The sieve-script sets the Junk-Flag, when it looks like:<br>
> >> >><br>
> >> >> require ["imap4flags", "vnd.dovecot.pipe", "copy", "imapsieve",<br>
> >> >> "environment", "variables"];<br>
> >> >><br>
> >> >> if environment :matches "imap.email" "*" {<br>
> >> >>   set "email" "${1}";<br>
> >> >> }<br>
> >> >><br>
> >> >> addflag "Junk \\seen";<br>
> >> >> pipe :copy "learn-spam.sh";<br>
> >> >> pipe :copy "learn-spam-sa.sh" [ "${email}" ];<br>
> >> >><br>
> >> >> But the \\seen-Flag is not set.<br>
> >> >><br>
> >> >> When i comment out the addflag-line, the Junk-Flag is not set. So the<br>
> >> >> line works correct... but only for the Junk-Flag, not for the<br>
> >> seen-Flag..<br>
> >><br>
> ><br>
> ><br>
> > --<br>
> > Larry Rosenman                     <a href="http://www.lerctr.org/~ler" rel="noreferrer" target="_blank">http://www.lerctr.org/~ler</a><br>
> > Phone: +1 214-642-9640 (c)     E-Mail: <a href="mailto:larryrtx@gmail.com" target="_blank">larryrtx@gmail.com</a><br>
> > US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106<br>
> ><br>
> ><br>
> <br>
> -- <br>
> Larry Rosenman                     <a href="http://www.lerctr.org/~ler" rel="noreferrer" target="_blank">http://www.lerctr.org/~ler</a><br>
> Phone: +1 214-642-9640 (c)     E-Mail: <a href="mailto:larryrtx@gmail.com" target="_blank">larryrtx@gmail.com</a><br>
> US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Larry Rosenman                     <a href="http://www.lerctr.org/~ler" target="_blank">http://www.lerctr.org/~ler</a><br><span>Phone: <span title="Call with Google Voice"><span title="Call with Google Voice"><span title="Call with Google Voice">+1 214-642-9640</span></span></span> (c)     E-Mail: </span><a href="mailto:larryrtx@gmail.com" target="_blank">larryrtx@gmail.com</a><br>US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106</div></div></div></div></div></div></div></div>