procmail
[Top] [All Lists]

Re: Finding the right Received header

1997-09-06 09:47:52
wwgrol(_at_)sparc01(_dot_)fw(_dot_)hac(_dot_)com (W. Wesley Groleau x4923) 
writes:
...
So I want only the Received header in which "by" is our gateway.  Thus:

:0fhw
| (print "$LOGFILE: $(egrep '^Received.*by gw1.hughes-defense-comm.com via')")
Entrance

This worked, as far as the file "Entrance" is concerned.

BUT all messages since I put that in have no headers at all when the get
to the in-box.  (Except for procmail's "From foo(_at_)bar")  I know it has
something to do with stdout, but I'm not sure what to do.  ('tee' ?)

The messages are all losing their headers because you told procmail to
feed the header of the message into the action of this recipe and
replace it [the header] with the output of the action.  Since the
command involved doesn't spit anything to stdout, the header is left
empty.  The solution is therefore to not tell procmail to do that in
first place: remove the 'f' flag.  If that's all you do then procmail
stop processing your .procmailrc when it hits that recipe, so you need
to tell procmail that you just want it to deliver a copy of the message
via that recipe, and then to keep going, which is what the 'c' flag is
for.

Philip Guenther

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