procmail
[Top] [All Lists]

Re: matching Received

2006-01-06 14:49:04
Michael J Wise wrote:
I'd start by rewriting it like so:
      :0
      *   ^From:(_dot_)*\(_at_)apid\(_dot_)net
      * ! ^Received:.*\[65\.17\.84\.226\]

And see what happens with that.

   First, it's missing the file locking.

   Second, escaping of the @ is not necessary.  That part of
the recipe matches just fine.  I had originally written the
recipe w/o the ?? stuff, but since that doesn't seem to make
any difference in the effectiveness of the recipe, I don't
see a need to convert it back.  If I'm wrong, please correct
me.

   Thirdly, adding the square brackets to the Received match
will only complicate the matching process.  Certainly they
will (should) exist, and the matching should occur on it
regardless, but for the sake of just getting it working, I
think I'd rather just leave them off, since I don't see
that they would make or break the match.

I wonder if it's because email can have multiple Received lines...
That's not the issue, trust me on this.   :)

   I think my point was misunderstood.

   Suppose that an email comes in that has three Received header
lines; the second is the one that we want (that shows that the
message was received by our trusted IP).  The recipe matches on
the From, so it goes to match on the Received. Well, since the
regexp match process is linear, my understanding is that it will
find the first Received line, and the ! matches because it doesn't
find the happy IP that it was looking for.  So, according to the
rules of the recipe, a valid match was found and so the message
is dumped into the .TRAP file to which I pointed it.

   I was musing, I think, to determine if it would potentially
try all three Received lines to check for a valid match, or if
once it said "yes this is it - it is a match" then that was all
she wrote..

   I'm pretty sure that is the case, which would explain why
it's matching the ! Received.

   Anyway, I do appreciate the reply.  I've been playing around
with it and I think I've figured out why it failed to make a
match before.

   Sometimes (I don't know why at this point) the Received
headers reflect not the firewall IP, but the LAN IP of the
computer which sent the mail.   So, I changed the Received
line to look for both and it seems to be working.

Mr Duck


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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