<div class="markdown">
<p dir="auto">On 19 Jan 2016, at 11:15, Patrik Fältström wrote:</p>

<blockquote>
<p dir="auto">The moveToJunk is described like this:</p>

<p dir="auto">moveToJunk:    -    Shorthand for ( 'moveToMailbox:', 'junk' )</p>

<p dir="auto">It seems this is not true, because if the mail is in "junk" mailbox already, it seems to be action "Move out of Junk".</p>
</blockquote>

<p dir="auto">Yes, internally it's really used as a toggle. I've changed this now such that I use <code>toogleJunkMailbox:</code> internally and <code>moveToMailbox:</code> only moves to Junk.</p>

<blockquote>
<p dir="auto">Can this is clarified, specifically what interaction there is with SpamSieve?</p>
</blockquote>

<p dir="auto">First, when I was about to write the following I realized that there was a bug in MailMate since I didn't get the expected results when trying what I wrote. Turns out that when I recently implemented support for <code>UID MOVE</code> (an optional IMAP feature) as an alternative to <code>UID COPY/EXPUNGE</code> then I also broke the handling of certain types of flag changes. This can affect moving emails from/to the Junk mailbox. I recommend updating to the latest test version to avoid this bug.</p>

<p dir="auto">Ok, I'll try to make a complete description. It's pretty simple:</p>

<ul>
<li>Moving an email to Junk automatically marks it as <code>$Junk</code> (IMAP keyword).</li>
<li>Moving an email out of Junk automatically marks it as <code>$NotJunk</code> (IMAP keyword) except if the destination is another junk folder or the trash folder.</li>
<li>Marking an email as <code>$Junk</code> automatically unmarks it as (<code>$NotJunk, NotJunk, $NonJunk, NonJunk</code>). It also tells SpamSieve that it's a bad message.</li>
<li>Marking an email as <code>$NotJunk</code> automatically unmarks it as (<code>$Junk, Junk</code>). It also tells SpamSieve that it's a good message.</li>
</ul>

<p dir="auto">The last two items are also what happens when using the “Message ▸ Junk State” menu items.</p>

<p dir="auto">The extra IMAP keyword-variants are because some email clients use different keywords and I think those should be cleared as well (MailMate never sets them).</p>

<p dir="auto">My implementations is based on <a href="http://www.ietf.org/mail-archive/web/morg/current/msg00441.html">this</a> which I don't think ever became an official standard, but for me it's the unofficial standard.</p>

<blockquote>
<p dir="auto">Or rather, I would like to know in more detail what the following functions do:</p>

<p dir="auto">moveToJunk:</p>
</blockquote>

<p dir="auto">As described above.</p>

<blockquote>
<p dir="auto">markAsJunk:</p>
</blockquote>

<p dir="auto">Sets the <code>$Junk</code> keyword as described above (including clearing other keywords).</p>

<blockquote>
<p dir="auto">markAsNotJunk:</p>
</blockquote>

<p dir="auto">Sets the <code>$NotJunk</code> keyword as described above (including clearing other keywords).</p>

<blockquote>
<p dir="auto">In the manual there is (for example) no text about interaction with SpamSieve although I understand that is going on "under the hood". And IF multiple things happens, what do "undo:" and "redo:" do? All of the actions or only the last in the list?</p>
</blockquote>

<p dir="auto">All of the actions I believe except the cleaning of alternative IMAP keywords. (But due to the bug mentioned this would often not work correctly.)</p>

<p dir="auto">I'll note that I should add something like the above to the manual.</p>

<p dir="auto">-- <br>
Benny</p>

</div>