In the spirit of the Open Source movement, I feel compelled to share the solution with everyone here.
1. To set the folder hooks for specific action when in my 'case update' folder. #<Issu_Updates> folder-hook '.*Issu_Updates.*' 'set pgp_autosign=no' folder-hook '.*Issu_Updates.*' 'set signature=~/.issusig' folder-hook '.*Issu_Updates.*' 'set edit_headers=yes' folder-hook '.*Issu_Updates.*' 'set editor=/users/stharms/bin/issu_update_wrapper.pl' #</Issu_Updates> A. Turn of PGP B. Get my scaled down signature with more relevant contact information C. Turn on Edit Headers E. Set editor to the wrapper. OK, so I reply to something in this folder and it execs $editor: Here's the script (if any perl diety wants to reduce this to an absurdly silly one liner I'd love seeing it): #!/usr/local/bin/perl $file=$ARGV[0]; open (IN,$file); open (OUT,">/tmp/foo"); #Get the value of the user's id out of the input file while (<IN>){ chomp; if (/Subject:/){ s#.*for ##;s# has.*##; $userid=$_; close IN }#end if }#end while #replace the cc: line to cc:user open (IN,$file); while (<IN>){ chomp; if (/Cc/){ $_ .= $userid } unless (/^X-/){ unless (/^\[[TI]/){ print OUT "$_\n"; } } } #Move the temp outfile to the input file system("mv /tmp/foo $file"); #Run the most superior editor thereupon. Skip down 8 lines so that #I start on a starting line and not on 0 where all the header data is. exec ("emacs -nw +8 $file "); ---- Lastly, I had to set something so that if NOT in this folder set it back to defaults: #<Standard> folder-hook !'.*Issu_Updates.*' 'set edit_headers=no' folder-hook !'.*Issu_Updates.*' 'set editor=/usr/bin/emacs\ -nw' folder-hook !'.*Issu_Updates.*' 'set pgp_autosign=yes' #</Standard> So that's the solve. Any perly tips are all good. Steven On Tue, Nov 13, 2001 at 11:03:10AM -0800, Steven G. Harms wrote: >I have a quick question as concerns writing a send-hook to pull >out an email-address from the subject line and then dump >said address into the CC: field. > >--- > >Background: >I use a case tool which sucks (to put it mildly)i I receive updates >from this tool in the format that the sender is the case tool >itself and the subject line contains "case #xxx for USER has been updated" > >--- > >I would like to be able to reply to these messages and have the >reply go to the user. Currently, the mail bounces back into >the daemon and is logged - but does does not get this information >to the submittor. > >So if i could force CC the person AND the daemon, I could update >the case and get the mail to the person in question. Good thinking >eh? > > >So i should be able to set a send hook that "when replying to >case tool daemon" .... > >But what to have it do? > >Ideally it would be nice to pipe the subject line to awk, get the >fourth column (the user's email address) and then set that current >message's CC value to "USERNAME". > >Any ideas on how to do this? > >Steven > > -- Steven G. Harms [my opinions are my own, not my employer's] Some mail readers may interpret this messag as having an 'attachment' this is actually my cryptographic signature. Protect your privacy by using cryptography. You can get my public encryption key at: http://pgp.dtype.org:11371/pks/lookup?op=get&search=0xE84048BF