On 12Feb2014 12:43, Peter Davis <[email protected]> wrote: > I'm thinking of implementing a feature which allows a given keystroke > to pipe a message to a perl script which, after a couple of prompts, > adds a rule to my procmailrc or blacklist file to remove all future > occurrences of such messages. The script would probably just ask me > what part of the message to filter on (sender, subject keywords, etc.) > and then add the rule(s). > > Has anyone already done this?
I do something slightly similar for common spam subjects. The mutt side is very simple; it moves the message into my "spool-spam-subj" mail folder: macro index,pager SS "<save-message>+spool-spam-subj<enter><next-undeleted>" "delete message as spam by subject" macro index,pager SF "<save-message>+spool-spam-from<enter><next-undeleted>" "delete message as spam by author" (Also, "SF" to from lines.) My mail filter program is monitoring that folder, and when a message arrives it pipes it through my "email-add-spam-subject" script: https://bitbucket.org/cameron_simpson/css/src/tip/bin-cs/email-add-spam-subject That reads the subject header and writes a new filter rule like this: =spam SPAM-SUBJ subject:/^get your pece of it pie NOW which is automatially seen by the same mailfiler program, which monitors its own rules files. So a new subject based spam filter rule is then added. It is not interactive, but goes partway to what you wanted. All the smarts happen outside mutt. > I use mutt on my local MH store, but also on an IMAP server. Any ideas > how to do this for IMAP? I thought many IMAP servers had some system for rules or scoring. "Sieve" maybe? I do not know how to interact with it. Cheers, -- Cameron Simpson <[email protected]> Shape without form, shade without colour, Paralysed force, gesture without motion; - T.S. Eliot, _The Hollow Men_
