procmail
[Top] [All Lists]

Unidentified subject!

1995-10-19 20:48:35
A couple people have asked for it...so here it is.  This is the
/etc/procmailrc I've had on my systems for the past few months. 
FYI...these are GNU Linux systems.  I think my usage of head requires 
GNU head. 

---------------------------------------------
SHELL=/bin/sh
PATH=/usr/bin:/bin:/usr/local/bin:
SENDMAIL=/usr/sbin/sendmail
LOGFILE=/var/adm/procmail.log
VERBOSE=no

threshold=3145728 # largest tolerated size  = 3mb
postmastermail=/var/spool/mail/root # folder where mail to postmaster is
                                    # filed

:0 B # use HB to measure both head and body
* 1^1 .
* 1^1 ^.*$
{ textsize = $= }

:0
* $ $textsize^0
* $ -$threshold^0
* ^Message-Id:.*\/<.*>
{
         msgid=$MATCH
        :0chwi:
        | echo "Message $msgid for $LOGNAME was $textsize bytes long." |\
        formail -A"Subject: FYI: oversize mail rejected" \
        -A"From: postmaster" >>$postmastermail

        :0bfi 
        | echo " " ; \
        echo "------------------------------------------------------------" ; \
        echo "              WARNING FROM LOCAL POSTMASTER" ; echo ""    ; \
        echo "We enforce a limit of $threshold bytes on incoming mail." ; \
        echo "This message was $textsize bytes and was disposed of by"  ; \
        echo "the mail daemon."                                         ; \
        echo "Please contact the sender and arrange to receive"         ; \
        echo "the file by some other means."                            ; \
        echo "The original message began as follows:"                   ; \
        echo "------------------------------------------------------------" ; \
        echo "" ; head -c 2k ; echo "" ; echo "" ; \
        echo "------The rest of this message has been disposed of---------"

# This last part isn't necessary unless you want to totally dump 
# excessive length mail when the above warning recipe fails
#       :0he 
#       /dev/null
}





------------------------------------------------------------------
 Jon Lewis                      |  Mime attachments are OK
 jlewis(_at_)inorganic5(_dot_)chem(_dot_)ufl(_dot_)edu |  But please ask before 
sending 
 http://inorganic5.chem.ufl.edu |  unsolicited huge files.
                                |  
_____Finger jlewis(_at_)inorganic5(_dot_)chem(_dot_)ufl(_dot_)edu for PGP 
public key_____

<Prev in Thread] Current Thread [Next in Thread>