procmail
[Top] [All Lists]

Re: How to set date/time in .procmailrc

2002-04-24 09:52:58
On Wed, 24 Apr 2002, Udi Mottelo wrote:

On Wed, 24 Apr 2002, Udi Mottelo wrote:

[...]
automatic reply, but now I only want this autoreply to be sent after
16.00 and before 09.00, Is there a way to do this without having to use
telnet/ftp and removing the file ????


        And remove the old messages ha?  I start like this nice procmail 
        puzzle  (:-)

        1>  Say, in the .procmailrc:

:0 h c
* !^FROM_DAEMON                                                                 
* !^X-Loop: user.loop                                                           
* ^TOoffice@                                                                    
/some/where/wait/

        Note that now, wait is a directory!

        2>  mkdir /some/where/wait
        3>  touch -t 200901010101 /some/where/wait/timestamp
        4>  In /some/where/procmailrc write:

:0
| /some/where/reply

        To make more readble I wrote a script (named "reply").


        5>  The script:

#!/bin/sh

cd /some/where
list=`find */* -type f ! -newer timestamp 2>/dev/null`

for i in $list; do
    <$i formail -t -r -i "From:office(_at_)domainname(_dot_)com" -A"Precedence: 
junk" \
        -A"X-Loop: kulpol.loop" -I"Subject:" -A"Subject:Autoreply from "  |
    cat - $HOME/autosvar/autosvar.txt | sendmail -t
    /bin/rm -f $i
done

touch timestamp

        6>  The crontabline line:

1 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23 * * *  /some/where/reply


Bye,
 Udi

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