<<< Date Index >>>     <<< Thread Index >>>

Re: Mutt marking read spam as unread before saving (bogofilter)



On 2006-04-07, Carthik Sharma <carthik@xxxxxxxxx> wrote:
> On 4/6/06, Carthik Sharma <carthik@xxxxxxxxx> wrote:
> > Fellow Mutt users :)
> >
> > I use some bogofilter macros to help re-categorize mail as spam or ham
> > when miscategorized.
> >
> > The problem is that the messages I open to read in, say my Inbox, and
> > then mark as spam with, Shift+S end up in the .spam mailbox as
> > expected, but marked as NEW. Is there a way I can prevent this from
> > happening. I include the macros below.
> >
> 
> Did I leave something out? Can I provide more info? Please ask if that
> is the case. Again, the problem is how to prevent Mutt from marking
> read messages as Unread before saving after refiltering through
> bogofilter.

My first thought is:  why do you care?  If the messages in .spam are 
spam, then presumably you won't be looking at them very often.  
Having them marked NEW could also be considered a feature, since it 
allows you to easily see which messages have been added to the .spam 
folder since you last opened it.

Anyway, the problem is that mutt keeps track of the status of each 
message in memory until the message is written to a folder.  At that  
time, mutt adds (or updates) the Status: header to the message.  
When mutt opens a folder, messages without a Status: header are 
considered NEW.

The messages that you pipe to bogofilter presumably were NEW and did 
not have Status: headers when you opened your Inbox.  Therefore, 
they don't have Status: headers when they are piped through 
bogofilter and to .spam, either.  I think the way to solve this is 
to put formail in the pipeline ahead of bogofilter and use formail 
to add an appropriate Status: header.

HTH,
Gary

-- 
Gary Johnson                               | Agilent Technologies
garyjohn@xxxxxxxxxxxxxxx                   | Wireless Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA