I am trying to use s-nail with gmail smtp server to send mail from my aws vps. With outgoing firewall being opened to 587, I believe the error I am getting is due to my gmail account not recognizing the smtp host.
SMTP Host- Ubuntu Server 18.04 on AWS
echo -e "Email content" | s-nail -v -s "Email subject" -S smtp-use-starttls -S ssl-verify=ignore -S smtp-auth=login -S smtp=smtp://smtp.gmail.com:587 -S from="Me" -S firstname.lastname@example.org -S smtp-auth-password=password -S ssl-verify=ignore -S nss-config-dir=~/.certs email@example.com
s-nail: Loading /etc/s-nail.rc s-nail: No such file to load: /home/energi/.mailrc s-nail: Setting up PseudoRandomNumberGenerator: *SSL RAND_* s-nail: Obsoletion warning: Use of old-style credentials, which will vanish in v15! Please read the manual section "On URL syntax and credential lookup" s-nail: Obsoletion warning: please don't use *smtp*: assign a smtp:// URL to *mta*! s-nail: Resolving host smtp.gmail.com:587 ... done s-nail: Connecting to 22.214.171.124:587 ... connected. s-nail: smtp-server: 534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbsxgg9BB4ZxqT48Qwxgc8cTPMp0x_U0gxxHM2tGek8csEZ2sizt0IElRkg_...._.....etcetc smtp-server: 534-5.7.14 Please log in via your web browser and then try again. smtp-server: 534-5.7.14 Learn more at smtp-server: 534 5.7.14 https://support.google.com/mail/answer/78754 b73sm2170494ywe.28 - gsmtp
Here is what I have done,
-Copied link (in above error) via putty client on Windows to Firefox, then verified it was me. However, I believe I have to be on the host, which I am using Ubuntu Server 18.04 with no GUI. Ubuntu Host is on AWS VPS and Windows Host is on my local laptop.
-I have allowed less secured apps. I don't want to but I did enable. Can I re enable?
Current Result: everytime command executed, I get the error, even when I verified. No email sent.
Expected Result: execute command from Ubuntu Server host and recieve test email.