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 email via gmail SMTP requires to "Allow less secure apps: YES" -> is solution to use PHPMailer? #8613

Closed
mattab opened this issue Aug 20, 2015 · 15 comments
Labels
answered For when a question was asked and we referred to forum or answered it. c: Website matomo.org For issues related to our matomo.org website. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@mattab
Copy link
Member

mattab commented Aug 20, 2015

This issue is about improving this FAQ: How do I send Piwik emails using Gmail SMTP server?

While setting it up today, I noticed that i was getting an error when sending a scheduled report

An error occured while sending 'HTML Email Report - 2.2015-08-20.101.en.html' to xxxxxxxxxxxxxxx@gmail.com. Error was '5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbucv 5.7.14 -v6FnaqYk_3-5- 5.7.14 UQGVqm7Gvg1qMTL70m9YF2_kcoVxK-eN_d9aPG5hrzzCtiG 5.7.14 5edES-qhoae2YHyGn3bqFQnBQ 5.7.14 8BFlMxvMs_RBCEP62jWESOR-fuYk> Please log in via your web browser and 5.7.14 then try again. 5.7.14 Learn more at 5.7.14 https://support.google.com/mail/answer/78754 cd16sm31949626wib.19 - gsmtp'#0 [internal function]

To resolve this issue I had to go to:

allow less secure apps

Steps

  • what does it mean to be less secure app? could we change our FAQ instructions and/or implementation so that users do not need to do this extra step?
  • if not possible, we should at least document in FAQ that user also need to change the setting on their google security account
@mattab mattab added the c: Website matomo.org For issues related to our matomo.org website. label Aug 20, 2015
@tsteur
Copy link
Member

tsteur commented Aug 21, 2015

I didn't have to do this I think. Did you use ssl and port 465?

@mattab
Copy link
Member Author

mattab commented Aug 21, 2015

Did you use ssl and port 465?

yes, strange you didn't have to do this. I should try with another gmail account if I can reproduce

@MagicFab
Copy link

Some more context:
http://security.stackexchange.com/questions/66025/what-are-the-dangers-of-allowing-less-secure-apps-to-access-my-google-account

To avoid this in the future and properly support using Google's SMTP, perhaps Piwik could implement OAuth 2: https://developers.google.com/gmail/oauth_overview?hl=en

@MagicFab
Copy link

The FAQ could link to:

Original announcement:
http://googleonlinesecurity.blogspot.co.uk/2014/04/new-security-measures-will-affect-older.html

Steps to enable "less-secure" apps:
https://support.google.com/accounts/answer/6010255

@mattab
Copy link
Member Author

mattab commented Sep 19, 2015

If anyone else experiences this, please leave a comment!

@mattab mattab added this to the Short term milestone Sep 19, 2015
@eantoranz
Copy link

I'm running tests to send my first set of patches and I had to enable "less secure apps access" to be able to send the patches with git-send-mail through gmail (to my personal account, just testing, as I said).

@TechCare-Aus
Copy link

G'day guys,

Old thread, but still an open issue, so I figured I would respond and keep it alive.

At least for me this is still an issue. Would love to be able to keep the security on my GAPPS account, rather then use less secure setting.

I've tested port 465 SSL and 587 TLS, to smtp.gmail.com using Login. But no joy.

@tsteur
Copy link
Member

tsteur commented Aug 19, 2016

I had a look and https://github.com/PHPMailer/PHPMailer would solve this issue. We could use it from Piwik 3 as it requires PHP 5.4 to use it. Here is explanation. Could be actually quite easy to implement and to switch to this library . More infos https://github.com/PHPMailer/PHPMailer/wiki/Using-Gmail-with-XOAUTH2

@mattab mattab modified the milestones: 3.0.0, Mid term Aug 20, 2016
@mattab mattab added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Aug 20, 2016
@mattab mattab changed the title Sending email via gmail SMTP requires to "Allow less secure apps: YES" Sending email via gmail SMTP requires to "Allow less secure apps: YES" -> is solution to use PHPMailer? Aug 20, 2016
@TechCare-Aus
Copy link

That would be a great addition to Piwik from my perspective.
Top job guys!

@federicosan
Copy link

So what was the solution to this?

@MagicFab
Copy link

This issue was originally about improving the FAQ which has been done. A new issue about implementing GMail's oAuth should be opened by anyone interested in this. Link to #8613 (comment) would be useful there.

@beingnikhilesh
Copy link

beingnikhilesh commented May 12, 2019

Thanks... You Saved a lot of Time

@linehammer
Copy link

linehammer commented Jul 30, 2019

Less secure apps can make your account more vulnerable, Google will automatically turn this setting off if it's not being used. However, bypass this security setting with a configuration tweak within your Google Email Account .

How "more secure apps" help to protect your account?

  • Which level of access you're giving the client before you connect your Account.
    
  • Client access only a relevant part of your Account, like your email or calendar.
    
  • Connect your Google Account to the client without exposing your password.
    
  • Disconnect your Google Account from the client at any time.
    

@robertq12
Copy link

Initially I was facing similar issues associated with gmail while setting up POP3 and SMTP, however after successful login to gmail, I was unable to send and receive emails, the issue is happening probably due to gmail error 007

@mattab
Copy link
Member Author

mattab commented Dec 10, 2023

@mattab mattab closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2023
@sgiehl sgiehl added the answered For when a question was asked and we referred to forum or answered it. label Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. c: Website matomo.org For issues related to our matomo.org website. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

11 participants