procmail
[Top] [All Lists]

RE: Getting customer number from the email comment

2007-05-28 08:22:23
Alex Kosach wrote Monday, May 28, 2007 4:32 PM:


I have a little problem. I am receiving email where To:
fields is something like that:

“Company Name Cust 1234567” <myname(_at_)mydomain>

I can extract the comment part; however, I am not quite sure
how to identify the customer number (Like, I just need
1234567 part).


  :0
  * ^To:.* ()\/[0-9]+"
  * MATCH ?? ^^\/[0-9]+
  { CUST_NO = $MATCH }

I used the quotation mark in the first condition as a
right-anchor to make sure we get the right number set,
in case there are other numbers in the Company Name.
Then the next condition strips the trailing quotation
mark away again.


The following is my script right now

RC_EMAIL = $PMSRC/pm-jaaddr.rc   #part of the procmail lib
:0HB
* ^To:\/(_dot_)*(_at_)(_dot_)*

Do not use the H flag unless you have a patched procmail
binary.  There is a bug with regard to its use.
If you need it, use the alternate syntax:

  * H ?? regex

Dallman


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>