[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mutt



On Sat, Jun 12, 2004 at 09:05:11PM +0200, László 'GCS' Böszörményi wrote:
> Hi,
> 
>  I am looking for a command line based program, which can grep the email
> address/domain from the 'From:' field of a mail message; and based on the
> invokation it can write the address into separate files like
> whitelist/greylist/blacklist. I would like to filter based on that file, so
> it should have one address per line format.
> Anyone knows one?

In ~/.muttrc:

macro index Y "| grep '\^From:' | sed -e 's/^.*\<\\(.*\\@.*\\)>.*$/\\1/' >> ~/addresses"

should append the From: address to the file ~/addresses when hitting 'Y' in
the index view. But _only_ if the address is surrounded by angle brackets.

Regards
Matthias



Reply to: