procmail
[Top] [All Lists]

Re: Procmail error when writing to a pipe

2003-07-17 17:04:10
Having joined the list only yesterday I didn't have a chance to reply
to this message:

On Tue Jul 1 19:17:28 CEST 2003 Jeffrey Parker jwp at xnet.com wrote:

Hello,

       I am getting an occasional error from procmail when sending to 
a pipe:

procmail: Error while writing to " ( formail -r -I "From:
<MAILER-DAEMON at domain.com>" ; echo "Your message to
${LOGNAME}(_at_)domain(_dot_)com was rejected due to the user exceeding its
mailbox quota" ) | /usr/sbin/sendmail -t -oi"

We are using procmail to check for mailboxes that are already bigger
than a certain size.  Procmail checks the size and if mailbox is too 
big, sends a reject message to sender.  90% of the time, it works
fine, but occasionally I get this message.  Oddly enough, when this
happens the mail gets delivered anyway AND the sender gets this 
reject message.


This runs on machines that are quite busy ISP mail servers.

The compare decision is made with this recipe:

QUOTA=15000000
INBOXSIZE=`ls -l ${ORGMAIL} 2>/dev/null | awk '{print $5}'`

:0
* $ ${INBOXSIZE}^0
* $ -${QUOTA}^0
| ( /usr/local/bin/formail -r "echo as above" ) | /usr/lib/sendmail -t -oi


Any thoughts would be appreciated.

I've come across the same problem. It has something to do with the
size of the message piped by procmail to formail.

As an experiment I've been running '<example procmail -m procmailrc'
with this procmailrc:

VERBOSE=yes
LOGABSTRACT=all

# pipe 
:0
| formail -r > addr

:0
/dev/null

For 'example' of sizes up to 8192 it works. On stdout I get:


procmail: [1785] Fri Jul 18 08:56:11 2003
procmail: Assigning "LOGABSTRACT=all"
procmail: Executing " formail -r > addr"
procmail: Assigning "LASTFOLDER= formail -r > addr"
procmail: Notified comsat: "dran@:./ formail -r > addr"
 Subject: See Your Credit History Instantly!
  Folder:  formail -r > addr                                               8193

For 'example' of sizes above 8192 (increased by appending a single
letter to 'example') it doesn't. On stdout I get:

procmail: [1788] Fri Jul 18 08:56:40 2003
procmail: Assigning "LOGABSTRACT=all"
procmail: Executing " formail -r > addr"
procmail: Error while writing to " formail -r > addr"
procmail: Assigning "LASTFOLDER= formail -r > addr"
procmail: Assigning "LASTFOLDER=/dev/null"
procmail: Opening "/dev/null"
procmail: Notified comsat: "dran(_at_)0:/dev/null"
 Subject: See Your Credit History Instantly!
  Folder: /dev/null                                                        8193

In both cases 'formail -r > addr' is executed alright. An additional
strange thing is what procmail reports as the size of 'example', 8193
for actual sizes 8192 and 8193.

If the pipe is to something other than formail, it seems to work for 
'example' of any size.

The system is RH7.2, procmail-3.21-1.src.rpm on P400 with 256M.

Hope someone knows a fix to that.

Jack

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail