procmail
[Top] [All Lists]

Re: Recipes based on date and time

1996-10-30 15:56:25
Gilles Goullet asked,

|       I just want to make some of my recipes being taken in account only
| during certain periods, typically at business hours.

Several people have posted answers that involve running date(1).  That is
unnecessary if your incoming mail has a From_ line at the top showing the
current date and time of arrival, or if you invoke procmail with -f- to
update the timestamp in the From_ line.

As I've posted before, the current time, date, month, year, and day of the
week (everything but the time zone) are already in the text for procmail to
use.  There is no need or reason to run date(1) if that line is there.

I regularly use the From_ line to make recipes turn on and off at preset
times, and the only times it has failed are those when I wrote the search
expression wrong.

Depending on the usual last time of the afternoon that you check mail at
work and the usual last time you check mail at home (perhaps before bed if
you don't log in in the morning before leaving for work), you can set up
recipes accordingly.

Running date(1) for every incoming letter just to repeat information that
is already there is a waste of cycles.

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