procmail
[Top] [All Lists]

RE: delaying incoming messages

2007-12-07 16:38:08
ignotus(_at_)freemail(_dot_)hu wrote:

Hello, I would like to delay incoming messages.  Like I get a message
that matches specific procmail recipes, then I would like to continue
the processing of that message approximately twelve hours/days/month
later (imagine a FIFO queue that delays everything).

Just put those messages in a special folder.  It could have the name
of the date you want to reconsider the contents for processing.
If you have GNU date, you could do something like this in procmail
to save to a file marked for 12 hours in the future:

 SHELL = /bin/sh

 :0:
 * conditions
 `gdate --date='12 hours' --utc '+%Y%m%d.%H'`


The file name would look like this:

  $ gdate --date='12 hours' --utc '+%Y%m%d.%H'
  20071208.11

Then your crontab would look every hour (or whatever) for such.  
If it exists, crontab runs a shell script:

 ------------------ start script  ------------------
 #! /bin/sh

 # UNTESTED!

 THISHOUR=`gdate --utc '+%Y%m%d.%H'`
 PROCESSED="$THISHOUR.processed"

 test -r "$THISHOUR" &
 mv "$THISHOUR" "$PROCESSED" &
 formail -s procmail -m postprocess.rc < "$PROCESSED"
 ------------------- end script  -------------------

-- 
Dallman


____________________________________________________________
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>