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

@MailerName not working with different SMTP servers #36567

Closed
wansors opened this issue Oct 19, 2023 · 4 comments · Fixed by #36571
Closed

@MailerName not working with different SMTP servers #36567

wansors opened this issue Oct 19, 2023 · 4 comments · Fixed by #36571
Labels
area/mailer kind/bug Something isn't working
Milestone

Comments

@wansors
Copy link

wansors commented Oct 19, 2023

Describe the bug

Quarkus fails to send emails using different SMTP servers when using: @MailerName

The config is readed ok by quarkus, however the problem is that the SMTPConnectionPool returns always the same connection with the same MailConfig. Making all @MailerName to use the same connection.

image

Expected behavior

Each @MailerName should use its own SMTPConnectionPool. And send the emails using each connection

Actual behavior

Each @MailerName share the same SMTPConnectionPool. And send the emails using only one connection

How to Reproduce?

Use the code on:
https://github.com/wansors/quarkus-multiple-mailers-test

Try sending emails on dev using the endpoints:
http://localhost:8080/smtp/send/1 http://localhost:8080/smtp/send/2

One @MailerName is using an incorrect port, however mails are send anyway because the vertex SMTPConnectionPool returns always the same config

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

3.4.3

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@wansors wansors added the kind/bug Something isn't working label Oct 19, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 19, 2023

/cc @cescoffier (mailer)

@cescoffier
Copy link
Member

Thanks for the reproducer. How do you run the smtp server?

@cescoffier
Copy link
Member

Sorry, you are using mail pit! That's great!

@cescoffier
Copy link
Member

I have the fix.

cescoffier added a commit to cescoffier/quarkus that referenced this issue Oct 19, 2023
@quarkus-bot quarkus-bot bot added this to the 3.6 - main milestone Oct 19, 2023
@gsmet gsmet modified the milestones: 3.6 - main, 3.5.1 Oct 26, 2023
gsmet pushed a commit to gsmet/quarkus that referenced this issue Oct 26, 2023
holly-cummins pushed a commit to holly-cummins/quarkus that referenced this issue Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mailer kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants