<div dir="ltr">I have the following, and it works:<div><div>require ["include","fileinto","imap4flags","variables"];</div><div>global "MyFlags";</div><div>if header :contains ["X-LERCTR-Spam-Flag","X-TNTSCAN-Spam-Flag"] "YES"</div><div>{</div><div> redirect "<a href="mailto:spamtrap@spambouncer.org">spamtrap@spambouncer.org</a>";</div><div> addflag "MyFlags" "\\Seen Junk";</div><div> fileinto :flags "${MyFlags}" "SPAM";</div><div> stop;</div><div>}</div></div><div><br></div><div>FWIW.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Dec 4, 2018 at 8:25 AM Jakobus Schürz <<a href="mailto:wertstoffe@nurfuerspam.de">wertstoffe@nurfuerspam.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p>Now i tried an additional rule in my "normal" working
sieve-filter:</p>
<p>if address :domain :matches "from" "company.example"<br>
{ setflag "\\seen"; fileinto :create "INBOX/foo/test"; stop; }</p>
<p>and sent an email from my company-account. The folder
INBOX/foo/test gets created, but the message inside is not marked
as seen.</p>
<p>So i think, this is a bug in dovecot/pigeonhole, which ignores
the \\seen-Flag being set by sieve-script.</p>
<p>I tried to set the seen-flag to the message with doveadm. This
works correctly.</p>
<p><br>
</p>
<p>BG Jakob</p>
<p><br>
</p>
<p><br>
</p>
<div class="m_-5960888984606614060moz-cite-prefix">Am 04.12.18 um 14:23 schrieb Jakobus
Schürz:<br>
</div>
<blockquote type="cite">
<p>Ok. I tried another Thunderbird-specific Flag:<br>
<br>
</p>
<pre>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}" ];</pre>
<p>When i move an unflagged email to Folder Junk, it is shown in
Thunderbird as "personal", Junk but Unseen.</p>
<p>So, the rule is really working, except for the \\seen-Flag.</p>
<p>I have the line</p>
<pre>addflag "\\seen";
</pre>
<p>from the dovecot-wiki!</p>
<p>BG jakob</p>
<p><br>
</p>
<p><br>
</p>
<div class="m_-5960888984606614060moz-cite-prefix">Am 04.12.18 um 14:06 schrieb Jakobus
Schürz:<br>
</div>
<blockquote type="cite">
<pre class="m_-5960888984606614060moz-quote-pre">Hi Ralph!
This is, what calls the correct sive-filter rules. I have that already
in use.
But the file
<a class="m_-5960888984606614060moz-txt-link-freetext">file:/etc/dovecot/sievepipe/report-spam</a>
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...
Why?
BR
Jakob
Am 04.12.18 um 12:46 schrieb Ralph Seichter:
</pre>
<blockquote type="cite">
<pre class="m_-5960888984606614060moz-quote-pre">* Jakobus Schürz:
</pre>
<blockquote type="cite">
<pre class="m_-5960888984606614060moz-quote-pre">addflag "Junk";
setflag "\\seen";
</pre>
</blockquote>
<pre class="m_-5960888984606614060moz-quote-pre">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 = <a class="m_-5960888984606614060moz-txt-link-freetext">file:/etc/dovecot/sievepipe/report-spam</a>
# Message moved out of Spam folder
imapsieve_mailbox2_name = *
imapsieve_mailbox2_from = Junk
imapsieve_mailbox2_causes = COPY
imapsieve_mailbox2_before = <a class="m_-5960888984606614060moz-txt-link-freetext">file:/etc/dovecot/sievepipe/report-ham</a>
}
This was typed from memory, so I hope the syntax is correct.
-Ralph
</pre>
</blockquote>
</blockquote>
</blockquote>
</div>
</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>