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

Missing IsValid email validation causes issues after upgrading from 4.12 to 4.20 #385

Closed
jacobfederer opened this issue Feb 6, 2025 · 5 comments · Fixed by #386
Closed

Comments

@jacobfederer
Copy link

Dear mailgun-go contributors,

We recently upgraded mailgun-go from v4.12 to v4.20. With this change the IsValid parameter seems not to be filled at all anymore and leads our code to reject any new registration. Upon investigation and as stated in the issue #265 this might be caused due to inconsistencies between the api response and what mailgun-go expects to read. This seems to still be an active issue in newer versions.

Here is the actual api response:

{
    "address": "xyz@gmail.com",
    "engagement": {
        "engaging": true,
        "is_bot": false
    },
    "is_disposable_address": false,
    "is_role_address": false,
    "reason": [],
    "result": "deliverable",
    "risk": "low",
    "root_address": "xyz@gmail.com"
}

Is the IsValid parameter deprecated? Or can this issue be fixed by Mailgun?

Greetings,
Jacob

@vtopc
Copy link
Contributor

vtopc commented Feb 6, 2025

Here is the actual api response:

Hey. What endpoint are you calling?

@jacobfederer
Copy link
Author

This result is from the maligun website: Mailgun -> Validate -> Single Validation .

The tool there calls: https://api.mailgun.net/v4/address/validate?address=xyz%40gmail.com. The Golang client seems to call the same endpoint.

@vtopc
Copy link
Contributor

vtopc commented Feb 6, 2025

I see. is_valid never was present in https://api.mailgun.net/v4/address/validate only in https://api.mailgun.net/v3/address/validate.

I added engagement data and deprecated the v3 validation in v4.14.0 and v4.15.0.

I'll contact the backend team and ask if they could add is_valid field to v4 or if it is possible to backfill it in SDK.
Till then, I would recommend downgrading to https://github.com/mailgun/mailgun-go/releases/tag/v4.13.0 or calling https://api.mailgun.net/v3/address/validate directly. As v3 validation is deprecated, we will not add it back to SDK.

@vtopc
Copy link
Contributor

vtopc commented Feb 6, 2025

Caused by #218

@vtopc
Copy link
Contributor

vtopc commented Feb 6, 2025

Fixed in https://github.com/mailgun/mailgun-go/releases/tag/v4.22.1, but you should consider switching to Risk field, as IsValid would be totally removed in github.com/mailgun/mailgun-go/v5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants