[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: VERP header regex



Hi Carl,

I appreciate and thank your help and time on this.

This regex will be placed in the sendmail configuration file and has nothing
to do with programming languages. Actually this REGEX is a module that is
compiled with sendmail and serves as a tool to filter/scan incoming/outgoing
mails by creating desired regular expressions.

Please refer
http://dev.gentoo.org/~lcars/misc/sendmail-hacks.txt

Actually what I was looking for is as any email ID can be parsed using this
regex:

 \b[A-Z0-9 _%-]+ [A-Z0-9 _%-]+\ [A-Z]{2,4}\b

is it feasible to create a similar regex that parses VERP return path header
i.e.

 something-mynameisxyz=gmail com yahoo com

It's perferable to get the expression in a single line..

Hope this helps..and please feel free to ask if any information is required
further.

Thanks,
--Oops


----- Original Message ----- 
From: "Carl Reynolds" <redhat-list hyperbole-software com>
To: "Opesh Alkara" <opeshalkara gmail com>; "General Red Hat Linux
discussion list" <redhat-list redhat com>
Sent: Friday, September 30, 2005 11:47 PM
Subject: Re: VERP header regex


> Opesh Alkara wrote:
>
> >Can any one suggest me the REGEX that will work for all the VERP
> >headers....the VERP header format is something like this:
> >
> >Example:
> >
> >verp-prefix-username=userdomain com mailinglistserver com
> >
> >OR
> >
> >listname-user=domain your domain
> >
> > If the return path is something yahoo com <http://yahoo.com> and the
> >recipient email is mynameisxyz gmail com, the verp address should be
> >
> > something-mynameisxyz=gmail com yahoo com
> >
> >The REGEX should be able to parse any VERP header....
> > Thanks much...
> >
> >--
> >Regards
> >Opesh Alkara
> >
> >
> You don't say what language you are trying to do this in, but, the
> syntax you are trying to parse is complex enough (with the e-mail
> address on the end of it) that you should be using several statements to
> try to parse these headers. You should also look at the *Email::Valid*
> <http://search.cpan.org/author/MAURICE/Email-Valid-0.15/Valid.pm> module
> from CPAN.
>
> You can check the existence of the two records you listed as follows
>
>
> use Email::Valid;
>
> if  (    ($line =~ /^verp-prefix-username=(.*)$/)
>       and (Email::Valid->address($1) )
>      )
>   { do-something }
> elsif  (    ($line =~ /^listname-user=(.*)$/)
>       and (Email::Valid->address($1) )
>      )
>   { do-something-else }
>
>
> Try to give us a little more information if you want more help.
>
>
>
> Carl.
>
>
>
>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]