procmail
[Top] [All Lists]

Re: The results of the help I got here.

1999-08-18 09:17:35

Just two minor points...

era eriksson <era(_at_)iki(_dot_)fi> writes:
So, you could of course pass in the headers as well and let the script
figure this out for itself. The main thing you have to look out for is
continued header fields. Something like this:

   while (<>)
   {
       last if /^$/;  # end of headers, move to body processing

There should be a

         chomp($_);

at this point, as the trailing newline is not part of the value of
a header.


       if (/\^s/) # or maybe if s/^\s\s+/ /;
       {   # continued header field, glue this line onto the previous one
           $value{$header} .= $_;
           next;
       }

The condition should be:

        if (/^\s/)

The continuing whitespace is semantically part of the value.


       unless (m/^([-A-Za-z0-9_]+):/)
       {
           warn "Weird non-header $_";
           next;
       }

That would be:

        unless (/^([!-9;-~]+)[  ]*:/)


Philip Guenther