Okay now this is very strange... set from="Name <[email protected]>" alternates "[email protected]" set reverse_name=yes send-hook '~f [email protected]' 'my_hdr Cc: [email protected]'
1. start mutt 2. hit "r" to reply to an email that has been sent to "[email protected]" 3. edit message, save, exit editor 4. "reverse_name" worked "From: [email protected]" is set but "Cc:" is empty 5. hit "q" and do not send message 6. hit "r" on the very same message as before 7. edit message, save, exit editor 8. "reverse_name" worked "From: [email protected]" is set and "my_hdr" worked! "Cc: [email protected]" 9. hit "r" or "g" on any further messages and all messages get the "my_hdr" change. No really I have tested this 20 times now, hit reply once and it wont work. Hit reply on the same message again and for all further messages mutt starts to use the "send-hook". It's like you have to kick mutt into action first. Strange?! You only have to do this double reply once and all further replies appear to use the "send-hook" correctly. BUT this setup will not work... set from="Name <[email protected]>" alternates "[email protected]" set reverse_name=yes send-hook '~f [email protected]' 'my_hdr Cc: [email protected]' If you set the "my_hdr" to set the "Cc:" to the same address as your "From:" it will NOT accept the change no matter how many times you try, "Cc:" will always be empty. I have tested this many times now and can replicate it. Every string but what is exactly the same as your "From:" is allowed. Strange but true. The reason for me wanting to do this is that I work with another colleague and all emails sent to "[email protected]" get sent to both of us. What I wanted to happen is that though my primary address is "[email protected]"; when emails get sent to "[email protected]" and I reply, I want "reverse_name" to correctly change my "From: [email protected]" but also set "Cc: [email protected]" so that my colleague can see my reply. This is working 90%, though like I showed you have to kick start mutt to use the "send-hook". Is there something that I can set to allow an email to have the same address in "From:" and "Cc:" is this actually something mutt disallows somehow to avoid loops? Hopefully this email makes sense, I have tried to be as clear as possible with the test replication. 'Mash On 2010-04-15 08:40-0700, Michael Elkins wrote: > Hi Mash, > > On Thu, Apr 15, 2010 at 04:12:04PM +0100, 'Mash wrote: >> I have "reverse_name" turned on and was wondering if it is possible to set a >> reply-hook to set the "Cc:" depending on which address I am replying from? >> >> reply-hook '~f exam...@domain\.com' 'my_hdr Cc: someth...@domain\.com' > > Unfortunately this is not possible. Mutt processes the my_hdr commands > that contain email recipients in them prior to evaluating > send-hook/reply-hook, so the my_hdr command won't have any effect on the > message you are currently sending. The reason for processing those > headers first is so the user can match on them in the hooks. This is > something we need to spend some time figuring out a solution to, since it > comes up occasionally. It's sort of a chicken-and-egg type problem. > > me
