procmail
[Top] [All Lists]

Re: 3.11pre7 "Breaking" 3.10 Recipes

1998-07-15 16:20:42
On Wed, 15 Jul 1998, David W. Tamkin wrote:

Paul Bartlett wrote,

|     I had some recipes which worked just dandy under procmail v3.10 on
| SunOS 4.1.4.  [etc.]

Any procmailrc syntax that worked under 3.10 will work under 3.11pre7; the
problem is something else that happened at the same time.  I'd guess it was
related to Digex's putting mail delivery and user logins onto different
machines; that causes me no end of trouble on one of my accounts.

    Digex on my subdomain (Access) has been running mail and login
shells on different machines for quite some time.  However, on the
in-house newsgroup just today, somebody mentioned that the mail servers
for the Access subdomain upgraded sendmail to 8.8.x and that supposedly
this sendmail does not interact the same way with procmail.  I vaguely
remember something on the list a while back about sendmail 8.8 but did
not pay attention to it.

| [stuff not immediately relevant here]

The only new "switches" I can think of from 3.10 to 3.11pre7 are to put the
default mail spool under the user's $HOME instead of a system-wide spool
directory.  However, these "switches" could be something available in 3.10
but not used by Digex when it was running 3.10, such as changed settings in
/etc/procmailrc.

Paul, would you be so good as to post the recipes?  Then we can see for sure
if there's anything in your rcfile that might be the problem (though I doubt
it).

    Fine with me.  When I need it, this statement is invoked just
before everything not already processed (such as list mail and spam)
falls into the default mailbox (which I occasionally make a folder
rather than the mail by specifying $DEFAULT):

INCLUDERC=$PMDIR/vacation.rc

    vacation.rc looks like this (it may not be efficient, but I don't
need it too often, and it worked before Digex "upgraded" software):

##################################################
#  Change message text as needed (bottom).       #
#  Normally called in with something like        #
#    INCLUDERC=$PMDIR/vacation.rc                #
#  $MY_ADDR is defined earlier in the            #
#    .procmailrc hierarchy.                      #
#  Normally placed *after* recipes doing         #
#    special filtering and just before all       #
#    non-filtered mail drops into default        #
#    mailbox.                                    #
##################################################

:0  # When was it mailed?
* ^Date: *\/[^ ].*
{ INDATE=$MATCH }

:0  # What is the subject?
* ^Subject: *\/[^ ].*
{ SUBJECT=$MATCH }

# Weed out special cases which should *not* receive notice.
# Have formail check to see if this sender has already received notice.
:0 Whc: vacation.lock
* !^FROM_DAEMON
* $ !^X-Loop: $\MY_ADDR
* !^Precedence.*junk
* !^Precedence.*bulk
* !^Precedence.*list
| formail -rD 8192 $PMDIR/vacation.cache

  :0 ehc   # If the name was not in the cache, send a notice.
  | (formail -rA"Precedence: junk"             \
       -A"X-Loop: $MY_ADDR";                   \
     echo "Your mail arrived dated: $INDATE";  \
     echo "and concerning Subject: $SUBJECT";  \
     echo "but I am away until approximately 1999.99.99."; \
     echo "I will attend to it upon my return. -- Paul Bartlett <$MY_ADDR>"  \
    ) | $SENDMAIL -oi -t

# ===== end of vacation.rc =====

    Here is a typical spam-killing recipe:

# nn is just a number to identify which recipe is
# calling in bitbucket.rc
:0
* _conditions_to_detect_spam_to_be_killed_
{ WHICHRC=nn
  INCLUDERC=$PMDIR/bitbucket.rc }

    bitbucket.rc looks like this:

##################################################
#  Normally called in with something like        #
#    { INCLUDERC=$PMDIR/bitbucket.rc }           #
#  as the action routine for a recipe.           #
#    This recipe makes a special one-line        #
#    entry in the procmail log and then          #
#    discards the item of mail.                  #
#  $WHICHRC is set in the calling recipe in      #
#    order to identify that calling recipe.      #
##################################################

# Turn on logging so we can record the action
VERBOSE=off
LOGABSTRACT=yes

:0  # When was it mailed?
* ^Date: *\/[^ ].*
{ THEDATE=$MATCH }

:0  # From whom did it come?
* ^From: *\/[^ ].*
{ WHOFROM=$MATCH }

:0  # What is the subject?
* ^Subject: *\/[^ ].*
{ THESUBJ=$MATCH }

# Get message size (recipe from David W. Tamkin)
:0HB   # Note trailing period in first condition line
* 1^1 .
* 1^1 ^.*$
* -1^0
{ }
THESIZE = $=

# Log disposition; splitting "" across lines is deliberate
LOG="$WHICHRC - Discarded: $THEDATE $WHOFROM $THESUBJ $THESIZE
"

# Reset logging to what it normally is for our procmail
VERBOSE=$VERBOSITY
LOGABSTRACT=$LOGGING

:0                         # Trash this piece
/dev/null

# ===== end of bitbucket.rc =====

Thanks.

-- 
Paul                             <pobart(_at_)access(_dot_)digex(_dot_)net>
..........................................................
Paul O. Bartlett, P.O. Box 857, Vienna, VA 22183-0857, USA
Finger, keyserver, or WWW for PGP public key
Home Page:  http://www.access.digex.net/~pobart