procmail
[Top] [All Lists]

Re: modifying ackmail.rc

1997-03-13 02:08:56
    > I've been using a slightly modified version of your ackmail.rc
    > recipe for quite some time and enjoy using it. However, I've been
    > attempting to modify it a bit more, as I want to only ack mail
    > every 10-days per unique userid. My attempts have been
    > unsucessful. :(

If you are saying that your recipe file (way below) isn't working, can
you send a verbose log file?

If you are saying that you want some advice on how to change it to set
the frequence to 10 days, instead of 1 day, then .. I'd suggest using
the Julian days format, subtracting 10 days, and then looking for any
cache entry which was more recent than 10 days ago.  If you find such a
cache entry, then don't reply, otherwise reply.

Something like this:

    JNOW=`date +%j`             # get now in Julian
    JPAST=`expr $JNOW - 10`     # get ten days ago..

    # If there is mail from $FROM and it is recent, don't reply
    :0:$ACKS.$LOCKEXT
    * $? awk '\$1 ~ /$FROM\$/ && \$2 > $JPAST {exit 1}'
    | ( /usr/bin/fgrep -v "$FROM" $ACKS ; echo "$FROM $JNOW" ) >$ACKS.new ; \
      rm -f $ACKS ; mv $ACKS.new $ACKS ; \
      ( formail -rI"From:       $FROMSIG" \
                 -I"Reply-To:   $MY_ADDR" \
                 -I"Precedence: junk" \
                 -I"X-Comment: The nights of wonder" \
                 -I"X-Tv-Show: _Homicide: Life on the Street_" \
                 -I"Subject:    Re: $SUBJ [$ACKM]" \
                 -I"X-Loop:     $MY_ADDR" \
                 -I"References:" ; \
        mrep33 -p ; \
        cat /u/v/vjl/mailborg/ack1 ; \
        cat /u/v/vjl/.project ; \
        /usr/bin/sed -e "s~\$SUBJECT~$SUBJ~" $ACKFILE ) \
       | $SENDMAIL -oi -t

    > If you have any tips, I'd be very happy to hear them. What follows
    > is my modified ackmail.rc file; $NOACKFILE is a list of addresses
    > - one per line; mrep33 is a mail counting script; all the usual
    > vars are defined at the begining of my .procmailrc.

Try out the example above..

Good luck.
___________________________________________________________
Alan Stebbens <aks(_at_)sgi(_dot_)com>      http://reality.sgi.com/aks


    > :0hc
    > * $^TO($USER|$MY_ADDR)
    > * ? test -f $ACKMSG -o -f $VACAMSG
    > * !^FROM_DAEMON
    > * !$ $FROM(Majordomo|Listserv|listproc)
    > * !^Subject: .*(\[(ack(nowledge?ment)?|on vacation)\]|\
    >           auto(matic)[- ]reply|\
    >           away from mail|\
    >           MailBorg Auto-Reply|\
    >           out of town|\
    >           can ?not (reply|answer)|\
    >           (on |via )vacation( program)?)
    > * !$^X-Loop: $MY_ADDR
    > * ! ? formail -zxResent-Sender: -xResent-From: -xX-Envelope-From: -xFrom\ 
 \
    >       -xSender | /usr/bin/fgrep -f $NOACKFILE 
    > {
    >     COMSAT=off
    >     DELIVERED=yes
    > 
    >     LOGABSTRACT=no
    > 
    > 
    >     DATE=`/bin/date +'%D'`
    >     FROM=`formail -rzx To:`
    >     SUBJ=`formail -zx Subject: | /usr/bin/sed -e 's/^Re: *//g' -e 
's/["~]/_/g'`
    >     ACKFILE=`if [ -f $VACAMSG ]; then echo $VACAMSG ; else echo $ACKMSG ; 
fi`
    >     ACKM="`if [ -f $VACAMSG ]; then echo 'on vacation' ; else echo 
MailBorg Auto-Reply ; fi`"
    > 
    >     :0:$ACKS.$LOCKEXT
    >     * !? /usr/bin/fgrep -s "$FROM $DATE" $ACKS
    >     | ( /usr/bin/fgrep -v "$FROM" $ACKS ; echo "$FROM $DATE" ) >$ACKS.new 
; \
    >       rm -f $ACKS ; mv $ACKS.new $ACKS ; \
    >       ( formail -rI"From:       $FROMSIG" \
    >            -I"Reply-To:   $MY_ADDR" \
    >            -I"Precedence: junk" \
    >            -I"X-Comment: The nights of wonder" \
    >            -I"X-Tv-Show: _Homicide: Life on the Street_" \
    >            -I"Subject:    Re: $SUBJ [$ACKM]" \
    >            -I"X-Loop:     $MY_ADDR" \
    >            -I"References:" ; \
    >   mrep33 -p ; \
    >   cat /u/v/vjl/mailborg/ack1 ; \
    >   cat /u/v/vjl/.project ; \
    >   /usr/bin/sed -e "s~\$SUBJECT~$SUBJ~" $ACKFILE ) \
    >       | $SENDMAIL -oi -t
    > }
    > 

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