-
Notifications
You must be signed in to change notification settings - Fork 134
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
Citrus 4: MailServer only binds to loopback interface #1199
Labels
Comments
thanks for the report! definitely two bugs:
do you want to work on these and submit a PR or should I try and fix it if I find some time? |
bbortt
added a commit
to postfinance/citrus
that referenced
this issue
Aug 30, 2024
bbortt
added a commit
that referenced
this issue
Sep 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Citrus Version
4.x
Expected behavior
Mailserver binds to all interfaces, as in Citrus 3.x, or host is configurable
Actual behavior
Mailserver binds to loopback interface only and the host is not configurable
Test case sample
SMTP interception on a host which has its mail port bound to a non loopback interface. Upgrade from Citrus 3.x to 4.x.
When we upgraded from Citrus 3 to Citrus 4, our mail tests did not work anymore. The problem was due to the default behaviour of subethasmtp vs. GreenMail. In subethasmtp, when no host is given, the mail server binds to all interfaces, whereas GreenMail will bind only to loopback per default.
As the Citrus
MailServerBuilder
does not have functions to set the host manually, and theMailServer
initialises the GreenMail server with a hardcoded host value ofnull
, the CitrusMailServer
will only bind to the loopback interface and not receive Mails from another interfaces. This can be fixed by adding a host method to theMailServerBuilder
and setting the host value instead ofnull
for the GreenMail initialisation in the MailServer startup() functionOn a side note: it also seems that if you use the
smtp(GreenMail smtpServer)
method from theMailServerBuilder
, the given GreenMail server is overwritten in the MailServer startup() function as there is a missing null check before initialising a new GreenMail instance.The text was updated successfully, but these errors were encountered: