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

Re: Pipe to Modify a Message



* David T-G <davidtg-muttusers@xxxxxxxxxxxxxxx> [2003-11-16 17:43 -0500]:
> ...and then Phil!Gregory said...
> % I'd like to have a macro that removes all spamassassin added things on an
> 
> What about setting $editor for such things?  Certainly worth a try.

I thought about that.  I could change $editor, but it modifies the message
by creating a new message in the folder and deleting the old one.  Doesn't
work well if I want to do further things to that message.  (If I'm in my
spam folder and flag something as ham, I want to put the de-spamassassined
message in my inbox.)

> It sounds a little familiar, even.  If you haven't checked the archives
> yet, you should.

I looked through them and didn't find anything that worked exactly as I
wanted, though I stole some ideas.  I ended up doing this:

macro index "H" "<enter-command>unset wait_key<enter><pipe-message>mutt_dotlock 
~/mail/inbox&&(formail -s spamassassin -d|tee -a ~/mail/inbox|sa-learn --ham 
--no-rebuild --mbox -;mutt_dotlock -u ~/mail/inbox)<enter><enter-command>set 
wait_key<enter><delete-message>" "(Re)classify a message as ham"

Kind of ugly, but it does everything I want, complete with mailbox locking
('cause I'm paranoid).  Would be nice if I could use an expando or
something to use $inbox instead of hardcoding it, but my experiments along
those lines all failed.

-- 
...computer contrarian of the first order... / http://aperiodic.net/phil/
PGP: 026A27F2  print: D200 5BDB FC4B B24A 9248  9F7A 4322 2D22 026A 27F2
--- --
Rule: It is a mistake to use the manufacturer's special call instruction.
                       -- Ken Thompson
---- --- --