Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/mail#23: Bounce processing doesn't catch pattern 'user doesn't exist' #13200

Merged
merged 1 commit into from
Dec 2, 2018

Conversation

monishdeb
Copy link
Member

Overview

Some email providers throw the bounce pattern "user doesn't exist", which is not found, and therefore results in bounce_type "syntax". However, this bounce pattern should result in immediately put the email addresses to on-hold.

Before

Does not detect bounce pattern 'user doesn't exist ' as invalid bounce type.

After

Detect bounce pattern 'user doesn't exist ' as invalid bounce type.

Comments

ping @lcdservices @eileenmcnaughton @seamuslee001

@civibot
Copy link

civibot bot commented Dec 1, 2018

(Standard links)

@civibot civibot bot added the master label Dec 1, 2018
@seamuslee001
Copy link
Contributor

This looks good to me i used https://regex101.com/ to test the regex and it seems to be able to capture the 3 versions user unknown user does not exist user doesn't exist

@seamuslee001
Copy link
Contributor

@monishdeb you need to escape \ the ' in doesn't

@monishdeb
Copy link
Member Author

Thanks @seamuslee001 for pointing that out.

(how could I missed that sigh)

@seamuslee001
Copy link
Contributor

I'm going to add merge on pass on this given i have tested the regex using a tester. Jenkins will tell us if the upgrade goes wrong at all and the change looks correct to me

@monishdeb
Copy link
Member Author

monishdeb commented Dec 2, 2018

Thanks @seamuslee001

FYI here's how I tested my change earlier:

    $p = 'user doesn\'t exist';
    CRM_Core_Error::debug_var('a', CRM_Mailing_BAO_BouncePattern::match($p));

which prints

$p = Array(
'bounce_type_id' => 6,
'bouce_reason' => 'user doesn\'t exist',
)

Earlier w/o patch I was getting:

$p = Array(
'bounce_type_id' => NULL,
'bouce_reason' => 'user doesn\'t exist',
)

@seamuslee001
Copy link
Contributor

Merging as per the tag

@seamuslee001 seamuslee001 merged commit 730e798 into civicrm:master Dec 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants