1 message in net.sourceforge.lists.courier-maildrop[maildropl] exiting foreach loop?
FromSent OnAttachments
rica...@americasnet.comMay 3, 2003 11:15 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[maildropl] exiting foreach loop?Actions...
From:rica...@americasnet.com (rica@americasnet.com)
Date:May 3, 2003 11:15:44 am
List:net.sourceforge.lists.courier-maildrop

Hi,

I'm trying to get the first IP of received headers which is not of the form 192. or 127.

So I have this foreach loop:

foreach /^Received: .*!\(.*\[.*\]\)!.*/ { if ($MATCH2 !~ /^192/ && $MATCH2 !~ /^127/) { $RECEIVED_IP = $MATCH2 } }

However, I need to be able to exit the foreach loop once I've set $RECEIVED_IP. Is there a simple way, or must I introduce something else into the if and let the loop continue?

Another question... I'm trying to generate a unique identifier for a message. Typically I do that in perl with something like taking the current time and appending the PID of the program to it. But I can't do that within maildrop, unless I can somehow retrieve its PID or grab some other unique value. Does anyone have any suggestion how I could generate a unique id from within maildrop?

Thanks Ricardo