Starting May 1, 2025, Google Workspace accounts no longer support less secure apps, third-party apps, or devices that ask you to sign in to your Google Account with your username and password. You must use OAuth to let these apps and devices access your account.
Now there are a variety of ways to deal with this issue such as setting up a google SMTP Relay, which I did in 2017 and now google wants you to use oauth which means any google workspace account has to have 2FA enabled and you need to setup app passwords.
To generate an app password first enable 2FA if you have not. Once that is setup and configured you can use the link below to create an app password for the SMTP Server.
https://myaccount.google.com/apppasswords
For the sake of this documentation let's say it is Account created in December 2023. It is a 16 character password that you will need to copy and keep somewhere safe. Let's say it is the password shown directly below.
YTLE PUYV LHMW QXBT
So in our relay server you want to find the auth file for the relay server, which if you followed my Tutorial Creating a GMAIL SMTP Relay Server Using Ubuntu On Hyper-V, is in
/etc/mail/authinfo
Edit gmail-auth, and update the AuthInfo with the following:
AuthInfo:smtp-relay@gmail.com "U:$ComputerUsername" "I:$GoogleEmailAddress" "P:$PASSWORD"
and save the file. ***NOTE *** There should be no spaces in the password.
Once done recompile sendmail using sudo sendmailconfig and you can test using
echo "subject: test email" | sendmail -v $emailAddress
That is it your done. You now have an update SMTP Relay server that is in compliance with Google's new security policies.