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

FW: Getting aliases from Cc field



Thanks, and many thanks for the script. 

I use procmail but I haven't written scripts like this before, so that's very 
useful. 

Best, Chas

----------------------------------------
> Date: Sat, 4 Apr 2009 13:09:05 -0500
> From: kyle-mutt@xxxxxxxxxxxxxx
> To: mutt-users@xxxxxxxx
> Subject: Re: Getting aliases from Cc field
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Saturday, April 4 at 05:29 PM, quoth Charles Howard:
>>
>>Very funny, I don't think.
>>
>>So let me rephrase my question :
>>
>>Is there a way to take an address from the Cc field to an alias file,
>>similar to how one uses `a' for the From field ?
>
> Sure. Well, to my knowledge, mutt doesn't provide any built-in
> mechanism. The simplest way is to create a script that extracts the
> contents of the CC field, builds an alias line, and appends it to the
> alias file. For example, if you have dialog and procmail
> (specifically, procmail's tool formail) installed, here's a basic
> script (modify to taste):
>
> #!/bin/sh
> aliasfile=~/.aliases
> CCheader=$(formail -c -x CC)
> string="what alias should I use for $CCheader?"
> tmpfile=$(mktemp -t dialog.XXXXXX)
> dialog --inputbox "$string" 8 ${#string} 2>"$tmpfile"
> retval=$?
> if [ $retval == 0 ] ; then
> alias=$(cat $tmpfile)
> echo "alias $alias $CCheader">>"$aliasfile"
> fi
> rm -f $tmpfile
>
> ~Kyle
> - --
> There in America we are descended in blood and in spirit from
> revolutionist and rebel men and women who dare to dissent from
> accepted doctrine. As their heirs, may we never confuse honest dissent
> with disloyal subversion.
> -- Dwight D. Eisenhower
> -----BEGIN PGP SIGNATURE-----
> Comment: Thank you for using encryption!
>
> iEYEARECAAYFAknXokEACgkQBkIOoMqOI17MFwCgsiEt5Ootuklv10ZTVfB5FI0l
> wBQAni+dudKA8+75iOs0XQf78s8nVo3A
> =gCyX
> -----END PGP SIGNATURE-----

_________________________________________________________________
Share your photos with Windows Live Photos – Free.
http://clk.atdmt.com/UKM/go/134665338/direct/01/