Re: VERP header regex

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

 



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

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux