Peter, the only criticism I have of this method is that it requires the person sending the X-Command to know in advance that it's going to be wrapped, and to put the magic "_END" at the end of this. This was not my situation; the X-Commands just suddenly stopped working (for only long email addresses, we discovered later) and no one knew why. I prefer a solution which says: "X-Commands, if they appear in the body of a message, must be the first line, and must be followed by a blank line before the rest of the body of the message, or be the only thing in the message. If there's more than one X-Command in the body, they must not be separated by a blank line." I think that this would work more intuitively and naturally. It should also work for automatic word wrapping which occurs without the author's knowledge or consent. Unfortunately, I don't know how to write the perl code for this. Sorry. Thank you for your efforts to update the FAQ. I've found it very valuable. -Kevin Zembower
Peter Hartzler <pete@hartzler.net> 07/18/02 07:59PM >>> Hmm...
I'm interested in updating the FAQ, but the code seems to be a bit crazy yet. (Ironically, the word-wrapping doesn't help. ;-) Now, I could be way off on this one, so don't go jumping up to place this into production; there are some dark corners to this stuff that I'm sure I don't know about! If the goal here is to pick out and unwrap text from a message and inject that text as a header using perl, then I'm thinking this might be saner: --- cut here --- # Allow embedding a single X-Command on multiple lines # within the body of an email. (Lines will be joined.) # Look for FIRST magic X_CMD: token. If found, # take from there to __END and add to message header. # Like this: X_CMD: X-Command: blah blah blah __END # (X-Command: blah blah blah..) can be across multiple lines... # Note that this is kind of expensive, but X-Commands should # be somewhat rare. :0 Bw * X_CMD: * __END { XCMD=`perl -p -0077 -e \ 's/[\n\r\s]+/ /sg; \ s/^.*?X_CMD:\s*(.*?)\s*__END.*/$1/;'` :0 f |formail -i "$XCMD" } # End of recipe --- cut here --- Please let me know if I'm out to lunch on this one. Check out the SmartList FAQ at http://www.hartzler.net/smartlist/ Regards, Pete. _______________________________________________ Smartlist mailing list Smartlist@lists.RWTH-Aachen.DE http://MailMan.RWTH-Aachen.DE/mailman/listinfo/smartlist