On Wed, Dec 10, 2003 at 11:45:42AM -0800, Professional Software Engineering
wrote:
Well, seeing as a check of the documentation would reveal that there is no
procmail macro "FROM_" (or variable for that matter), I'd have to say the
former seems like a rather logical conclusion.
Sorry, I was aware of a TO_ macro, and didn't realise (or look to see) if there
was a FROM_ macro. I didn't understand the meaning of FROM_ which I now do,
thanks.
Keep in mind that if you're using fetchmail and depositing the mail in the
local mailspool, if you really want to use the first received header, you'd
better verify that it actually contains the Received: data for the arrival
at your remote mailhost, rather than being a locally generated Received:
(such as if your fetchmail posts the message to your local SMTP, rather
than invoking procmail on it directly). While fetchmail has options to
grab the first or last Received: header, it doesn't have any options for
"grab the second one".
So, the recipe
:0
* $ ^Received:.*$WHICH_RECVD.*\/$RCVD_STAMP
action
will work on
a)the first Received header it finds and stop? My test doesn't indicate
that this is true.
Log output -> procmail: No match on "^Received:.*by
+helium.inexs.com.*\/(S(un|at)|Mon|T(ue|hu)|Wed|Fri), [0-9]+
+(J(an|u[ln])|Feb|Ma[ry]|A(pr|ug)|Sep|Oct|Nov|Dec) (19[8-9][0-9]200[0-4])
+([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]"
b)every Received: header it finds, from top to bottom, leaving my match as
whatever it found in the LAST Received: header? Possibly what is going
wrong in my tests at the moment.
If the answer is b above, then selecting the correct Received: header by using
the $WHICH_RECVD should get me to the right one, right?
Anyway, if you find yourself needing to pay attention to other received:
headers, you might have to tinker. OTOH, you could match for a Received:
BY your upline mailserver and hope that works out consistently.
I thought that is what I was doing with the $WHICH_RECVD part above, but I
must not understand the regex part of the recipe
And yet, the From_ mbx header is so much easier to parse.
the difference being:
Received: uses
RCVD_STAMP = "$WEEKDAYS, [0-9]+ $MONTHS $YEARS $TIMESTAMP"
for -> <snip>for <campbell(_at_)[63(_dot_)140(_dot_)126(_dot_)166]>; Mon, 11
Jun 2001 08:54:49 -0500
and
From uses:
RCVD_STAMP = "$WEEKDAYS $MONTHS [0-9]+ $TIMESTAMP $YEARS"
for -> From campbell(_at_)starbase(_dot_)neosoft(_dot_)com Mon Jun 11
08:54:50 2001
So I'm still baffled about what is going wrong here.
From campbell(_at_)starbase(_dot_)neosoft(_dot_)com Mon Jun 11 08:54:50
2001
Surely this header looked curious in the context of this discussion.
Received: from starbase.neosoft.com (starbase.neosoft.com [206.109.1.32])
by helium.inexs.com (8.9.3/8.9.3) with ESMTP id IAA19196
for <campbell(_at_)[63(_dot_)140(_dot_)126(_dot_)166]>; Mon, 11 Jun
2001 08:54:49 -0500
Note difference between the timestamps in the the Receved: and the From_
are fairly negligible.
Is the presence of the -0500 (GMT offset) what is causing my recipe grief?
lost for my next steps,
-chuck
--
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail