Created
October 10, 2013 22:04
-
-
Save AlexandreRio/6926374 to your computer and use it in GitHub Desktop.
Bind a key in Mutt to add new rule for imapfilter from email sender
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
read "$@" <&0; | |
grep From: | | |
sed 's/>//g' | | |
cut -d '<' -f 2 >> ~/.mail_config/filters/spamer.list 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fh,err = io.open("spammer.list") | |
if err then print("OOps"); return; end | |
while true do | |
line = fh:read() | |
if line == nil then break end | |
msgs = EECS.INBOX:contain_from(line) | |
msgs:move_messages(EECS['INBOX.Trash']) | |
end | |
fh:close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro index S "|~/.mail_config/filters/addSpam.sh\n" 'add sender to spammer list' | |
macro pager S "|~/.mail_config/filters/addSpam.sh\n" 'add sender to spammer list' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment