CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • CiviMailProcessor.php no regex match on mail address?
Pages: [1]

Author Topic: CiviMailProcessor.php no regex match on mail address?  (Read 2284 times)

greenmachine

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 6
CiviMailProcessor.php no regex match on mail address?
April 27, 2009, 12:00:38 am
Can somebody who is good at reading regex point out why civimailprocessor.php is not getting a match on the mail address (that CiviMail is generating)? Here are the two strings printed from within the script:

Regex ($regex)

Code: [Select]
/^civimail-(b|c|e|o|r|u)\.(\d+)\.(\d+)\.([0-9a-f]{16})@civimail\.metroiba\.org$/
Mail address ($address->email)

Code: [Select]
civimail-o-5-5-d9db162e3f0474fd@civimail.metroiba.org
Both from the line

Code: [Select]
preg_match($regex, $address->email, $matches)
To my eye, it seems like there should be a match, but obviously no match is being found.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviMailProcessor.php no regex match on mail address?
April 27, 2009, 08:49:53 am

that regex will match:

civimail-o.5.5.d9db162e3f0474fd@civimail.metroiba.org

note that the . has been escaped with a backslash

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

greenmachine

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 6
Re: CiviMailProcessor.php no regex match on mail address?
May 04, 2009, 09:08:53 pm
Thanks. I had the VERP separator set to the dash character ( - ). Changing that setting under Admin > CiviMail to the dot character ( . ) makes CiviMailProcessor.php work again. I wonder if the regex is not properly grabbing the VERP separator setting, but I don't have time to double check tonight, sorry.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • CiviMailProcessor.php no regex match on mail address?

This forum was archived on 2017-11-26.