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

Hotmail Email Proxy - Cannot Establish Connection #334

Open
gabs-csiro opened this issue Mar 1, 2025 · 3 comments
Open

Hotmail Email Proxy - Cannot Establish Connection #334

gabs-csiro opened this issue Mar 1, 2025 · 3 comments

Comments

@gabs-csiro
Copy link

HI Simon,
I'm really interested in using your email proxy to authenticate with my email accounts. Specifically, Hotmail.
I've set it up quite basic:

[IMAP-1993]
documentation = *** note: this server will work for both Office 365 and personal Outlook/Hotmail accounts ***
server_address = outlook.office365.com
server_port = 993
local_address = 127.0.0.1

[POP-1995]
documentation = *** note: this server will work for both Office 365 and personal Outlook/Hotmail accounts ***
server_address = outlook.office365.com
server_port = 995
local_address = 127.0.0.1

[SMTP-1587]
documentation = *** note: this server will work for both Office 365 and personal Outlook/Hotmail accounts ***
server_address = smtp-mail.outlook.com
server_port = 587
server_starttls = True
local_address = 127.0.0.1

[<Hotmail Address>]
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
redirect_uri = http://localhost
client_id = <generated using Azure account>

I'm using it via Docker (https://github.com/blacktirion/email-oauth2-proxy-docker) and I can see the log file which indicates all good:

2025-03-01 08:29:06,017: Initialising Email OAuth 2.0 Proxy (version 2024-11-13) in debug mode from config file /config/emailproxy.config
2025-03-01 08:29:06,085: Starting IMAP server at 127.0.0.1:1993 (unsecured) proxying outlook.office365.com:993 (SSL/TLS)
2025-03-01 08:29:06,136: Starting POP server at 127.0.0.1:1995 (unsecured) proxying outlook.office365.com:995 (SSL/TLS)
2025-03-01 08:29:06,137: Starting SMTP server at 127.0.0.1:1587 (unsecured) proxying smtp-mail.outlook.com:587 (STARTTLS)
2025-03-01 08:29:06,142: Initialised Email OAuth 2.0 Proxy - listening for authentication requests. Connect your email client to begin

It accepts the connection, but then immediately closes it, not sure what I'm doing wrong?

> telnet 127.0.0.1 1993
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
@simonrob
Copy link
Owner

simonrob commented Mar 3, 2025

Please post the log from the proxy in --debug mode so we can see whether it is actually receiving a connection attempt.

@gabs-csiro
Copy link
Author

That's all I see in the log, it is currently running in debug mode:

Image

@simonrob
Copy link
Owner

simonrob commented Mar 5, 2025

Do you have anything else listening on localhost?

It may also be worth trying listening on a different address given the Docker layer that you're connecting through.

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