simonrob/email-oauth2-proxy

[WinError 10057]

Closed this issue · 7 comments

Hi, i used email-oauth2-proxy with windows 10 IoT LTSC 2021 bulid 19044.6093 with error :

2025-07-27 19:16:48,120: Accepting new connection from 127.0.0.1:51863 to IMAP server at 127.0.0.1:1993 (unsecured) proxying outlook.office365.com:993 (SSL/TLS)
2025-07-27 19:16:49,692: Accepting new connection from 127.0.0.1:51870 to IMAP server at 127.0.0.1:1993 (unsecured) proxying outlook.office365.com:993 (SSL/TLS)
2025-07-27 19:16:50,009: Accepting new connection from 127.0.0.1:51871 to IMAP server at 127.0.0.1:1993 (unsecured) proxying outlook.office365.com:993 (SSL/TLS)
2025-07-27 19:16:50,033: IMAP (127.0.0.1:1993) Caught connection error (server) [ Client attempted to send command without waiting for server greeting ] - OSError : [WinError 10057] A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied
2025-07-27 19:16:50,038: Accepting new connection from 127.0.0.1:51876 to IMAP server at 127.0.0.1:1993 (unsecured) proxying outlook.office365.com:993 (SSL/TLS)
2025-07-27 19:16:50,045: IMAP (127.0.0.1:1993) Caught connection error (server) [ Client attempted to send command without waiting for server greeting ] - OSError : [WinError 10057] A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied
2025-07-27 19:16:50,051: Accepting new connection from 127.0.0.1:51878 to IMAP server at 127.0.0.1:1993 (unsecured) proxying outlook.office365.com:993 (SSL/TLS)
2025-07-27 19:16:50,061: IMAP (127.0.0.1:1993) Caught connection error (server) [ Client attempted to send command without waiting for server greeting ] - OSError : [WinError 10057] A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied

did have answer to fix it?

The issue is mentioned there in the error message: your client needs to wait for the server greeting before trying to send anything.

thanks for reply,
my config is here:

[IMAP-1993]
server_address = outlook.office365.com
server_port = 993
local_address = 127.0.0.1

[POP-1995]
server_address = outlook.office365.com
server_port = 995
local_address = 127.0.0.1

[SMTP-1587]
server_address = smtp.office365.com
server_port = 587
server_starttls = True
local_address = 127.0.0.1

[.......@hotmail.com]
permission_url = https://login.microsoftonline.com/common/oauth2/v2.0/authorize
token_url = https://login.microsoftonline.com/common/oauth2/v2.0/token
oauth2_scope = https://outlook.office.com/IMAP.AccessAsUser.All https://outlook.office.com/POP.AccessAsUser.All https://outlook.office.com/SMTP.Send offline_access
client_id = xxx
redirect_uri = https://localhost:8080

[emailproxy]
delete_account_token_on_password_error = True
encrypt_client_secret_on_first_use = False
use_login_password_as_client_credentials_secret = False
allow_catch_all_accounts = False

did i had error? but i use windows mail and calender

The issue is with your client, not the proxy. Try the telnet debugging approach outlined in the readme and you should find that things work fine.

the new error is there:

2025-08-01 12:03:46: IMAP (127.0.0.1:1993) Caught client exception; server connection closed before data could be sent
2025-08-01 12:03:46: Warning: IMAP server at 127.0.0.1:1993 (unsecured) proxying outlook.office365.com:993 (SSL/TLS) unable to remove orphan client connection <__main__.IMAPOAuth2ClientConnection 127.0.0.1:59267 at 0x1a572c48750>
2025-08-01 12:03:46: IMAP (127.0.0.1:1993) Caught client exception; server connection closed before data could be sent
2025-08-01 12:03:46: Warning: IMAP server at 127.0.0.1:1993 (unsecured) proxying outlook.office365.com:993 (SSL/TLS) unable to remove orphan client connection <__main__.IMAPOAuth2ClientConnection 127.0.0.1:59267 at 0x1a572c48750>
2025-08-01 12:03:46: IMAP (127.0.0.1:1993) Caught client exception; server connection closed before data could be sent
2025-08-01 12:03:46: Warning: IMAP server at 127.0.0.1:1993 (unsecured) proxying outlook.office365.com:993 (SSL/TLS) unable to remove orphan client connection <__main__.IMAPOAuth2ClientConnection 127.0.0.1:59267 at 0x1a572c48750>
2025-08-01 12:03:46: IMAP (127.0.0.1:1993) Caught client exception; server connection closed before data could be sent
2025-08-01 12:03:46: Warning: IMAP server at 127.0.0.1:1993 (unsecured) proxying outlook.office365.com:993 (SSL/TLS) unable to remove orphan client connection <__main__.IMAPOAuth2ClientConnection 127.0.0.1:59267 at 0x1a572c48750>
2025-08-01 12:03:46: IMAP (127.0.0.1:1993) Caught client exception; server connection closed before data could be sent
2025-08-01 12:03:46: Warning: IMAP server at 127.0.0.1:1993 (unsecured) proxying outlook.office365.com:993 (SSL/TLS) unable to remove orphan client connection <__main__.IMAPOAuth2ClientConnection 127.0.0.1:59267 at 0x1a572c48750>
2025-08-01 12:03:46: IMAP (127.0.0.1:1993) Caught client exception; server connection closed before data could be sent
2025-08-01 12:03:46: Warning: IMAP server at 127.0.0.1:1993 (unsecured) proxying outlook.office365.com:993 (SSL/TLS) unable to remove orphan client connection <__main__.IMAPOAuth2ClientConnection 127.0.0.1:59267 at 0x1a572c48750>
2025-08-01 12:03:47: Accepting new connection from 127.0.0.1:59269 to IMAP server at 127.0.0.1:1993 (unsecured) proxying outlook.office365.com:993 (SSL/TLS)

can i configuration id for entra or azure please???

hello?

This is an open source tool, and any support offered is entirely out of goodwill. There's no obligation to help fix problems. If you want commercial level support please either sponsor this project or move to the proxy's sponsor.

thank you