procmail
[Top] [All Lists]

Intermittant procmail error

2008-10-02 14:33:03
Hello,

I haven't posted to the list for years, but I've now hit a problem with 
procmail that I can't find a fix for. I've been plagued by this obscure 
problem with one of my procmail recipes for a long time and thought it 
might have something to do with the old software/OS it was running on 
(SuSE 9.0, procmail 3.15.1). I just moved the script over to a newer OS 
(CentOS 5.2, procmail 5.22) and experience the same problem there :-( I 
hope that someone on this list can finally help me find the problem.

The script takes a mail from a monitoring server (bigsister) as input and 
produces an output in the correct API format for an SMS provider and sends 
it to them. This has been working for years, I don't remember how long. 
However, after a while I recognized that I'm not getting all SMS that I 
should. Eventually I found out that on some of the mails an error happens 
and procmail "recovers" and sends the unprocessed mail body out.
I tried quite a few changes (for instance I first catted most of the body 
text from a template in, now I produce it in the recipe and fill it in a 
variable), but none of them really worked. Sooner or later the problem 
will hit. Sometimes it may affect only a single message and be ok with the 
next message, but it can also happen that all messages after the "first" 
produce this problem. Actually, during the last two years or so it's 
mostly been the way that once it stopped working it kept not working. 
There is one sure cure for the problem: if I reboot the machine (or in the 
case of the new host, reboot the virtual machine) the problem is gone and 
correct messages are getting sent out until the problem hits again, in two 
hours, two days, or three weeks ...

As I said, the recipe is working fine as long as this "hickup" doesn't 
happen. But I hope that I have some errors in it that might get triggered 
only sometimes or that I could do the same in a more efficient way, so 
that the error-prone procedure is skipped.

The problem happens on this line:
:0 fbw
    |echo "${SMSBODY}";echo "text:${SMS}"

The variables are created like this:

SMS=|echo "$PROBLEM $PROBLEMTIME $BODY"|tr -d "\n"|head -c 160
These variables are filled by two matches and several piped sed on the 
body of the incoming mail.

SMSBODY="api_id:nnnn${NL}user:nnnn${NL}password:nnnn${NL}to:nnnn${NL}
from:nnnn"
with
NL="
"
(= a newline)

I'm happy to post the whole recipe, but first wanted to ask if I should 
throw the whole recipe at you or if there's already something obviously 
wrong in these few bits.

The error that I see in the log is as following:
procmail: Executing "echo "${SMSBODY}";echo "text:${SMS}""
procmail: Error while writing to "echo "${SMSBODY}";echo "text:${SMS}""
procmail: Rescue of unfiltered data succeeded

Thanks!

Kai

-- 
Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com



____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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