procmail
[Top] [All Lists]

my Resent-Date: kludge

1996-08-24 15:34:58
Because the mail for which I need a Resent-Date: always has just had the
timestamp in the From_ line freshly updated by procmail -f-, I decided to
build the Resent-Date: from the new From_ line.  (So maybe it's a couple
seconds slow because of the time procmail needs to do the rest of its work
between updating the timestamp and handing the outgoing message over to
Smail; big deal.)

The only thing lacking in the From_ line is the timezone.  In the US we set
clocks ahead on the first Sunday in April and back on the last Sunday in
October, so ten months out of the year (if the location of one's machine
is static) the timezone is obvious from the month; and from April 8 through
April 30 and from October 1 through October 24 we're on Daylight Savings
Time.  For the remaining fourteen days of the year -- April 1 through April 7
and October 25 through October 31 -- I cave in and run date +%Z to get the
time zone.

With a much more complicated rcfile I could further examine the data in early
April and late October and compare day of the week to date of the month, and
finally on Sundays check the hour, reducing the need to run date from four-
teen days a year to two hours a year (1 AM CDT to 2 AM CST -- i.e., 0600 UTC
to 0800 UTC -- on the last Sunday in October), but I'm just not up to coding
that yet.

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