News for hackers. Stuff that matters.
Re:Email and Git = <3 by oefrha on Thursday October 12, 2023 @08:29AM (#37856264)
You left out the entire configure SMTP step. Honestly I’m not even sure how to do that if your SMTP server requires 2FA and does not allow legacy app specific passwords.
Re:Email and Git = <3 by rascul on Thursday October 12, 2023 @08:37AM (#37856337)
There are instructions provided for Gmail and some others:

https://git-send-email.io/#step-2

A tool from Google is mentioned and linked to:

https://github.com/google/gmail-oauth2-tools/tree/master/go/...

Re:Email and Git = <3 by oefrha on Thursday October 12, 2023 @08:42AM (#37856380)
That uses app specific passwords, and with Google Workspace, the administrator can completely turn off these “less secure apps”. Pretty sure Office 365 has the same.
Re:Email and Git = <3 by trws on Thursday October 12, 2023 @09:31AM (#37856874)
Sadly you’re right. Microsoft has brainwashed many IT departments into forcing oauth on everything, no app specific passwords, no regular passwords, nothing else. Thankfully they do support this on imap and smtp, but you have to have something that can handle it. I use a modified version of isync with the sasl plugin to fetch mail, and a python smtp sender that supports the oauth flow along with a set of scripts for generating a new refresh token every few months. It’s a heck of a lot of stuff to maintain, but at least it works. If anyone’s interested I could provide links or upload the modified versions to fix o365 quirks.
Re:Email and Git = <3 by andris9 on Thursday October 12, 2023 @10:08AM (#37857381)
Multiple enterprise customers use my software (https://emailengine.app) because it can proxy OAuth2-enabled IMAP/SMTP connections as regular password-based sessions. Turns out there are a lot of legacy, like all kinds of cron scripts, that want to connect to some IMAP account to check and do something. It all breaks down once the organisation enforces OAuth for their email. So, personally, I don't like it at all, but as a software developer, I'm really happy about it. Helps with my sales effort :P
Re:Email and Git = <3 by trws on Thursday October 12, 2023 @12:59PM (#37859839)
Oh that’s pretty cool, thanks for the link. I’ve used davmail as a proxy like this, just for the oauth support, but it doesn’t scale to large mailboxes or high traffic well at all. May forward this along for some of our internal services people.
Re:Email and Git = <3 by sir on Friday October 13, 2023 @02:13AM (#37867305)
You can also use this (locally-hosted) proxy of mine which transparently adds OAuth 2.0 support to any IMAP/POP/SMTP client: https://github.com/simonrob/email-oauth2-proxy.
Re:Email and Git = <3 by bombcar on Thursday October 12, 2023 @09:17AM (#37856753)
There’s another method that doesn’t use app specific passwords but I’m not entirely sure how it DOES work - it opens a connection and then gives you a web address to go to in your browser to authenticate with 2fa. And then somehow it magically works until it decides it doesn’t like you anymore.
Re:Email and Git = <3 by oefrha on Thursday October 12, 2023 @09:27AM (#37856847)
[delayed]
Re:Email and Git = <3 by bombcar on Thursday October 12, 2023 @10:04AM (#37857318)
I've always assumed that the server side stores as much information about the client as it can, so not just "username/password" but source IP, client headers, etc and somehow uses that as a "session token".
Re:Email and Git = <3 by rascul on Thursday October 12, 2023 @09:27AM (#37856837)
The tool from Google that is linked to appears to use oauth2.
Re:Email and Git = <3 by tlamponi on Thursday October 12, 2023 @08:33AM (#37856304)
Every mail server/provider that provides 2FA that I used allows for configuring "tokens" (called a bit different everywhere) which are a high entropy random string, and some of them require TFA only for IMAP or POP, i.e., getting mail, not SMTP, i.e., sending mail.
Re:Email and Git = <3 by sir on Friday October 13, 2023 @02:09AM (#37867273)
If you use this proxy of mine then any IMAP (or POP/SMTP) client can be used with a “modern” email provider, regardless of whether it supports OAuth 2.0 natively: https://github.com/simonrob/email-oauth2-proxy. No need for your client to know about OAuth at all.