# Sendmail + OAuth2 - possible?



## jwdevel (Jun 7, 2022)

For a long time, I have my Sendmail configured to relay some messages through Gmail.
This worked fine, using Cyrus-SASL, `SMART_HOST` and an `authinfo` file.

However, today it stopped working, and from research I learn that Google is turning off that method of authentication — no more plain SMTP authentication for Gmail.
Now, I need to use OAuth2, it seems ):

Let me just get ahead of some likely responses:

I realize that various specific programs and email clients, such as `mutt`, have support for OAuth2. They typically have special-case handling for it built in, and require interactive login with a browser. That is _not_ what I'm looking for.


I am interested in configuring Sendmail to do this as automatically as possible. The best guide on this sort of thing I have seen so far has been for Postfix (link), but I'm hoping to hear from people with Sendmail experience.


I am primarily interested in _sending_ mail (relay, SMTP). I don't care as much about receiving (IMAP).

The most straightforward path I've seen is to try to use this plugin for Cyrus-SASL to support OAuth2. Has anyone been able to use that on FreeBSD?

Or have any other ideas or experiences?

Thanks for any help!


----------



## kpedersen (Jun 7, 2022)

One approach is to run a proxy:

http://davmail.sourceforge.net/

This (Java based) service will authenticate via the non-standard webby oauth2 stuff once (a bit of a faff). Store the token thingy but then proxy the standard protocols (SMTP, POP3, IMAP) across.


----------

