David, I thought I was on the right path with what you'd given me, regrettably, I've not found a way to make this work.
When using Mutt, I Use emacs as the editor and mutt then creates an ascii attachment from a file located in /tmp. I realized that I could use the 'F' option to filter this tmpfile through a perl script or something of that nature. Regrettably, it seems that mutt chooses NOT to touch the headers - even when edit_headers=yes. Here was my test. I created 'hm.pl' which looks like: #!/usr/local/bin/perl while (<STDIN>){ chomp; print "-->$_\n"; } With the ultimate goal of adding something like if (/Subject/){$user_to_cc=s/stuff//; $_="Cc:$user_to_cc\n";print;} So hm.pl was a preliminary test of manipulation. So here's a reply I passed through it: ------ To: David T-G <[EMAIL PROTECTED]> Cc: Bcc: Subject: Re: send-hook to parse entry out of subject line and dump into CC field? Reply-To: In-Reply-To: <[EMAIL PROTECTED]>; from davidtg-muttusers@justpickon\ e.org on Wed, Nov 14, 2001 at 01:58:41PM -0500 <snipped X-headers> X-Work-Focuses: Email Server Maint. & Routing, Cisco Linux -->Let's show David T-G what it looks like thru ./hm.pl --> -->On Wed, Nov 14, 2001 at 01:58:41PM -0500, David T-G wrote: -->>Steven -- -->> ------- As you can see, the filter operation worked ONLY on the non-header data. Possible solutions: 1. Find out the name of the /tmp/file (is it in a variable?) and then execute some | command to insert the appropriate cc line into the text. I don't think this will work though. If there's still the 'header' versus 'ascii attachment [i.e. content] bifurcation, having the ability to write to that text file isn't going to affect the headers. 2. Find a way to access the headers themselves? --------------------------------------------------------------------- BUT!!! I don't understand why this is. Even as I type this message to you, emacs tells me your message is "/tmp/mutt-stharms-lnx-20706-83". If i run cat on that in another X-term i see: From: "Steven G. Harms" <[EMAIL PROTECTED]> To: David T-G <[EMAIL PROTECTED]> Cc: Mutt Users' List <[EMAIL PROTECTED]> Bcc: The header info in there plain as day. I guess when you terminate the editor, mutt must move the 'header' content from the editor's temp file into the 'header' and then leave the body as the text attachment. This, of course, being the only thing operated upon by the 'F' option. Anyway, it appears I'm at an impasse. Anyone out there have any ideas? Steven On Wed, Nov 14, 2001 at 01:58:41PM -0500, David T-G wrote: >Steven -- > >...and then Steven G. Harms said... >% Regrettably not, i'm talking IMAP to my server.. > >Ah. That makes it a little trickier. > > >% >% Is it possible to to maybe pipe that to a little shell scrp that >% could parse the right field, and then pump that back INTO mutt >% in the CC field??? > >At this point I'd probably ensure that edit_headers is turned on so that >you get the whole shebang and use sed (or awk) to capture the subject >line and spit out a cc: line (you can just tack that onto the headers as >an additional line; mutt will handle it) and then dive into your editor >as usual. > >Hmmm... Actually, $editor will be handed the name of an existing file, >so you might want to do this in perl where you can write back to the >file easily. > > >% >% Anyone? > >Have fun :-) Post your results, too! > > >% >% steven > > >:-D >-- >David T-G * It's easier to fight for one's principles >(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie >(work) [EMAIL PROTECTED] >http://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! > -- [The first attachment to this email is a cryptographic signature. I protect my privacy by using GnuPG for Linux] || || Steven G. Harms :||: :||: [EMAIL PROTECTED] ::||:: ::||:: [EMAIL PROTECTED] .:::||:::. .:::||:::. (408)525-1767 ...::::::||::::::. . . . ..:::::||::::::... [[Cisco Systems: Empowering the Internet Generation]]
msg20476/pgp00000.pgp
Description: PGP signature