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

Re: Changing Headers in the Compose screen



Re: David Yitzchak Cohen in <20040119053602.GP16674@xxxxxxx>
> > macro   compose   
> >     <f5> "my_hdr From: William O'Higgins <addy_I_want@xxxxxxxxxxx>"
> 
> Nope, that won't work.  When you're in the compose menu, Mutt has already
> created the message, so it's too late for a my_hdr to take effect.
> It'll only affect messages you compose after that.

Changing the From: header in the compose menu is easy:

macro compose <f5> "<edit-from><kill-line>William O'Higgins 
<addy_I_want@xxxxxxxxxxx><enter>"

If you want to change other headers beside those from the compose menu,
use David's solution.

> macro compose <f5> ":set editor='some_script'\n<edit-headers>:set editor='vi'"
> 
> ...and here's some_script:
> 
> #!/bin/sh
> file=$1
> (
>  echo "/From:/s/^.*\$/From: William O'Higgins <addy_I_want@xxxxxxxxxxx>/"
>  echo "/Reply-To:/s/^.*\$/Reply-To: William O'Higgins 
> <addy_I_want@xxxxxxxxxxx>/
> wq"
> ) | ed $file

Perl's -i switch is very handy for in-place editing.

Christoph
-- 
Christoph Berg <cb@xxxxxxxxxxxxxxxx>, http://www.df7cb.de/
Wohnheim D, 2405, Universität des Saarlandes, 0681/9657944

Attachment: signature.asc
Description: Digital signature