6

I tried to set up postfix with Google as its relay host but failed miserably.

Google switched to OAuth2 authentication and deprecated other authentication methods. This is why I tried to use the new OAuth2 authentication and not the old user/password one.

As far as I understand, postfix does not do any SASL authentication itself but relies on other applications like Cyrus SASL. And there exists a plugin for Cyrus doing OAuth2 authentication:

https://github.com/moriyoshi/cyrus-sasl-xoauth2

But from here on I'm lost. I do not understand how to configure postfix/cyrus correctly to use OAuth2 authentication.

I managed to set up getmail to fetch mail from Google using OAuth2 authentication. And I was hoping that it would be not much more difficult to do the same with postfix and Cyrus. But I think I was wrong.

It's difficult to ask specific questions. I changed the configuration files so many times that I probably screwed it up completely.

But I was wondering if there exists more documentation on how to configure postfix to use a relay host with OAuth2 authentication?

Andreas Matthias
  • 201
  • 1
  • 3
  • 5

1 Answers1

2

http://mmogilvi.users.sourceforge.net/software/oauthbearer.html has instructions. They are long and have many opportunities to fail. Even if you succeed, consider how much of your life will be spent tending/debugging it, to decide whether it is worth your effort.

This becomes a big deal in February 2021 when GMail will begin requiring OAuth2 for email relay.

Unless you really have to relay email via GMail, consider signing up for Amazon SES, SendInBlue, or other SMTP email relay service which permits ID/password authentication. For low volume senders, they cost from $0 to $0.10 per month.