procmail
[Top] [All Lists]

Re: formail flags problem in pm recipe - solved!

2001-06-16 11:23:18
Louis LeBlanc wrote,

| Ok, I think I got it this time!

| :0 Bfh
| * H ?? !^Lines:
| *  1^1 ^.*$
| | /usr/bin/formail -f -A "Lines: $="
| 
| The key was the -f flag in the formail call.
| 
| The -f flag tells formail to just pass the message through
| without changing the mailbox format.  This is what deliver is
| expecting.

Right.  Without -f, formail will make sure that the message is in suitable
condition for appending to an mbox: that it will start with a postmark line
and end with a blank line.

| I was getting the wrong number of lines once I got these flags right,
| but I finally figured that out too.  I just removed the second line:
| * -1^0
| I don't know what it was intended to do, but it made the score at the
| end short by 1.  So I would get a message with a header saying the
| message had 56 lines, but mutt would read it and say there were 57.

It was intended to reduce the score by 1!  It corrects for the case with
messages that do end in blank lines, where "1^1 ^.*$" counts one too many. 
So if in your format you don't get one too many, subtracting one regardless
will give you one too few.

Maybe this will handle both cases:

 :0Bfh
 * H ?? ! ^Lines:
 * 1^1 ^.*$
 * -1^0 ($)($)^^
 | formail -f -A "Lines: $="

| I think this is because there is a trailing newline at the end of the
| message for some reason.

More likely it's that there isn't a trailing blank line on the message body,
perhaps no closing newline on the last line at all.

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