SMTP configuration for email services using 2FA

Does Tryton support using email services which require 2FA such as O365 and Gmail?

The organisation that I am assisting in migrating their legacy accounting system has their domain email set up under O365. In the past I have put up a separate outgoing OpenSMTPd server to connect the legacy accounting system to using a subdomain, but even with DKIM+SPF there are times that outgoing email is rejected due to reputation of IP.

So the desire is to use the primary domain’s email address for sending out invoices and purchase orders. Is there a way to configure this with Tryton? Perhaps with App Passwords:

Enforce Microsoft Entra multifactor authentication with legacy applications using app passwords

advTHANKSance

Not sure if it makes sense for a machine to do 2FA.
Any way no, the sendmail of trytond supports only SMTP Authentication supported by smtplib.
Normally such services should provide password for application.

I would suggest to keep using an OpenSMTPD close to the Tryton server to behave as a proxy/queue for the external email server because the 2-phase commit implemented for sending email is not strong enough to recover from abrupte disconnection. So having OpenSMTPD managing a keep may prevent loosing emails.

For similar problems (Google Apps) , I had set up in the past postfix and works just fine.
Search for “postfix o365 relay”

1 Like

We use gmail accounts with 2FA enabled for sending mails from tryton using standard autentification. For this case you need to generate an autentification token that will be used as password and then setup STMP as any other client.

1 Like