[MlMt] Junk and Not Junk

Bill Cole mmlist-20120120 at billmail.scconsult.com
Thu May 6 13:22:53 EDT 2021

On 2021-05-06 at 12:36:31 UTC-0400 (Thu, 06 May 2021 17:36:31 +0100)
Martin S Taylor <mailmate at lists.freron.com>
is rumored to have said:

> Well it *is* on my mail server, obviously. But isn't 'Junk' and 'Not 
> Junk' just two sides of the same flag?

Nope. Related but independent flags, generally. See 

> How can both be ticked at the same time?

There can be multiple entities (server-side filters, client-side 
filters, & user) that can in principle set the IMAP $Junk and/or 
$NotJunk flags and anything that sets one of them SHOULD make sure the 
other is unset. Also of note: no one SHOULD send spam and no spam filter 
SHOULD ever misjudge the spamminess of a message...

In other words: you probably have 2 different things capable of marking 
messages as Junk or NotJunk, and they disagreed. Whichever tool acted 
last arguably is a broken implementation because it should either treat 
the prior determination (by something/someone else) as dispositive and 
not set a conflicting flag OR consider itself authoritative (i.e. if you 
tell MM or another client to mark a message "Not Junk") and clear the 
conflicting flag OR consider the conflict to be a sign of uncertainty 
and clear both. The registered definitions of the flags (see above) 
states that mail with "$Junk AND $NotJunk" set should be treated as 
having neither flag set. Conceptually,

Note that some IMAP-like mail systems (e.g. GMail) partially conflate 
flags and mailboxes, confusing the issue further.

Bill Cole
bill at scconsult.com or billcole at apache.org
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Not Currently Available For Hire

More information about the mailmate mailing list