Configuring Gmail as Sendmail email relay - LinuxConfig.org

GalaxyNet

Getting Error:
Jul 1 10:47:09 ubuntu sm-mta[16763]: AUTH=client, relay=gmail-smtp-msa.l.google.com., temporary failure, connection abort
Jul 1 10:47:10 ubuntu sm-mta[16763]: u615l8ev016761: to=myemail@hotmail.com, ctladdr=root@ubuntu (0/0), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=120357, relay=gmail-smtp-msa.l.google.com. [74.125.206.108], dsn=4.0.0, stat=Deferred: Temporary AUTH failure

I have confirmed that the id/pass is ok, and allow less secure app is also turned on, i can use the same id from other devices fine, only sendmail not sending. what could be the cause?

dinojedi

Great tutorial.
On my Ubuntu after created I cannot change the permissions in mkdir -m 700 /etc/mail/authinfo/.
My Ubuntu use a SSH certificate and has not the root password (I cannot do su, only sudo).
Maybe is better to setup a 777 and at the end of configuration change to 700.

Rennann Maxxx

Hello greetings!
How to use yahoo or gmx instead of gmail?

Just publicly post your email address here and you will get more email than you can handle, or course most of it will be spam!

Not working…

No worthy mechs found
AUTH=client, available mechanisms do not fulfill requirements

The option to enable “less secure apps” is no longer available with Gmail. There is a workaround with 2-Step verification enabled. After enabling 2-Step verification, the option App Passwords becomes available for the Google Account. You can generate a new application password to replace the password in the “gmail-auth” file, which allows Sendmail to work without verification.

AuthInfo: “U:root” “I:YOUR GMAIL EMAIL ADDRESS” “P:APP PASSWORD”

After stepping through the process above (and using the app password for Gmail account due to recent changes in Gmail ‘less secure apps’ access), still unable to send from Linux Unbuntu install. Following error message returned after simple echo message to mail command:

msmtp: no recipients found
mail: Sending data to /usr/bin/msmtp failed: Process exited with a non-zero status
mail: cannot send message: Process exited with a non-zero status

Hi Shawn_Eingle,

Welcome to our forums.

Did you provide recipient(s) for your test mail? Following the syntax in the guide, you need to provide it as the last argument:

$ echo "Mail body here" | mail -s "Mail suject here" <recipient e-mail address here>

The first line of your error message suggests that recipient address is missing from your test.