Gmail SMTP Email Server config

well… web and gmx work flawlessly

1 Like

I’ve tested Outlook.com (Microsoft) without problems too,

Gmail worked well some years before, but it’s a hard way to make it work now. The security settings change all the time…

At the moment i have one client who works with that.

2 Likes

I tried using web.de smtp server and still showing the same certificate error as for gmail! :triumph:

I will dig a bit on google and post any result if any…

thanks for your help!

one last question… the email setup is for admins, right? have you put a valid emailadress at your (normal) users email?

Another question does your serveur have the good date/time ?

Is your problem related to this?
https://github.com/nextcloud/server/issues/7421

1 Like

@JimmyKater yes correct, I want to configure it for admin messages like password reset and I want also activate registration
@Nemskiller yes, I have the NTP server from Germany configured
@MeiRos actually yes, thanks for the info, I was taking a look at that post yesterday as well so it seems my problem is due to I have installed PHP 7.1 instead of 7.2, it seems in 7.2 this issue is solved and also will be solved in Nextcloud 14. The solution there which states hardcoding the usage of TLS 1.2 in swiftmailer (/var/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php) doesn’t work in my case…

During my Nextcloud 13 implementation I decided to install PHP 7.1 because 7.2 didn’t have a fully working php-smbclient at that moment but now the impact is in the mails delivery :weary: , I would need to see whether is easier to upgrade to 7.2 or wait for NC14

Thank you all for your help :+1:

OK, more news… but no solution

  • updated PHP to 7.2 keeping the original swiftmailer configuration --> still doesn’t work
  • updated PHP to 7.2 forcing swiftmailer to use TLS 1.2 --> still doesn’t work
  • both above situations are being tested not only with a gmail account but also with a web.de mail account

I’m lost in the universe now, no idea what else to do… just waiting until NC14 is going to be launched

Cheers,
Bruno.

1 Like

Not a great solution but in the meantime you could set up a Postfix mail relay as a workaround.

Have you made sure the GMAIL account has been enabled to allow “less secure apps”
https://support.google.com/accounts/answer/6010255?hl=en

Gerard

Hey dedero!

I’m not sure if you found a solution already or if you switched away from gmail at the end, but I’ve just set up my first Nextcloud server and ran into the same problem as you.
After fiddling around with certain settings and a lot of trial and error I got it running.

The only thing I have set different to you is the Encryption -> STARTTLS!
(the port is set to 587 as well, but that topic was already elaborated in this thread…).

Hope this helps you or at least some random people who stumble across the same difficulties! :slight_smile:!

Cheers,
Christian

Hi Christian,

Thanks a lot for your hint!, I actually didn’t solve the issue… I tried many stuff and still doesn’t work… I’m not sure whether you meant to set STARTTLS on the Email server setup but I already did it, I’m having the same error with different e-mail providers such as web.de

Thanks and cheers,
Bruno.

Hi Bruno!

Well that is weird, because as far as I’m understanding from the thread here our settings seem to be identical… except maybe that I’m using the latest Nexctcloud version, 15.0.4.

Sorry I couldn’t help you out, that’s a bit of a bummer :expressionless:

Cheers,
Christian

1 Like

Hi, I’m actually using the 15.0.4 version… yeah, it’s really strange… I’m planning to upgrade my hardware and perform a clean installation soon, let’s see then!

Thanks a lot for sharing your experience :+1:

Cheers,
Bruno.

Hello!
I’m a little late to the party, but it might help someone…

I just wanted to say that I had the same problem as you, until I found this page and tried the suggestions from “derfreimann”. I changed the encryption from SSL/TLS to STARTTLS and Voilá, it worked!

I started out wanting to generate an “app password” but for some reason Google says that that is not possible with my account. They didn’t give any explanation though, so I have no idea why. I ended up having to enable “less secure apps” instead, which worked, but it feels bad using what Google apparently considers an “unsecure” method.

Thanks for the tip @derfreimann!

Petter

PS. I forgot to mention that I’m using NextcloudPi v. 1.14.3 / Nextcloud v. 16.0.2.1 DS.

1 Like

This worked for me as well. Thanks for your post!

I found a Google help doc somewhere (I don’t have the link anymore) that said that to generate an “app password” you must have “2-Step Verification” enabled. I enabled 2-Step Verification, and after doing that the option appeared to generate an app password, just below “2-Step Verification” in the top “Signing in to Google” option block.

However, changing to STARTTLS and enabling less secure app access fixed my gmail SMTP problem. I have 2-Step Verification turned off and no app password at this point.

I have a different primary gmail account that is heavily used, and that gmail account is used with several apps and devices that require “less secure app access” to be turned on. I have never had any security problems with that gmail account even though less-secure access is turned on.

enabling less secure apps in my gmail account worked for me

I had my nextcloud working with gmail, then at some point it apparently stopped working. I went through several of these threads checking that I had STARTTLS and everything else, but no joy. Then I finally went through the settings of the gmail account that I was using for outbound messages, and I noticed that my cell phone was associated with the account and gmail was using my phone as part of the authentication process. It finally occurred to me that my nextcloud installation wasn’t able to push the button on my phone when it was trying to send a message, so the access was denied. I deleted my phone # from that account and disabled all 2-factor authentication, and my nextcloud is happy again.

Hope that helps somebody else who is running into this issue. At least until Google changes the security measures again.
/dwight

1 Like

I managed to get it working, but it reduces security level of gmail. If you login to settings of your google account and enable access for less secure applications you can log on with starttls on port 587…

1 Like

Sorry i so lazy to write an explanaion .

Screen Shot 2021-12-09 at 18.32.40