RE: [courier-users] reseting variables in maildrop

2005-10-13 Thread Bowie Bailey
From: Arvinn Løkkebakken [mailto:[EMAIL PROTECTED]
 
 Can MATCH varibles be set only once in maildrop?
 
 I try to pull out values from headers using $MATCH2,  $MATCH3.. and
 so on..  The problem is that it seems like $MATCH2 won't be set
 again when doing a think like this:
 
 if ( /^From: *!.*/ )
 {
 MAILFROM=getaddr($MATCH2)
 }
 
 /^Received: from .*  \(!.*! \[![0-9]\.[0-9]\.[0-9]\.[0-9]!\]\)\n\tby 
 frontendhost.example.com /:w
 CLIENTHOST=$MATCH2
 CLIENTIP=$MATCH4
 
 My problem here is that $CLIENTHOST is set to the same as $MAILFROM,
 or is there something else that is wrong?
 
 I use maildrop 1.8.

I noticed that you don't have an IF block around that second regex.
Is it possible that the MATCH2 variable is not set because the regex
didn't match?

Try this:

if ( /^Received: from .*  \(!.*!
\[![0-9]\.[0-9]\.[0-9]\.[0-9]!\]\)\n\tby frontendhost.example.com /:w )
{
CLIENTHOST=$MATCH2
CLIENTIP=$MATCH4
}

Bowie


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users


RE: [courier-users] reseting variables in maildrop

2005-10-13 Thread Bowie Bailey
From: Arvinn Løkkebakken [mailto:[EMAIL PROTECTED]
 
 Can MATCH varibles be set only once in maildrop?
 
 I try to pull out values from headers using $MATCH2,  $MATCH3.. and
 so on..  The problem is that it seems like $MATCH2 won't be set
 again when doing a think like this:
 
 if ( /^From: *!.*/ )
 {
 MAILFROM=getaddr($MATCH2)
 }
 
 /^Received: from .*  \(!.*! \[![0-9]\.[0-9]\.[0-9]\.[0-9]!\]\)\n\tby 
 frontendhost.example.com /:w
 CLIENTHOST=$MATCH2
 CLIENTIP=$MATCH4
 
 My problem here is that $CLIENTHOST is set to the same as $MAILFROM,
 or is there something else that is wrong?
 
 I use maildrop 1.8.

Actually, I think the problem is with the pattern.  You are only
matching a single digit for each octet in the IP address.

Try this one:

/^Received: from .*  \(!.*! \[![0-9]+\.[0-9]+\.[0-9]+\.[0-9]+!\]\)\n\tby
frontendhost.example.com /:w

If you still have problems with the match, you may want to be a bit
less specific on the whitespace requirements.

/^Received: from .*\(!.*!\[![0-9]+\.[0-9]+\.[0-9]+\.[0-9]+!\]\)[\n\t
]+by frontendhost.example.com /:w

Bowie


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users


RE: [courier-users] reseting variables in maildrop

2005-10-13 Thread Bowie Bailey
From: Bowie Bailey 
 
 /^Received: from 
 .*\(!.*!\[![0-9]+\.[0-9]+\.[0-9]+\.[0-9]+!\]\)[\n\t
 ]+by frontendhost.example.com /:w

Ack!  Don't miss the space after the \t in the character class that
got split up.

It should be:

[\n\t ]+

Bowie


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users


RE: [courier-users] reseting variables in maildrop

2005-10-13 Thread Bowie Bailey
From: Arvinn Løkkebakken [mailto:[EMAIL PROTECTED]
 
 Bowie Bailey wrote:
  From: Bowie Bailey 
  
 /^Received: from 
 .*\(!.*!\[![0-9]+\.[0-9]+\.[0-9]+\.[0-9]+!\]\)[\n\t
 ]+by frontendhost.example.com /:w
 
 I allready used an if around it. I just didn't paste it in.  But I
 guess you are right that regexp doesn't match. However.. it still
 doesn't with your corrections. I been tweaking it for hours so I
 guess I just should give up:) 
 Thanks for the help anyway!

Post an example header that you expect it to match and I'll see if I
can figure out what's wrong.

Bowie


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users


Re: [courier-users] reseting variables in maildrop

2005-10-13 Thread Arvinn Løkkebakken

Bowie Bailey wrote:
From: Bowie Bailey 

   /^Received: from 
.*\(!.*!\[![0-9]+\.[0-9]+\.[0-9]+\.[0-9]+!\]\)[\n\t

]+by frontendhost.example.com /:w



Ack!  Don't miss the space after the \t in the character class that
got split up.

It should be:

[\n\t ]+

Bowie




I allready used an if around it. I just didn't paste it in. But I guess you are
right that regexp doesn't match. However.. it still doesn't with your
corrections. I been tweaking it for hours so I guess I just should give up:)
Thanks for the help anyway!

Arvinn



---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users


Re: [courier-users] reseting variables in maildrop

2005-10-13 Thread Arvinn Løkkebakken

Bowie Bailey wrote:

From: Arvinn Løkkebakken [mailto:[EMAIL PROTECTED]


Bowie Bailey wrote:

From: Bowie Bailey 



  /^Received: from 
.*\(!.*!\[![0-9]+\.[0-9]+\.[0-9]+\.[0-9]+!\]\)[\n\t

]+by frontendhost.example.com /:w


I allready used an if around it. I just didn't paste it in.  But I
guess you are right that regexp doesn't match. However.. it still
doesn't with your corrections. I been tweaking it for hours so I
guess I just should give up:) 
Thanks for the help anyway!



Post an example header that you expect it to match and I'll see if I
can figure out what's wrong.

Bowie


Received: from camomile.cloud9.net (camomile.cloud9.net [168.100.1.3])
by evercom.sandakeronline.com (Postfix) with ESMTP id D211B27

Hopefully this line won't breek on the way. The values I want to pull out there 
is the hostname camomile.cloud9.net (not the helo string) and the ip.


Thank you.

Arvinn


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users


RE: [courier-users] reseting variables in maildrop

2005-10-13 Thread Bowie Bailey
From: Arvinn Løkkebakken [mailto:[EMAIL PROTECTED]
 
 Bowie Bailey wrote:
  From: Arvinn Løkkebakken [mailto:[EMAIL PROTECTED]
  
 Bowie Bailey wrote:
 
 From: Bowie Bailey 
 
 
/^Received: from 
 .*\(!.*!\[![0-9]+\.[0-9]+\.[0-9]+\.[0-9]+!\]\)[\n\t
 ]+by frontendhost.example.com /:w
 
 I allready used an if around it. I just didn't paste it in.  But I
 guess you are right that regexp doesn't match. However.. it still
 doesn't with your corrections. I been tweaking it for hours so I
 guess I just should give up:) 
 Thanks for the help anyway!
  
  Post an example header that you expect it to match and I'll see if I
  can figure out what's wrong.
 
 Received: from camomile.cloud9.net (camomile.cloud9.net [168.100.1.3])
   by evercom.sandakeronline.com (Postfix) with ESMTP id D211B27
   
 Hopefully this line won't break on the way. The values I want to
 pull out there is the hostname camomile.cloud9.net (not the helo
 string) and the ip.

I did a bit of testing, and this pattern works for me:

/^Received: from.*\(!.*!\[![0-9]+\.[0-9]+\.[0-9]+\.[0-9]+!\]\)
[\n\t ]+by evercom\.sandakeronline\.com/

(I manually split it this time to avoid any confusion)

The :w may have been what was messing you up.  This caused the
pattern to be matched against the body rather than the header (:wh
may have been what you were looking for).  Also, the :w causes the
^ and $ characters to be interpreted differently so that they match
the beginning of the section rather than each line.

You should be able to use the pattern without any modifiers.  This
will give you a line-by-line match on the headers.  Multiline headers
will automatically be concatenated so that they can be searched as a
single line.

Bowie


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users


Re: [courier-users] reseting variables in maildrop

2005-10-13 Thread Arvinn Løkkebakken

Bowie Bailey wrote:

From: Arvinn Løkkebakken [mailto:[EMAIL PROTECTED]


Bowie Bailey wrote:


From: Arvinn Løkkebakken [mailto:[EMAIL PROTECTED]



Bowie Bailey wrote:


From: Bowie Bailey 




 /^Received: from 
.*\(!.*!\[![0-9]+\.[0-9]+\.[0-9]+\.[0-9]+!\]\)[\n\t

]+by frontendhost.example.com /:w


I allready used an if around it. I just didn't paste it in.  But I
guess you are right that regexp doesn't match. However.. it still
doesn't with your corrections. I been tweaking it for hours so I
guess I just should give up:) 
Thanks for the help anyway!


Post an example header that you expect it to match and I'll see if I
can figure out what's wrong.


Received: from camomile.cloud9.net (camomile.cloud9.net [168.100.1.3])
by evercom.sandakeronline.com (Postfix) with ESMTP id D211B27

Hopefully this line won't break on the way. The values I want to
pull out there is the hostname camomile.cloud9.net (not the helo
string) and the ip.



I did a bit of testing, and this pattern works for me:

/^Received: from.*\(!.*!\[![0-9]+\.[0-9]+\.[0-9]+\.[0-9]+!\]\)
[\n\t ]+by evercom\.sandakeronline\.com/

(I manually split it this time to avoid any confusion)

The :w may have been what was messing you up.  This caused the
pattern to be matched against the body rather than the header (:wh
may have been what you were looking for).  Also, the :w causes the
^ and $ characters to be interpreted differently so that they match
the beginning of the section rather than each line.

You should be able to use the pattern without any modifiers.  This
will give you a line-by-line match on the headers.  Multiline headers
will automatically be concatenated so that they can be searched as a
single line.

Bowie




Great. Thank you very much.

Arvinn


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users