-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On Friday, August 7 at 08:09 PM, quoth Erik Christiansen: > On Thu, Aug 06, 2009 at 01:14:04PM -0500, Kyle Wheeler wrote: >> On Friday, August 7 at 01:52 AM, quoth Erik Christiansen: >> Consider if you were instead changing the Subject header. For example: >> >> send-hook '~C [email protected]' 'my_hdr Subject: [dudemail]' > > Munging that a bit, I seem to be able to achieve the desired "Reply-To:" > result, after removing all the folder-hooks which had been setting > it to be a list reply.
Hmmm. I think there must be a misunderstanding between us somewhere here. If you're happy, that's great, and nevermind the rest. But unless I misunderstand how mutt works, this: > Defaulting to a reply to self, each list can then instead be covered > with e.g.: > > send-hook '~C [email protected]' 'my_hdr Reply-To: [email protected]' ...should only work for the *second* message sent to [email protected]. The reason is because my_hdr doesn't modify a message that's already been built, but instead merely modifies mutt's internal message template. Thus, if my_hdr is called after mutt builds a message (i.e. at a point where ~C has something to match against), it won't affect that message. But having modified the internal template, WILL affect the next message, no matter who it is sent to. >> Ostensibly, the idea behind that hook is to provide a template >> subject-line for all mail sent to [email protected]; but if >> send-hooks are only triggered AFTER the message is composed, that's >> basically useless. At the same time, what if you add "dude" to the >> recipients WHILE you edit the email - if the hook is only triggered >> BEFORE the message is composed, that's basically useless too! > > That seems to be partly what send2-hook was intended to solve? However, > it didn't work for me, at least the way I tried to use it, Yes, send2-hook would be the way to go *IF* my_hdr affected the message currently being edited. But it doesn't, so send2-hook won't work. >> Three thoughts: >> >> 1. lots of people use folder-hooks to set headers like that. >> Personally, I dislike this idea, because I want mutt to >> recognize list messages no matter where they happen to be >> stored (otherwise, what's the point of the ~l matcher?). But >> you could use it for this Reply-To purpose. > > Thanks to procmail, list messages can be in any of only one places here, > so I had been using folder-hooks. It was just undoing the "Reply-To:" > setting on a non-list message which gave problems. > > In the case of "Reply-To:", it finally dawned on me that it's easier to > match one List-Post address than a large set of non-list addresses. > Turning off my folder-hooks was then the biggest step forward. The way this is usually done is something like this: ## First, set the default: folder-hook . 'my_hdr Reply-To: [email protected]' ## Or, an alternative default: # folder-hook . 'unmy_hdr Reply-To' ## Now, set the header when I enter a list mailbox: folder-hook =Listbox 'my_hdr Reply-To: [email protected]' Note that the ORDER OF HOOKS is important, because mutt triggers them in the order they're found. Thus, when entering a non-list mailbox, no matter what it is, it will match the first ("default") hook, and will get the [email protected] header. The non-list mailbox won't match the second hook, so the previous header will remain. Upon entering "Listbox", however, the first hook will match again, and will reset the Reply-To header, but immediately after that, the second hook will match, and will change that header to [email protected]. Moving to another mailbox will, again, trigger the first hook, which will reset the Reply-To header, but won't trigger the second hook. If you need to add additional mailing list mailboxes, add those hooks AFTER the default hook. Does that make sense? >> 2. You could also use a message-hook, that triggers when you >> display the message, like this: >> >> message-hook '~C list' 'my_hdr Reply-to: foo' >> >> That is a little hack-like too, because it doesn't work from >> the index, but combine this with a folder hook (for the index), >> and you may be in business. > > IIUC, this would add the header to the stored copy of the received > message. No, that's not what my_hdr does. It cannot affect existing messages. > However, I had successfully been setting "Reply-To:" by > folder-hooks. It was the attempt to negate that on composing a > message which was defeating me. Hopefully my explanation of folder-hooks above helps? ~Kyle - -- No man needs a vacation so much as the man who has just had one. -- Elbert Hubbard -----BEGIN PGP SIGNATURE----- Comment: Thank you for using encryption! iQIcBAEBCAAGBQJKfBw4AAoJECuveozR/AWeWLcQAJ9Wyzxqt36DK45s+Xhi0KqQ xHxNJT9kzrYaeXNk5UYlDk+hmaw75LjAuE6m8uTK1rsxXUS3A+NrbiosPGXmBpgl 5nsTc3d3L5Bjva43Be4BSFBQS1IL88Bb2SeGQEolc0xDnDjCApI1zHDXHEDi+pMm CQgijzPzb3D8DwWyQQ2cJME9fWbsG+6B0NRhZ+a5cniOZUY3RmTSnYRH4y3hiAu+ 8kamBVYWZc12zCsGY1jq0bVxUWgR8f4zMlSE7KRRgYLsTVoKRVdJNVZ3whWpfee0 NK7vPPGKFwtF2EOVocQ5pqIDZvlYzjaPkpNH0I5rsZuNsehnTQLD0BLETLpPauDa ylhxRk9hyx6WxF62MRUINRO+tKtLM2sv/hHuz1Ta7WD2AhIxKvvWe/9R7J3Bcdz/ D3QPZjSgiWJzsdgNKxe2N8db9lUFxK3VW7Z/r7OAn18wrCHS03HYRrxna/Hxj9y+ k7utBClOtnVvpclsx9e1jr2fjDVpAtE/HfHDb222ncr6dNtugTBv3Vv5CnjkN03C ztdkDlEpm47/fORb7BKRqJoB1Po++JxbWthBIBavLpvXR/Y087ZRoyLY2MqDrC5R sK0bDsfqWOJib1rm+4sh2QsanVcS92Rrmr4lRfDtKcjC/ApeoC5RZrf56X1AuBw8 10pX6OQZoMbSsjr025cA =XdCl -----END PGP SIGNATURE-----
