procmail
[Top] [All Lists]

Re: Procmaillog and LOG variable

2003-03-04 19:27:47
On  4 Mar, John Rudd wrote:
| 
| 
| I'm trying to add a line to the procmail log which indicates what the
| spam assassin score of the message was (since a few of the rules
| redirect based upon the score, and I want to have a simple place for
| gathering that information together).
| 
| What I had hoped for was to have something that looked like this:
| 
| 
| >From dona625gviu(_at_)yahoo(_dot_)com Tue Mar  4 17:17:55 2003
|  Subject: Regarding your
| Medications                                           
|   Folder: /home/user/IMAP/Spam/Maybe-Spam                     6446
|  X-Spam-Level: ssssssssssssssss
| 
| 
| Instead, I get this:
| 
| X-Spam-Level: ssssssssssssssssFrom dona625gviu(_at_)yahoo(_dot_)com Tue Mar  4
| 17:17:55 2003
|  Subject: Regarding your
| Medications                                           
|   Folder: /home/user/IMAP/Spam/Maybe-Spam                     6446
| 
| 
| 
| Here's what I'm doing:
| LOG=`/usr/local/bin/formail -XX-Spam-Level -s cat`
| LOG="\n"
| 
| 
| I have tried using echo's, \n's, having the second "LOG" be empty, and
| several other things (wrapping the formail call inside an echo call). 
| _nothing_ is working.
| 
| Based upon some of the tips and how-to's for procmail, I am guessing
| that what I want to do isn't exactly how procmail intended the LOG
| variable to be used.  [...]

No, that's what LOG is intended to do; but it doesn't automatically add
a newline character (as you know) and doesn't grok \n.  Also, that's not
the intended use for formail -s. Instead of LOG="\n", do:

LOG="
"

Many people do something like:

NL="
"

and then each succeeding LOG statement looks like: LOG="some text$NL".
You could accomplish what you want with:

LOG="`formail -XX-Spam-Level`$NL"

-- 
Email address in From: header is valid  * but only for a couple of days *
This is my reluctant response to spammers' unrelenting address harvesting



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>