Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Mutt folder-hook's

Name: Anonymous 2006-05-31 22:38

I'm trying to set up mutt so that when I delete a message, it trains bogofilter to treat it as spam and when I undelete a message (or remove it from the trash) it trains bogofilter to treat the message as ham (or good mail).

I have applied a patch that allows me to select messages for deletion and then "delete" them into a trash folder. The patch is: http://cedricduval.free.fr/mutt/patches/index.html#trash. I really like it the way it is.

Now, I want to set up some macros that tell mutt "when I press 'd' and I'm not in the trash, train bogofilter to treat the message as spam and then mark the message for deletion". The advantage in marking the message for deletion rather than moving it immediately to the trash is that mutt doesn't have to write the mail folders each time I choose to delete a message, and I can easily undelete a message.

Anyway, here's the line in my muttrc that's tripping me up:

folder-hook =!trash macro index d "|bogofilter -s\n<delete>"

The way I understand this line is "When we're in a folder whose name does NOT match 'trash', pressing 'd' sends the message to 'bogofilter -s' and then marks the message for deletion".

However, bogofilter never seems to see the messages (a ~/.bogofilter/wordlist.db file isn't created).

Any ideas where I've screwed up?

Name: Anonymous 2006-06-01 1:03 (sage)

I think I've solved my problem:

Here are what I believe to be the relevant lines:

set trash="~/mail/trash"

folder-hook trash 'reset trash'

folder-hook !=trash 'macro index d "|bogofilter -s<Enter><delete>" "train non-trashed mail as spam when deleting it"'

folder-hook =trash 'macro index d "<delete>" "really delete mail when deleting from the trash"'


I still have lots of work to do, though :-)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List