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

SecureSocketOptions are not transmitted to ConnectAsync method #45

Closed
Sylar-A opened this issue Oct 26, 2023 · 2 comments
Closed

SecureSocketOptions are not transmitted to ConnectAsync method #45

Sylar-A opened this issue Oct 26, 2023 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@Sylar-A
Copy link
Contributor

Sylar-A commented Oct 26, 2023

Hello!
I have a problem: mailkit.net.imap.imapprotocolexception the imap server has unexpectedly disconnected.
And i found a solution on stackoverflow: https://stackoverflow.com/questions/42292617/the-imap-server-has-unexpectedly-disconnected-using-993-port-and-mailkit
After that i started digging in your code and found an option to hand over this value from appsettings (if i clearly understand).

public SecureSocketOptions SocketOptions { get; set; } = SecureSocketOptions.Auto;

But there is a small problem that this parameter is not passed in method ConnectAsync on line 79:
await imapClient.ConnectAsync(ImapHost, ImapPort, SecureSocketOptions.Auto, cancellationToken).ConfigureAwait(false);

Could you please pass this parameter in method, please?
And if you do, please show an example of using this parameters in appsettings.
Best regards.

@danzuep
Copy link
Owner

danzuep commented Oct 27, 2023

Hi Sylar, thanks for pointing out that mistake. ImapReceiver.ConnectAuthenticatedImapClientAsync is currently being used instead of CreateImapClientAsync, but I've fixed it anyway in case someone does want to use it in the future.

I've added some more appsettings.json examples to the wiki now, let me know how it goes.

@Sylar-A
Copy link
Contributor Author

Sylar-A commented Oct 27, 2023

Hello again!
I've tested it and it works at the first blush. Thank you!

@danzuep danzuep self-assigned this Oct 28, 2023
@danzuep danzuep added documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Oct 28, 2023
@danzuep danzuep closed this as completed Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants