[Top] [All Lists]

Re: .forward and parameter passing (solved)

1997-10-14 16:31:15
Rik Kabel wrote,

[I had suggested this recipe, after uncommenting the appropriate setting for
 beep_hours for Rik's current timezone:]

T>  :0c # and whatever other flags are needed
T>  * MODE ?? ^^prod^^
T>  * $ ^^From .* ($beep_hours):..:..
T>  | beeper_command

K> Only one ^, and my version has ony one :.., but yes, this is what I do
K> now.

I'd recommend two of each: two carets because, if procmail fails to find
a match to the From_ pattern on the first line of the head, it should not
waste time searching the rest of the head for it.  We know it won't be
there, but procmail doesn't and will take the trouble to look.  Two sets of
colon-period-period, because we don't want to set off the beeper if (1) it's
not beeping time, (2) somehow the space to the left of "($beep_hours)" gets
lost from the condition line, and (3) the minutes within the hour happen to
match the number of an hour when beeps would be on.

K> So, in order to have an *execked* procmail requeue messages, the -t
K> option must be present, yes?

[Emphasis mine] Yes.

T> "|IFS=' ';TZ=EST5EDT;export TZ;exec /path/to/procmail -f- MODE=prod||exit 75 

K> I ended up with something which resembles the last version you
K> present. Works a charm. Apparently TZ is exported by default on other
K> accounts of mine (on other systems), but not on Netcom, hence the
K> failure on Netcom.

Hmm.  Good old Netcom.  I remember when it would forcibly lower-case all
capitals in .forward, so you couldn't refer to $HOME (it would see "$home",
which would always be unset) or IFS or TZ at all.

T> But I think that, if you travel so much and the beep recipe is the only
T> one affected by the timezone, it's better to let Netcom stick with its own
T> TZ=PST8PDT and flip the octothorpes in and out in .procmailrc rather than
T> changing .forward.

K> It isn't the amount of travel, it's the time spent at any given location.

By "so much" I meant "so frequently" rather than "across so much total
distance."  If you spent six months at a time based in a single timezone,
this would be less of a problem for you.

K> Were I just spending a day or two in some strange place, I
K> wouldn't bother resetting my watch. When I spend a week or two, I like
K> to make myself comfortable.

Or when the block of time in one timezone is enough to make the change
worthwhile, even if your stay in any single city there isn't that long?

K> I will stick with flipping .forward file and letting the octothorpes
K> rest.

There are arguments on both sides.  Flipping octothorpes to uncomment or
recomment lines of code is a pretty quick thing to do, while putting the
exact timezone specification into .forward is easier to flub if you're in a
hurry or if you're distracted.

I have a recipe that is active only from 10 AM to 8 PM on certain Wednesdays,
and there is no predictable pattern as to which Wednesdays it will be.  When-
ever the coming Wednesday will not be like the previous Wednesday, it's a
snap to flip the octothorpes.

On the other hand, setting TZ in .forward and getting From_ written by your
local time is of value if you want to check what time your mail came in and
like to get the information by your own time wherever you are rather than
always by Netcom's PST8PDT setting.  Also, if you have many recipes that
are affected by your current timezone and they don't all turn on and off
at the same times -- let's say four such recipes -- it is easier to edit
the timezone in .forward than to comment out four lines in .procmailrc and
uncomment the correct four out of those that were commented before.

If Netcom weren't so vicious about adding 4K to your disk use total for every
little file, you could do something like this (from west to east):

 "|IFS=' ';exec /path/to/procmail -f- MODE=prod||exit 75 #rik"
 "|IFS=' ';TZ=MST7;export TZ;exec /path/to/procmail -f- MODE=prod||exit 75 #rik"
 "|IFS=' ';TZ=MST7MDT;export TZ;exec /path/to/procmail -f- MODE=prod||exit 75 
 "|IFS=' ';TZ=CST6CDT;export TZ;exec /path/to/procmail -f- MODE=prod||exit 75 
 "|IFS=' ';TZ=EST5;export TZ;exec /path/to/procmail -f- MODE=prod||exit 75 #rik"
 "|IFS=' ';TZ=EST5EDT;export TZ;exec /path/to/procmail -f- MODE=prod||exit 75 

Then you could ln the appropriate one to the name ~/.forward whenever you
relocated, and you'd need to type each timezone spec right only once (or
paste them from here now that I've done the work).

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