procmail
[Top] [All Lists]

Re: Efficiency and logging multiple lines

2002-07-22 08:01:36
On Mon, 22 Jul 2002, Mark Bynum wrote:

Hi,

I'm trying to make my procmailrc more efficient by changing the
3 times I can formail down to 1 time. I use formail to grab

[...]

:0 c:maillog.lock
| echo $FROM "^M" $SUBJECT "^M" $SPAM "^M" "------" \
        >> $HOME/.procmail/maillog

But I can't seem to get the linefeeds or carriage returns to work right.
I believe my echo (FreeBSD) doesn't like the ^M (that's an embedded
carriage return) or even /n that some
shells do (I set SHELL=/bin/sh). Here is what I get in my maillog:

From: Mark Bynum <mark(_at_)mjbynum(_dot_)org>^MSubject: 
Testing^MX-Spam-Status: No, hits=-
99.1 required=5.0 tests=FROM_AND_TO_SAME,USER_IN_WHITELIST 
version=2.20^M------
Is there an easier, more efficient way to do this?


        One way is using printf(1) instead of echo:

| printf "%s\n%s\n%s\n------\n" $FROM $SUBJECT $SPAM


        Did you try the old trick? (i did not):

MM="
"
| echo $FROM $MM $SUBJECT $MM $SPAM $MM "------"


Bye,
 Udi

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