On Sat, Apr 17, 2010 at 01:47:36PM -0400, Asif Iqbal wrote:
Our company policy is to forward the spam as an attachment to company abuse address.So, I am doing all the following 6 steps to do just that f <hit this in index to forward> To: <type the abuse address at this prompt> Subject: the long message <hit enter to accept as it is> Forward as attachment? <type yes> <type :wq exit vim editor>
It's not possible to make Mutt control your editor in this way.
<hit y to send it> Is it possible to bind all these steps to one key like for example `S' in index ?
I can think of two possible solutions:1) have Mutt save the message to a temporary file and then invoke itself to mail the file:
my_tf=/tmp/spam-message macro index S '\ <copy-message>$my_tf<enter>\ <shell-command>mutt -a $my_tf -- ab...@some.domain < /dev/null<enter>'2) temporarily change your $editor to /bin/true to bypass editing the file since you want to automate it
macro index S '<enter-command>my_abort_unmodified=$abort_unmodified;\ my_editor=$editor;\ my_mime_forward=$mime_forward;\ set editor=/bin/true abort_unmodified=false<enter> mime_forward=yes<enter>\ <forward-message>\ ab...@some.domain<enter>\ <enter>\ <send-message>\ <enter-command>set abort_unmodified=$my_abort_unmodified\ editor=$my_editor mime_forward=$my_mime_forward<enter>' Completely untested, but that's the idea at any rate. me
pgpTO38n4ErJP.pgp
Description: PGP signature