Re: Setting 'from' in send-hook
- To: mutt-users@xxxxxxxx
- Subject: Re: Setting 'from' in send-hook
- From: Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx>
- Date: Fri, 29 Feb 2008 09:56:43 -0600
- Comment: DomainKeys? See http://domainkeys.sourceforge.net/
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=memoryhole.net; h=date: from:to:subject:message-id:references:mime-version:content-type: in-reply-to; q=dns/txt; s=default; bh=Fbf+ZXKFaMDAw8THX8B4DGZfyw E=; b=XR1rTl7DlnRrjxQuVtNfZKrSuwcxgIlACVvKLC89VzsymgJ/eyxPLD2e1U /uSrTEYtSjH1IgnOntue66uROxTaCoH6GbY7goKPTT/7WJr8Jdt1ZqjDeoHx25/b Rq2dc3hPS4bKBXcYkO1UOWtE3knNgKC8Kw+X1O6nRMwF2VFQk=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=memoryhole.net; b=ZMCleXJ4YVIv7BonuZ36GeyMQwe1X8MiC7fyfqHq1lrxbsn3boxqPSmpcmjDQUY3HsokVfStSM42UA2M5Fe+VYZ4fJagcewDVqOOsy8AxRxiUQj+TRcW7i1uktqkD9HhhvnXzX7Emrp4tUVer9ULgSutgqmOhBPW8V+QHvECWaM=; h=Received:Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:OpenPGP:User-Agent;
- In-reply-to: <20080229144957.GB30100@SamZwo>
- List-post: <mailto:mutt-users@mutt.org>
- List-unsubscribe: send mail to majordomo@mutt.org, body only "unsubscribe mutt-users"
- Mail-followup-to: mutt-users@xxxxxxxx
- Openpgp: id=CA8E235E; url=http://www.memoryhole.net/~kyle/kyle-pgp.asc; preference=signencrypt
- References: <20080229144957.GB30100@SamZwo>
- Sender: owner-mutt-users@xxxxxxxx
- User-agent: Mutt/1.5.17 (2008-01-14)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Friday, February 29 at 03:49 PM, quoth Nathan Huesken:
>I am changing my from in a send-hook. But if my .muttrc looks like
>this in example:
>
>set from="ls@xxxxxxxxxxxxxxx"
>
>send-hook . 'from=mutt@xxxxxxxxxxxxxxx"'
>
>The first message I write is send from ls@xxxxxxxxxxxxxxx, the second from
>mutt@xxxxxxxxxxxxxxxx
Because of the order in which mutt evaluates things. Keep in mind that
you can create a send-hook that matches on the From header (e.g.
send-hook '~f addr'). What that means is that mutt already used the
$from variable before it triggered your send-hook. And, since $from
is persistent, your setting stuck around to affect the next message.
If you want to change the From header in a send-hook, you need to use
my_hdr instead. Like so:
send-hook . 'unmy_hdr From'
send-hook foo 'my_hdr From: me@here'
send-hook bar 'my_hdr From: me@elsewhere'
~Kyle
- --
The whole problem with the world is that fools and fanatics are always
so certain of themselves, but wiser people so full of doubts.
-- Bertrand Russell
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!
iD8DBQFHyCs7BkIOoMqOI14RArzsAJ9+Icjj3S+aKwmddXB+SrAMmrt7RgCfTO21
ZB+nYKwn6zYv+i3lLOwI4zg=
=3PIF
-----END PGP SIGNATURE-----