TFA and Mails stopped working

CMS Version

4.2.2, docker, installed on Ubuntu 24.04 LTS

Issue

We receive the error “Unable to send two factor code to email address associated with this user” when trying to login with TFA.
It seems that the error is from CMS side.
Sending mail through command line works.
E-Mail alerts are also not being sent.

On version 4.2.1 only Alerts were not sent from CMS and one time the TFA stopped working, but a reboot of the server repaired this problem.
At the beginning of 4.2.2 everything was working fine, but actually for around one week neither TFA nor Alerts are working.
I have a second installation on a 22.04 LTS machine where I have the same problem. That’s why I think that it is caused by CMS.
We use google workspace for Mails but I have not changed anything.
How can I debug that to find a solution? In /var/log/mail.log and …mail.err there are no errors.

I have already investigated 2 days in searching the cause, but without success. Now I need help because I have no idea.

Thank you,

Zoran

After 4 days of troubleshooting I do not have any idea why xibo does not send the mails.
Does anyone have an idea how to debug that to find out why TFA and alert mails are not working?
It just stopped on April, 2nd without any changes from my side.

Thanks,
Zoran

I solved it (at least TFA):

First of all: We use google workspace for mails and have one “server account” for system mails.
Based on the google smtp relay documentation I added a routing configuration (SMTP Relay Google).
Then I configured 2-factor-authenitifaction for the server account.
In these settings you can add applications with separate passwords, where I added xibo

In config.env add these credentials:
CMS_SMTP_SERVER=smtp-relay.gmail.com:587
CMS_SMTP_USERNAME=[username@yourdomain]
CMS_SMTP_PASSWORD=[theapppassword]

Now TFA works.