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

Forwaring rule to server with STARTTLS not supported #85

Closed
osjoberg opened this issue Oct 23, 2017 · 1 comment
Closed

Forwaring rule to server with STARTTLS not supported #85

osjoberg opened this issue Oct 23, 2017 · 1 comment

Comments

@osjoberg
Copy link

osjoberg commented Oct 23, 2017

Thank you for Papercut! We use Papercut during development, and use forwarding rules to debug complicated email layouts on smartphones.

However, our SMTP server (Exchange) does not support SSL, it supports STARTTLS.

If I change RelayRuleExtensions:35 from

client.Connect(forwardRule.SmtpServer, forwardRule.SmtpPort, forwardRule.SmtpUseSSL);

to

client.Connect(forwardRule.SmtpServer, forwardRule.SmtpPort, forwardRule.SmtpUseSSL ? SecureSocketOptions.Auto : SecureSocketOptions.None);

it works with our SMTP server. However I am not too familiar with the SMTP protocol or MailKit. It is possible that SecureSocketOptions.Auto may fail the negotiation where SecureSocketOptions.SslOnConnect would have worked.

Maybe there should be an option to explicitly select STARTTLS for the rules?

@osjoberg
Copy link
Author

osjoberg commented Oct 23, 2017

Follow up thought: System.Net.Mail.SmtpClient.EnableSsl does not seem to make a distinction between STARTTLS or SSL. When you set EnableSsl to true you actually tell the client to negotiate the encryption with the SMTP server. The developer does not need to know what type of encryption that is used. If MailKit SmtpClient can negotiate as well as System.Net.Mail.SmtpClient, the fix suggested above should be enough to solve this issue without complicating the user interface.

@Jaben Jaben closed this as completed in 595e69c Dec 6, 2017
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

1 participant