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

EmailSender: failure to send mail if SMTP servers do not use authentication #31

Open
pjdvolde opened this issue Mar 18, 2022 · 2 comments

Comments

@pjdvolde
Copy link

pjdvolde commented Mar 18, 2022

Hi all,

When using the EmailSender stage in a pipeline at our hospital, when triggered we get the following error message:
09:37:26 INFO [EmailService] EmailService: Unable to establish connection to 192.168.xxx.xxx

Our SMTP server does not use authentication at the moment.

When debugging through adding a trace on the network packets ( netsh trace start capture=yes IPv4.Address=192.168.xxx.xxx) and converting the resulting trace file we get the following result in Wireshark.
535 5.7.0 authentication failed

This leads to believe that somehow authentication is triggered.

On the remark on the configuration tab for EmailService, under 'User name' it is mentioned that "If blank, no authentication is done."

If I follow the code, I get to 'CTP/source/java/org/rsna/ctp/stdstages/email/EmailSender.java' on lines 27-41

public EmailSender(String smtpServer, String smtpPort, String senderUsername, String senderPassword, boolean tls) { this.smtpServer = smtpServer; this.senderUsername = senderUsername; this.senderPassword = senderPassword; Properties props = System.getProperties(); props.put("mail.smtp.host", smtpServer); if (smtpPort != null) props.put("mail.smtp.port", smtpPort); props.put("mail.smtp.starttls.enable", Boolean.toString(tls)); if ((senderUsername != null) && (senderPassword != null)) { props.put("mail.smtp.auth", "true");

Is it possible that both senderUsername and senderPassword are evaluated as string and so will allways be evaluated to be True on line 40?

This would trigger authentication to be used always?

Thanks in advance for looking into it (and for the tool in general of course !)
Pieter

@johnperry
Copy link
Owner

johnperry commented Mar 19, 2022 via email

@pjdvolde
Copy link
Author

Hi John,
thanks so much.
Works as a charm!
Pieter

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

2 participants