Re: folder-hook in my .muttrc doesn't work
- To: mutt-users@xxxxxxxx
- Subject: Re: folder-hook in my .muttrc doesn't work
- From: Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx>
- Date: Mon, 2 Jun 2008 15:10:22 -0500
- 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; s=default; bh=2VcAcH2AwxjLCdxLiw6y2ISHqEw=; b=Gcqi FzlrYEi7ln5YIn1LMhKmYnftjia/3XXSQ5xNXcp0+7cYGtTIuj/tVE3w2N7rnA9z oe49NDwcLqxCANP4TqR+jyGqxbQxekyklRA2PkZ/DFH37/E4erkivyPPKZVluj+j kA39Il3V7Cpb4PYmTtBJ0d56H9OvQFCXV3tnExw=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=memoryhole.net; b=X6cFT1qdjO8G61Pctqqh2CckM2QuM3Admn+VT2w2k2hJ5Rjy31e5zOOy+7oOcdjHNUCUX98jMpB8jgi+0O2bvCOvSEcV7c1DaQgSWcSdaFA4Gy26vySF0vDjX905tCaKEMKQeUfjtLonMRHAtPRq8gdEJhCiokIcPYHUxsiKzkU=; 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: <20080602193913.GA9910@teufel>
- 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: <20080602102905.GA8773@teufel> <20080602140613.GS78684@xxxxxxxxxxxxx> <20080602193913.GA9910@teufel>
- Sender: owner-mutt-users@xxxxxxxx
- User-agent: Mutt/1.5.18 (2008-05-22)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday, June 2 at 09:39 PM, quoth Rudolf Bahr:
>> On Monday, June 2 at 12:29 PM, quoth Rudolf Bahr:
>>> folder-hook +fanciulla/lisa 'set use_from=no'
>>> folder-hook +fanciulla/lisa 'unmy_hdr *'
>>> folder-hook +fanciulla/lisa 'my_hdr From:
>>> thats-me@xxxxxxxxxxxxx'
>> Those three should work fine.
> Sorry, they don't, in this case, at least. The From: address is
> still a combination of my username and PC's hostname.
Hmmm.... In that case, I'm not sure. Let's try something different to
see if this works (all one line, of course):
send-hook '~C lisa@xxxxxxxxxxxxx' 'my_hdr From:
thats-me@xxxxxxxxxxxxx'
>> folder-hook +fanciulla/lisa 'set record="=fanciulla/lisa"'
>
>
> Ok, I removed the folder-hooks which can't be preset by me and are
> indeed unnecessary. Instead I added as you suggested:
>
> folder-hook +fanciulla/lisa 'set record="=fanciulla/lisa"'
>
> But Mutt gives me still back: '=lisa@xxxxxxxxxxxxx' instead of
> '=fanciulla/lisa'.
Very interesting. That's not a typical mutt-default Fcc, so I suspect
you have other hooks in your configuration that are re-setting it...
particularly fcc-hooks or fcc-save-hooks.
>> *answer* email (r), as opposed to compose new email (m)? If you're
>> *replying* to email (r), then the recipient (To:) is set based on
>> the message you're replying to.
>>
>> What exactly are you trying to achieve?
>
> I'm entering the folder 'fanciulla/lisa' in order to answer a message
> there by 'r' or ',a'.
Well, I guess my point is... I generally prefer using send-hooks (or
reply-hooks) instead of folder-hooks for changing these sorts of
settings, because they allow me to have the message anywhere, and get
triggered for every message (thus, they over-rule folder-hooks).
Often, the only reason people choose to use folder-hooks is because
they haven't yet discovered send-hooks. On the other hand, some people
strongly associate a given folder with a given role, and associating
folder with sending address (for example) makes more sense in their
head.
I would have done something like this:
alias -group lisagroup lisa Lisa Lady <lisa@xxxxxxxxxxxxx>
set use_from=no
send-hook '%C lisagroup' 'my_hdr From: thats-me@xxxxxxxxxxxxx'
fcc-save-hook '%C lisagroup' +fanciulla/lisa
# Reply-To isn't usually useful
Note that the send-hook and fcc-save-hook trigger whenever I send a
message to lisa regardless of what folder I'm in. The $use_from
setting stays the same always, unless I add hooks to change it (in
which case it'll have to go into a hook as well). The use of a group
means I can later add addresses for lisa (e.g. 'group -group lisagroup
- -addr lisa@xxxxxxxxxxx') and not have to change my hooks.
Without the "group" bit, that would be rewritten as:
alias lisa Lisa Lady <lisa@xxxxxxxxxxxxx>
set use_from=no
send-hook '~C lisa@xxxxxxxxxxxxx' 'my_hdr From:
thats-me@xxxxxxxxxxxxx'
fcc-save-hook '~C lisa@xxxxxxxxxxxxx' +fanciulla/lisa
# Reply-To isn't usually useful
>> Keep in mind, these hooks are only triggered when you enter the
>> folder. If you have other hooks that override them (such as
>> send-hooks or reply-hooks or message-hooks), they will not be
>> re-triggered until you re-enter the folder.
>
> Yes, therefore I commented all other lines which have something to
> do with 'lisa' or '=fanciulla/lisa'. It seems to help nothing.
Depending on your configuration, you may have plenty of "default"
hooks that don't contain the text "lisa", but apply anyway. For
example the patterns "~A" and "." in send/reply/message/display-hooks
will match your emails... there may be lots more hooks being triggered
than you're aware of. I'd start by following the debug steps outlined
here: http://wiki.mutt.org/?DebugConfig
This is why I usually recommend that, once you start getting serious
about configuring your own mutt, you start your own muttrc from
scratch. It'll take some time to read the descriptions of all the
relevant settings, but it's *well* worth your time.
> Kyle, many thanks for your answer with the explanations!
Happy to help!
~Kyle
- --
If we knew what it was we were doing, it would not be called research,
would it?
-- Albert Einstein, 1941
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!
iEYEARECAAYFAkhEU64ACgkQBkIOoMqOI172lQCcDYXz+ht0y1WnmxgK4UYQQ2zb
KJUAoPlsoVLonvGYQ0Ifi5pXd4tBZTYR
=Z/PN
-----END PGP SIGNATURE-----