procmail
[Top] [All Lists]

Re: question about .procmailrc 'file server' feature

2000-12-13 12:32:01
bigler(_at_)ens2m(_dot_)fr wrote:
 :0 fhw                   # reverse mailheader and extract name
 * ^Subject: send.*file  *\/[^ ]*
 | formail -rA "X-Loop: bigler(_at_)ens2m(_dot_)fr
                                         ^--Need " to close the quote
This is probably causing the unexpected EOL.

...
My question is : things work fine and I could be happy there, however
in the 'from' procmail log file I get the following message :
'procmail: Unexpected EOL'

procmail: Unexpected EOL
Subject: Re: send file test
Folder:  (cat - > $MAILDIR/tmp 2>&1 ; touch $MAILDIR/log ; cat $MAILD     188

The action is correctly done, however without my implementation of a
log file, I lose in the 'from' file the information from where the
mail comes.

Est-ce que vous pouvez ecrire this information in the procmail log?
If so, here is one way to do it...

 FILE="$MATCH"            # the requested filename
 SHELL=/bin/sh
   

   # added the following line to write info in your logfile:

   LOG=`formail -rzxTo:`" requested file $FILE
"

   # added local lockfile on the following line -- otherwise it may be
   #  executed concurrently:
   :0 ah: tmp.lock
 | (cat - > $MAILDIR/tmp 2>&1 ; touch $MAILDIR/log ; cat $MAILDIR/tmp >> 
$MAILDIR/log 2>&1 ; cat $MAILDIR/tmp  ./$FILE 2>&1) | $SENDMAIL -oi -t

I inserted the "LOCKFILE" line because you need protection 

can anybody tell me where is the faulty line in the above code ? or

[[ see above ]]

how can I debug this ?

To debug such things in the future you can insert lines like

    LOG="about to execute suspicious sequence
"
    # code you suspect has the error

    LOG="is the error message above this line?
"

which will help you determine whether the error/warning message refers 
to the "code you suspect has the error"

hth
-- 
Neither I nor my employer will accept any liability for any problems
or consequential loss caused by relying on this information.  Sorry.
Collin Park                         Not a statement of my employer.
_______________________________________________
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>