procmail
[Top] [All Lists]

vacation recipe

2001-02-06 15:33:46

Hello all,
I am trying to a recipe to act as:

IF the file $PMDIR/iamout exist
   IF the sender isn't on the vacation.cache file
      Add the sender to the vacation.cache file
      AND
      Have iamout.msg sent to him
   fi
ELSE
   (I am not on vacation)
   send reply.msg to him
fi

The trouble is that if the sender already is on vacation.cache file,
reply.msg is sent with is not what i am trying to do. If i am on vacation
and the sender is  on the vacation.cache file, no message should be sent.


        SHELL=/bin/sh
        FLAG = $PMDIR/iamout

# -1-
        :0 Whc: vacation.lock
        * !^FROM_DAEMON
        * !^X-Loop: my(_at_)emai(_dot_)address
        *$ ? $IS_EXIST $FLAG
           | formail -rD 8192 $PMDIR/vacation.cache
# -2-
           :0 ehc # if the name was not in the cache
              | (formail -rA"Precedence: junk" \
                 -A"X-Loop: my(_at_)emai(_dot_)address" ; \
                 cat $PMDIR/iamout.msg \
                 ) | $SENDMAIL -oi -t
# -3-
        :0 E # else
                {
# -4-
                  :0 h c
                  * !^FROM_DAEMON
                  * !^X-Loop: my(_at_)emai(_dot_)address
                  | (formail -r -A"Precedence: junk" \
                     -A"X-Loop: my(_at_)emai(_dot_)address" ; \
                     cat $PMDIR/reply.msg ) | $SENDMAIL -t
                }

Thank you for your help,
Carlos


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • vacation recipe, Carlos Eduardo R. L. de Miranda <=