procmail
[Top] [All Lists]

Re: time zones

1999-05-27 07:46:35
When I asked whether

T> "|IFS=' ' TZ=EST5EDT exec /usr/local/nuglops/bin/procmail -tf- MODE=prod || 
exit 75 #rik"

T> do[es] the job (or maybe 'exec' has to go first?)?

Rik Kabel explained,

K> In many cases they should do the job equally, however exec is one of the
K> commands for which this doesn't work. Quoting from a ksh manpage:

          The environment for any simple-command or function may be
          augmented by prefixing it with one or more variable
          assignments.  A variable assignment argument is a word of
          the form identifier=value.  Thus:

               TERM=450 cmd args                  and
               (export TERM; TERM=450; cmd args)

          are equivalent (as far as the above execution of cmd is
          concerned except for special commands listed below that are
          preceded with a dagger).

K> And wuddenyaknowit, exec has a dagger.

Oh well.  Putting it after 'exec' didn't work either, because exec needs to be
followed by the name of an executable (or the basename of one found in $PATH).

Nor does specifying TZ=whatever among procmail's arguments, because it seems
the timestamp update of -f- is done first.  (One cannot do that with IFS,
even if it worked with TZ, because the IFS setting is necessary for inter-
preting the shell commands in .forward.)

One could leave out "exec" and have an extra process waiting around for
procmail to finish.  That's what I'm doing for now.  The alternative is
something like this in the rcfile after TZ is set:

:0hfw
| procmail -f- DEFAULT="|" -m /dev/null

It's still that extra process, but at least it exits right away and doesn't
remain in the process table like the extra shell kept around if you dont'
use exec.  Alternatively, on mail where procmail would select the right
header to restore the postmark address, this can work:

:0hfw
| formail -I'From ' -a'From ' # again, after setting TZ.

The order of precedence for formail -I'From ' -a'From ' is different from
those for formail -rt and formail -r (in ways besides not including From_). 
In my quick pass at testing, I got this ranking with formail 3.13.1:

 Path:
 Return-Path:
 Errors-To:
 Resent-Sender:
 Resent-From:
 Resent-Reply-To:
 Sender:
 Return-Receipt-To:
 From:
 Reply-To:

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