procmail
[Top] [All Lists]

Re: Procmaillog and LOG variable

2003-03-04 20:01:06
At 17:40 2003-03-04 -0800, John Rudd wrote:
>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

You won't get it AFTER the summary, unless you do trickery such as use a 'c' flag on the delivery, then emit the log item, then discard the extra copy. IOW, ugliness.

I've often thought it would be nice to have logging options for post-delivery and on_error, as well as just queueing the log elements to a buffer so they're emitted in one series, without interleaving with other message logging.

Here's what I'm doing:
LOG=`/usr/local/bin/formail -XX-Spam-Level -s cat`

And this WORKS?

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.

Those of us who have used procmail for very long, simply define a variable:

NL="
"

which, by the nature of it's definition, is a NewLine. Makes adding newlines much easier.


:0h
SPAMLEVEL=|formail -X X-Spam-Level

# set your path accordingly, no need to longhand the formail path...
LOG="${SPAMLEVEL}${NL}"

that what I want to do isn't exactly how procmail intended the LOG
variable to be used.

Yea, I kind of doubt it is intended to be used with shell invocations, but if what you posted actually has been working for you, it must be.

Am I right that this is what I'm going to have to do, or is there a way
to make it do what I actually want?

You'll need to be clearer about what you actually want. You can match against the extracted header field to extract a specific part of the field as desired.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


_______________________________________________
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>