Nextcloud gmail email account config


(HF) #1

As per title, does anybody have an example of adding gmail to the nextcloud email app?

I’ve searched, but none of the exmples work for me. All latest versions.


(Saito Benkei) #2

Did you allow your gmail account to use the less secure protocols (“in its opinion”)?

(Marc) #3

There was a bug but fixed in mail app v0.11.0

(HF) #4

Thanks @saitobenkei, yes did all the recommendations/suggestions e.g. less secure apps and disable occasional capatcha, still no luck. (Authentication denied)

(HF) #5

Thanks @dnutan, I am using all the latest. mail app is at v0.11.0

(HF) #6

Maybe I need to move my quest to the nextcloud community.

(Michael Träumner) #7

What is the message? Could not reach server or wrong credentials?

(HF) #8

That one

(Michael Träumner) #9

Perhaps you have to create an app-password at google and use this.

Tip is from here:

(HF) #10

That looks promising. Will try later today.

(HF) #11

Too bad, following the link I get a Google notification on screen:

The setting you are looking for is not available for your account.

(Marc) #12

I’ve done a test, hope it helps.

  1. Login to your Gmail account

  2. Go to Settings -> Forwarding and POP/IMAP: Enable IMAP, and Save settings

    • gmail-forwarding-enable-imap
  3. If you use 2-Step-Verification, generate and app password:
    3.1. Select the app and device you want to generate the app password for:

    • Select app: Other (Custom name): Nextcloud Mail app
    • click Generate button
      Sample App Password:
  4. On Nextcloud, open Mail app and add mail account providing your credentials: Name, Mail Address, (app) Password.
    If autoconfiguration fails, try with Manual configuration (see Use IMAP to check Gmail on other email clients). Example:

    • Name: Your name
    • Mail Address:
    • IMAP Host:
    • IMAP Port: 993, IMAP Security: SSL/TLS
    • IMAP User:
    • IMAP Password: (app) password
    • SMTP Host:
    • SMTP Port: 465, SMTP Security: SSL/TLS
    • SMTP User:
    • SMTP Password: (app) password

Notes: I’ve tested with an account using 2-Step-Verification and generated the 16- character App Password, without spaces. No further troubleshooting steps were required.


  • Temporarily enable debug and increase loglevel (nextcloud’s config.php file) and monitor nextcloud.log file:
  'debug' => true,
  'loglevel' => 0,

furhter logging can be obtained (horde_imap.log, horde_smtp.log) adding:

'app.mail.imaplog.enabled' => true,
'app.mail.smtplog.enabled' => true,
  • SMTP Security: I’ve read STARTTLS can fail with nextcloud app
  • If log reports timeout errors you can add some app settings to nextcloud’s config.php file:
  'app.mail.imap.timeout' => 30,
  'app.mail.smtp.timeout' => 30,

(HF) #13

Overwelming! Thanks @dnutan!

I’ll give that a go some time my tomorrow.

Many thanks!

(HF) #14

@dnutan, this did the trick for me! Again, thanks for your time and effort, and I hope it will help others.