After messing around with this for ages I thought I'd put it on the list for
- More a procmail how-to that a mhonarc how-to
- This has been dealt with in the list in other ways (I couldn't find
anything of use to me; I'm not a developer)
- Neater way is to edit source or use $field('to') in rc file
This describes how to include the To: field in the Subject: line in
<LITEMPLATE> when piping mail into an archive from QMail using procmail:
#(insert thes line for debug only)
#LOGFILE = /home/cyberbcc/pm.log
#LOGABSTRACT = "all"
#VERBOSE = "on"
SHELL = /bin/sh
#This pulls out the Date: field and removes the leading
#space, in case you need this for a Wilma script
DATEXNEW = `echo $DATEX | sed 's/^[ ]*//'`
#This pulls out the Delivered-To:, in case you need this for Wilma.
#The cut strips the @domain from the email address
DELTO = "$MATCH"
DELTONEW = `echo $DELTO | cut -d'@' -f1`
#This pulls out the To: field
#The 2nd Variable assignment
#turns "user(_at_)domain(_dot_)com" <user(_at_)domain(_dot_)com> into
TORCP = "$MATCH"
TORCPNEW = `echo $TORCP | cut -d'"' -f2`
#The clincher. This adds the To: field to the Subject: field
|sed -e "s/Subject:[ ]*/Subject: To: $TORCPNEW - /gi"
#This is local to my set up,
#but shows how to send some of the above variables to a wilma
#script containing a call to mhonarc
| /usr/local/bin/wilma.local.pl.cyberbcc $DELTONEW $DATEXNEW