Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sending from gmail fails #132

Open
ArtZL opened this issue May 18, 2018 · 8 comments
Open

sending from gmail fails #132

ArtZL opened this issue May 18, 2018 · 8 comments

Comments

@ArtZL
Copy link

ArtZL commented May 18, 2018

I'm trying to send an email from a gmail account. Don't know why it fails. Any suggestions?

I know my user ID and password are ok because when I put in a bad ID, an error message says its a bad ID or pwd.

MY COMMAND LINE:
mailsend -v -f MyGmailAcct@gmail.com" -t Someone@Somewhere.com -starttls -port 587 -auth -smtp smtp.gmail.com -user MyGmailAcct@gmail.com -pass MyPassword -sub "Testing Art's Email" -disposition inline -attach "body.txt" -log "c:\temp\log.txt"

LOG FILE
17-May-2018 20:18:35.137: mailsend v@(#) mailsend v1.20b
17-May-2018 20:18:35.137: Connecting to smtp.gmail.com:587
17-May-2018 20:18:35.137: Will detect IPv4 or IPv6 automatically
17-May-2018 20:18:36.824: [S] 220 smtp.gmail.com ESMTP 15-v6sm2807902oix.25 - gsmtp
17-May-2018 20:18:36.825: [C] EHLO localhost

17-May-2018 20:18:37.827: [S] 250-smtp.gmail.com at your service, [2600:1702:27c0:42b0:99e:94d1:a4b0:cc67]
17-May-2018 20:18:37.828: [S] 250-SIZE 35882577
17-May-2018 20:18:37.828: [S] 250-8BITMIME
17-May-2018 20:18:37.829: [S] 250-STARTTLS
17-May-2018 20:18:37.830: [S] 250-ENHANCEDSTATUSCODES
17-May-2018 20:18:37.830: [S] 250-PIPELINING
17-May-2018 20:18:37.831: [S] 250-CHUNKING
17-May-2018 20:18:37.831: [S] 250 SMTPUTF8
17-May-2018 20:18:37.831: [C] STARTTLS

17-May-2018 20:18:38.827: [S] 220 2.0.0 Ready to start TLS
17-May-2018 20:18:40.825: [C] EHLO localhost

17-May-2018 20:18:41.823: [S] 250-smtp.gmail.com at your service, [2600:1702:27c0:42b0:99e:94d1:a4b0:cc67]
17-May-2018 20:18:41.824: [S] 250-SIZE 35882577
17-May-2018 20:18:41.824: [S] 250-8BITMIME
17-May-2018 20:18:41.824: [S] 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
17-May-2018 20:18:41.825: [S] 250-ENHANCEDSTATUSCODES
17-May-2018 20:18:41.825: [S] 250-PIPELINING
17-May-2018 20:18:41.825: [S] 250-CHUNKING
17-May-2018 20:18:41.825: [S] 250 SMTPUTF8
17-May-2018 20:18:41.826: Server does not support AUTH CRAM-MD5
17-May-2018 20:18:41.826: Using AUTH LOGIN
17-May-2018 20:18:41.826: [C] AUTH LOGIN

17-May-2018 20:18:42.825: [S] 334 VXNlcm5hbWU6
17-May-2018 20:18:42.826: [C] QXJ0TGllYmVybWFuQGdtYWlsLmNvbQ==

17-May-2018 20:18:43.828: [S] 334 UGFzc3dvcmQ6
17-May-2018 20:18:43.828: [C] QXJ0c0dvb2dsZUFjY3QhMQ==

17-May-2018 20:18:44.826: [S] 534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbuo
17-May-2018 20:18:44.827: Error: AUTH LOGIN failed: '534 5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbuo'
17-May-2018 20:18:44.827: Could not send mail

@muquit
Copy link
Owner

muquit commented May 18, 2018

Please login to the sender account in gmail and make sure that gmail is not blocking it. gmail does not allow sending mail from any "untrusted" app by default. If this is the case you have to configure gmail to allow it. Also if you are using windows, use double quotes around the sender's password.

Thanks.

@ArtZL
Copy link
Author

ArtZL commented May 18, 2018

Yes, you are correct. I have received an email from gmail saying they are blocking emails from this "untrusted" app. My program is used by churches who will be sending emails to their members. Some of those churches use Gmail for handling all of their email (incoming and outgoing). So, each church would have to "lower their shields" to allow untrusted apps. And they won't be willing to do that.

I'm just not sure what to do about this. Probably my only option would be to set up my own gmail account just for this purpose, and have all email from all churches come from this one account. Then use the -rt parameter with the church's actual email address.

@ArtZL
Copy link
Author

ArtZL commented May 18, 2018 via email

@muquit
Copy link
Owner

muquit commented May 18, 2018

gmail allows to generate an app specific password. This password can be used to send email instead of the regular user password. You can try that.

@ArtZL
Copy link
Author

ArtZL commented May 22, 2018 via email

@alejandro5042
Copy link

In addition,, you may want to look into services like https://sendgrid.com/ with its SMTP service.

@atesin
Copy link

atesin commented Jul 16, 2023

don't use "EHLO localhost" envelope

chances are your message (and maybe your account) will be blocked

how it works?? ... you send the mail:

EHLO localhost
blah
  • at this point, the mail server reads the HELO/EHLO hostname specified, and tries to resolve the IP address
  • then it looks the SRC_ADDR from the tcp/ip packets, from where your message were received, both addresses should match
  • if not, the message could be impersonating another sender/domain, the message could be dropped and the account blocked

suggestion: use a public domain that is correcty resolved from outside internet... your own domain, configured, or at least use some free ddns service/subdomain

@muquit
Copy link
Owner

muquit commented Jul 16, 2023

Did you try the option -domain ?

mailsend -h 
...
-domain    domain     - domain name for SMTP HELO/EHLO
...

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants