Broken pipe problem? If so, why?

From: malgosia askanas (ma_at_panix.com)
Date: 03/28/05


Date: 28 Mar 2005 10:11:39 -0500

I have a mail-handling program written in Perl. It gets passed a mail message,
reads the header, does some processing, and exits. The code for reading
the header is:

  $/ = ''; # paragraph mode
  $header = <>;

I am invoking this program in a pipe from procmail. For some messages (I
believe, for very large ones) I get the message "Error while writing to
<progname>" in the procmail log. I would be inclined to believe that it's
a broken pipe problem, but if so, why does its occurrence depend on the
message size? The program reads only the header for _all_ messages,
independent of size - yet in a vast majority of cases, procmail does not
complain. Can you advise?

Many thanks in advance,
-malgosia



Relevant Pages

  • Re: [procmail] [sed] [awk] cleaning up mail headers
    ... > I am trying to write a command line for procmail that takes the From: ... > header field from an email and cleans it up into just the email address. ... (I'm assuming here that you call fetchmail which then calls ... alias fetchmail like so: ...
    (comp.unix.admin)
  • Re: procmail recipe
    ... That bugged version was distributed with several major distributions of Linux and Unix OS's a couple of years ago, but has since been fixed in the later updates to procmail. ... The way that bug manifested itself is after the first use of a body or header flag in a procmailrc file, subsequent recipes will scan both the body and header of a message instead of just the body or the header because the flags were not being reset in the hard code after use. ... A workaround if you are running a buggy version is to use the line by line method for telling procmail to scan the body or the header of a message. ...
    (comp.mail.misc)
  • Re: Learning procmail
    ... # Filter Fedora List Messages ... and says if a mail header begins with a "TO" type header (To, cc, bcc, ... I'm not a procmail expert, so if I've gotten any explanation wrong, I'd ... so it doesn't get caught by the filter - allowing me to see it ...
    (Fedora)
  • Re: procmail/formail syntax question
    ... Please do *not* remove the mailing list from the Cc: header, ... there is a very good reason (i.e. confidential information in the ... procmail doesn't accept extended regexps (I think I remember finding out ... using plain regexps and not extended regexps and it ...
    (freebsd-questions)
  • Re: procmail to forward to multiple users
    ... unless you know for a fact that the mail is from a daemon and will never have a Cc: header, otherwise this particular style of replace the To: header and send on will also re-send a copy to any addresses in a Cc: ... # Define a newline character for use in procmail LOG entries ... # expanded before being evaluated as a procmail regular expression. ... That was more long winded than I really wanted to get, but I hope it helps with understanding some of the issues at least with forwarding messages to systems that are external to your own. ...
    (comp.mail.misc)