On Mon, 21 Mar 2011 at 09:19AM -0600, Aaron Toponce wrote:
> I've set "edit_headers=yes" in my ~/.muttrc so I can edit the headers
> with Vim, my preferred editor. I can select a new line, then from
> command mode, run "! hashcash -m resource -X -Z 2" to add the line to
> the header, as I've done with this message. Then, I can continue to
> compose my message, save, quit and send.
> 
> Rather than calling the external command manually, I would like to
> automate the process with a macro. So, the macro should be able to
> parse the "To:", "Cc:" and "Bcc:" lines, which would contain a
> comma-separated list of addresses, and run the hashcash command for
> each address, putting each result on its own line. I'm not sure how
> to handle Bcc: addresses, so we can ignore that for the time being.

One idea: write a script (shell, Python, etc) that parses the temp file,
adds the hashcash stuff, and then spawns vim. Then in Mutt, you set your
editor to be that script:

       set editor = my_hashcash_script

The nice thing about that is you can write it using whatever you like,
instead of Vim's scripting language, and perhaps use email parsing
libraries and so on.

Oh, and I love your .signature!

Dan

--
---  Dan Drake
-----  http://mathsci.kaist.ac.kr/~drake
-------

Attachment: signature.asc
Description: Digital signature

Reply via email to