procmail
[Top] [All Lists]

Re: The recipe didn't do what they said it would do....

1997-06-05 13:24:00
wwgrol(_at_)sparc01(_dot_)fw(_dot_)hac(_dot_)com (W. Wesley Groleau x4923) 
writes:
...
OK, the following is no longer my .procmailrc  :-)

PATH=/bin:/usr/bin:/usr/home/wwgrol/bin
MAILDIR=$HOME/Mail           #you'd better make sure it exists
DEFAULT=$MAILDIR/mbox        #completely optional
LOGFILE=$MAILDIR/Log_File    #recommended
LOGABSTRACT=no

It looks good up til:


# ____________________________________Bounce anything large
:0
* >10000

{

Blank lines in recipes weren't ignored until procmail 3.11pre something.
If you don't have at least 3.11pre3, I'd suspect this is the problem.
The effect of this would be that procmail would abort the recipe with some
nasty message in the logfile, then it would ignore the lonely '{'.  The
next three recipes would then all be run processed as if they were not
in a nested block as, to procmail, they aren't.  Since the last of these
would forward the message else where, this could explain your missing mail.


:0hfw # with `h' flag, no -k option for formail
* >10000
| formail -r -i "Subject: Mail Delivery Refused - Too Large"

:0bfwi
* >10000

 | echo "* Following mail apparently exceeds size limits.    *"  ; \
...


The same thing would happen here, so be sure to delete this blank line
as well.  Once you've fixed the preceeding blank line, you can remove
the conditions on these two recipes, as procmail would ignore them anyway
if the 'outer' condition failed.


What is desired is:

Given one message that is huge, send back ONE message containing
(in order):
 my outgoing header
 the 'echo' text
 the incoming header (possibly with some of the Received lines removed--
                      no sense telling the spammer how our hosts are
                      connected internally)
 the incoming body


        # 10k isn't that big.  100k may be a more reasonable limit.
        :0
        * >100000
        {
            # Get the incoming header.  Drop the Received: and "From " headers.
            :0 h
            HEADER=|formail -IReceived: -I"From "

            # Generate the return header, then the body.  $HEADER is the
            # old header from above.  Feed the lot into $SENDMAIL
            :0 h
            | (formail -ri"Subject: Mail Delivery Refused: Too Large"; \
               echo "* The message with the following headers was too "; \
               echo "* large to deliver.  blah blah blah blah blah blah" ; \
               echo ""; echo "$HEADER" \
              ) | $SENDMAIL $SENDMAILFLAGS -t
        }


(An aside to an already too long message:  How do you make Sun's
OpenWindows mailtool append a .signature file?)

Got me.


Philip Guenther