3 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] maildrop's foreach loop
FromSent OnAttachments
Matthias BerndtApr 27, 2007 12:13 pm 
Sam VarshavchikApr 27, 2007 2:43 pm 
Matthias BerndtApr 28, 2007 1:31 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:Re: [maildropl] maildrop's foreach loopActions...
From:Sam Varshavchik (mrs@courier-mta.com)
Date:Apr 27, 2007 2:43:35 pm
List:net.sourceforge.lists.courier-maildrop

Matthias Berndt writes:

And here is my maildrop script. The purpose is simply to echo the local-part of every To: adress ending in @foobar.com or @foobar.de on the command line once and delete the mail.

/To:\s.*/ foreach getaddr($MATCH) =~ /([^@\s]+)@foobar.(com|de)/

From the maildropfilter man page, right in the description of foreach:

Subpatterns are not processed. Only the MATCH variable will be set for each found pattern.

You'll just need to run an extra match inside the foreach statement.