-
-
Notifications
You must be signed in to change notification settings - Fork 113
incoming TLS/SSL connections #9
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
Comments
Hi Bart - thanks for the interesting question. This isn't a use-case I'd considered before, but it could be useful to allow Gmail to send through OAuth-authenticated SMTP servers. It's odd that Gmail allows unencrypted connections at all, to be honest, but yes, 25, 465 and 587 are the only ports it permits for linked SMTP accounts. I'm assuming that you can handle the technical aspects of setting up certificates. Once that is done, it may be as simple as overriding As a side note, if you're doing this to link an O365 account to Gmail then it may not actually be necessary - while OAuth is supported for SMTP, it is not actually a requirement ("there are no plans to disable Basic Authentication for SMTP AUTH clients at this time"). Let me know how you get on - I'm happy to accept a pull request if you can get this working well. |
Hi, thanks for the info. I should be able to figure this out this weekend and will let you know and create a pull request if it works. Unfortunately, basic auth is disabled on my corporate account which is why I'm looking at alternatives 😉 |
I had a very quick look at this just now, and adding the following as a new method in the
|
Sorry for the delay. I received my new macbook last week and was busy configuring it. I added the function you proposed in combination with my let's encrypt certificates and this works great with gmail if I select connect over SSL, thanks. The only thing I'm still trying to figure out is what will happen if the script crashes. I would have hoped gmail would show me an immediate error upon trying to send an email. However, after killing the script manually it still shows the mail was sent. (this if of course beyond the scope of this script) |
After running this for a few hours, sending an email sometimes fails with the following error:
|
Thanks for the update and confirming that this tweak works. I'll push an update sometime soon with a way to optionally specify certificates in the configuration file. Regarding the You asked what happens if the script crashes - in my experience it doesn't crash (though sometimes individual threads fail and another one is created, as in the example above). It's a shame that Gmail doesn't show this correctly as an error, but you're right that this is unfortunately beyond the scope of the script. |
Just to follow up - I've committed in 6bf3b7e a way to specify local certificates/keys in the configuration file, but haven't yet looked at addressing the One option would be to explicitly handle these when using secure connections. There's an example in this test that is probably fairly easy to adapt. I don't use the proxy in the way you're hoping to, so can't really test this, but I'd happily accept a patch that fixes it. |
I've just updated the buffered-pre-authentication branch with a potential fix for the |
I've been using this with a local certificate for a fortnight or so with no issues, so am going to merge these changes. If there are any problems as a result, please reopen this issue. |
Hi Simon,
Thank you for your script. I managed to get everything up and running, but have hit a little snag. Right now, it only allows for unencrypted incoming connections. I want to use your script to allow gmail to use a different smtp server for sending mails. However, gmail only allows one of 3 ports to be used and unencrypted connections are only allowed on port 25. Unfortunately, port forwarding on this port is not allowed by my provider.
The only solution I can think of is adding support for connections over TLS/SSL to the script. Do you think this would be feasible and could you potentially give some pointers on where to start?
Cheers
Bart
The text was updated successfully, but these errors were encountered: