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

Could not work sending mail via mailgun. #504

Closed
dutzhk opened this issue Sep 13, 2018 · 6 comments
Closed

Could not work sending mail via mailgun. #504

dutzhk opened this issue Sep 13, 2018 · 6 comments

Comments

@dutzhk
Copy link

dutzhk commented Sep 13, 2018

Describe the bug
Configured mailgun correctly, but could not send mail. This is the log output. I've included also an older line of log that warns of a leaked connection to the api mailgun. I think this is another issue, but thought it would be useful to paste it here also.

Sep 13, 2018 9:18:32 AM okhttp3.internal.platform.Platform log
WARNING: A connection to https://api.mailgun.net/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
11:38:17.086 [QuartzScheduler_Worker-9] WARN alfio.manager.system.MailgunMailer - sending email was not successful:Response{protocol=http/1.1, code=404, message=NOT FOUND, url=https://api.mailgun.net/v2/website.ro/messages}
11:42:03.051 [QuartzScheduler_Worker-2] WARN alfio.manager.system.MailgunMailer - sending email was not successful:Response{protocol=http/1.1, code=404, message=NOT FOUND, url=https://api.mailgun.net/v2/website.ro/messages}

Also the mailgun api url is old, the new one is v3: https://api.mailgun.net/v3/website.ro/messages

To Reproduce
Steps to reproduce the behavior:
Configure mailgun api, then try sending reservation email. Mail never received.

Expected behavior
Well, to send mail :). Confirgured SMTP option with mailgun and works flawless.

@syjer
Copy link
Member

syjer commented Sep 13, 2018

Hi @dutzhk , I've pushed a fix for the leaked connection, thanks for opening the issue.

About the mailgun api: I tried on the demo platform and it works correctly, so maybe there is some configuration issue on your side? (most likely the mailgun domain or some mismatch with the mailgun email sender ?)

About the v2 api url, it should work (as they have kept the backward compatibility see https://www.mailgun.com/blog/default-api-version-now-v3 ).

@syjer
Copy link
Member

syjer commented Sep 13, 2018

@dutzhk maybe I found the issue, could it be that it expect to use the EU region?

So the base api should be https://api.eu.mailgun.net. I'll a look to add as a configuration parameter.

@dutzhk
Copy link
Author

dutzhk commented Sep 13, 2018

Hey @syjer, thank you for answering.

Will try again, I surely made a mistake somewhere along the road with the configuration of the api. I did not use regional sending, just standard US. Also thought they would keep the backward compatibilty but I just pointed out as I wasn't sure.

Best regards!

@syjer
Copy link
Member

syjer commented Sep 13, 2018

I've pushed the EU region choice and updated the api endpoint to the v3. They will be available in the 1.16 release.

:) Even if it's not your issue, it's a nice thing to have.

@dutzhk
Copy link
Author

dutzhk commented Sep 13, 2018

I agree, it's a nice to be able to use regional sending, especially if you have great volume.
The issue was at my side, a simple mismatch of the mailgun domain. I should have looked closer :) It works great

@cbellone
Copy link
Member

Hi @dutzhk,
I am closing this as the leak has been fixed. Thanks for reporting it! 👍

FYI, mailgun opened the regional (EU) service mainly for GDPR compliance.
If you're going to use alf.io within the EU, for EU customers, I think it would be better for you to switch to regional sending

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

No branches or pull requests

3 participants