Jeremy This is how I did it:
set sendmail = "/home/eric/bin/get_subject_and_send.sh" $ cat /home/eric/bin/get_subject_and_send.sh #!/bin/bash cat /dev/stdin| tee >(SUBJECT=`formail -z -x Subject`;echo "^Subject:.*$SUBJECT">>/home/eric/serialised_subjects;echo perl -ni -e \"print if not /$SUBJECT/ \" /home/eric/serialised_subjects|at now +50 days | /usr/lib/sendmail -t -oem -oi -f eric.sm...@trustfood.org It passes my tests. Now I just need conditional define and undefine of the sendmail var. This is nice to use to white list mail in spam filtering. You might want to set a condition to only run the script when Subject: is longer than n chars. Eric Jeremy Kitchen wrote on Thu-08-Nov 12 7:55PM > On Thu, Nov 08, 2012 at 10:15:45AM +0100, Eric Smith wrote: > > Thanks Jeremy > > > > Task is to create a serialised list of Subject lines for mails posted to > > lists. > > > > Why? So that procmail can filter any incoming list mail by using > > `egrep -f' on this serialised Subject list and these (presumed) > > replies to my posting may then be dropped in my main inbox. > > > > I only want to extract the Subject lines mails to lists, > > so I will have send-hook rules for mail to these known lists. > > I would need to define this macro only for mails to these lists > > (and then define "y" back to send-message). > > > > (The script to which the headers are piped will also schedule an > > at job to strip the Subject line from the file in n days). > > > > I do something like this with postfix alwaysbcc and procmail, > > but would prefer something more specific and efficient. Best > > place to do it is at the time of send-message when the Subject > > line is definitive. > > are you using SMTP or sendmail to inject your mail? You could configure > mutt to use a different sendmail which is your custom processor which > also injects the message into the queue (probably by calling sendmail > directly) > > If you're using SMTP, you could switch to using sendmail with the above > mentioned wrapper and configure an external smtp client like ssmtp or > such. > > I may be missing something, but I poked through the docs and I'm just > not seeing really any other way to do it. > > If you find a solution, though, please let us know, I for one am > interested in your idea :) > > -Jeremy