procmail
[Top] [All Lists]

Re: Bypass large files with filter

2006-01-25 06:38:49
Robert McKenzie:
Ruud H.G. van Tol:

# /etc/procmailrc

   DROPPRIVS = 'yes'
   SHELL     = '/bin/sh'
   MAILDIR   = "/home/$LOGNAME/mail"

   :0:
   * > 150000
   Big_Messages


For the /etc/procmailrc what I want is a rule that will stop the
processing of big messages right at the top, for everyone.
Then deliver the messages to /var/spool/mail/USERNAME

See `procmail -v`, mine says that $DEFAULT is (the file)
'/var/spool/mail/USERNAME'.



    :0
    * > 150000
    {
      DROPPRIVS = 'yes'
      :0:
      $DEFAULT
      :0:        # if delivery failed, try $ORGMAIL
      $ORGMAIL
      :0         # if delivery failed again,
      {SWITCHRC} # go to user's procmailrc
    }


If $DEFAULT c.q. $ORGMAIL ends in a slash, or is a directory, then
(AFAIK) the locking should be removed.



Alternative-1:

    :0
    * > 150000
    {SWITCHRC}    # go to user's procmailrc

This still seems the sanest to me: leave it to the user what to do with
the big message.




Alternative-2:

    NL = '
'                   # literal ASCII-10
    TAB = '    '    # literal ASCII-9

    :0
    * > 150000
    {
      LOGFILE     = '/var/log/etc_procmailrc.log'
      VERBOSE     = 'on'
      LOGABSTRACT = 'all'
      LOG         =
"L:${LOGNAME}${TAB}D:${DEFAULT}${TAB}O:${ORGMAIL}${NL}"

      DROPPRIVS   = 'yes'  # drop root-privileges
      :0:
      $DEFAULT
      :0:        # if delivery failed, try $ORGMAIL
      $ORGMAIL
      :0         # if delivery failed again,
      {SWITCHRC} # go to user's .procmailrc
    }



-- 
Grtz, Ruud


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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