[MlMt] moveToJunk?

Benny Kjær Nielsen mailinglist at freron.com
Thu Jan 21 10:56:34 EST 2016


On 19 Jan 2016, at 11:15, Patrik Fältström wrote:

> The moveToJunk is described like this:
>
> moveToJunk:	-	Shorthand for ( 'moveToMailbox:', 'junk' )
>
> It seems this is not true, because if the mail is in "junk" mailbox 
> already, it seems to be action "Move out of Junk".

Yes, internally it's really used as a toggle. I've changed this now such 
that I use `toogleJunkMailbox:` internally and `moveToMailbox:` only 
moves to Junk.

> Can this is clarified, specifically what interaction there is with 
> SpamSieve?

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 
`UID MOVE` (an optional IMAP feature) as an alternative to `UID 
COPY/EXPUNGE` 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.

Ok, I'll try to make a complete description. It's pretty simple:

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

The last two items are also what happens when using the “Message ▸ 
Junk State” menu items.

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).

My implementations is based on 
[this](http://www.ietf.org/mail-archive/web/morg/current/msg00441.html) 
which I don't think ever became an official standard, but for me it's 
the unofficial standard.

> Or rather, I would like to know in more detail what the following 
> functions do:
>
> moveToJunk:

As described above.

> markAsJunk:

Sets the `$Junk` keyword as described above (including clearing other 
keywords).

> markAsNotJunk:

Sets the `$NotJunk` keyword as described above (including clearing other 
keywords).

> 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?

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.)

I'll note that I should add something like the above to the manual.

-- 
Benny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20160121/0155cd39/attachment.html>


More information about the mailmate mailing list