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@xxxxxxxxx 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@xxxxxxxxxxxxxxxxxxxxxx> To: "Opesh Alkara" <opeshalkara@xxxxxxxxx>; "General Red Hat Linux discussion list" <redhat-list@xxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxx > > > >OR > > > >listname-user=domain@xxxxxxxxxxx > > > > If the return path is something@xxxxxxxxx <http://yahoo.com> and the > >recipient email is mynameisxyz@xxxxxxxxx, the verp address should be > > > > something-mynameisxyz=gmail.com@xxxxxxxxx > > > >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. > > > > -- redhat-list mailing list unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe https://www.redhat.com/mailman/listinfo/redhat-list