Perhaps someone on the list can help.
David Tamkin suggested, in response to my note on the difficulty of
cleanly parsing dates when some degree of accuracy is needed:
If one is running procmail on one's local machine rather than at the ISP,
the local machine should be updating the From_ timestamp anyway (or the local
invocation of procmail can do it with -f-), so I'm going to take it that Rik
is running procmail on his ISP's hardware, not his own.
If one is calling procmail from ~/.forward at your ISP, this might work:
"| ... TZ=whatever /path/to/procmail -f- ..."
My situation is as David supposes: My actual timezone varies as I
travel, and I wish to have my mail forwarded based on the time of day.
I don't want to be beeped at 3 in the morning because I am a few zones
away from the server and my recipe says to beep until midnight,
otherwise just file it. I have no trouble accessing the server and
changing a parameter or file setting, either in .procmailrc or in
.forward.
Indeed, what David suggests seems to be the right direction, as some
brief experiments at the interactive command line indicate. However,
when translated to my .forward file, the result is mixed. My .forward
resembles:
"!IFS=' ' && exec /path/to/procmail -tf- MODE=prod || exit 75 #rik"
I understand that with sendmail 8 I can probably remove the preceding
IFS=' ' &&
and the trailing
#rik
and that I can also (not due to sendmail) change the -tf- to -f-,
although these can all stay with no ill effect.
When I try to insert TZ=EST5EDT into this, I get mixed results.
Specifically, these
"|IFS=' ' && TZ=EST5EDT exec /path/to/procmail -f- MODE=prod || exit 75 #rik"
"|TZ=EST5EDT && exec /path/to/procmail -f- MODE=prod || exit 75 #rik"
"|IFS=' ' TZ=EST5EDT && exec /path/to/procmail -f- MODE=prod || exit 75 #rik"
have no effect, while
"!IFS=' ' && TZ=EST5EDT /path/to/procmail -f- MODE=prod || exit 75 #rik"
works fine.
That is, the new environment does not seem to be recognized when I exec
procmail. Of course, if this is the case I wonder if it makes sense to
(re)define the field separator. I have also tried some grouping after
the exec, but that has been less successful, causing loss of mail.
A tedious search of the archive has shed no light on this. Any takers?
What is the purpose of 'exec'ing procmail in this situation?
--
Rik Kabel Old enough to be an adult
rik(_at_)netcom(_dot_)com