Jan-Hendrik Ewers Logo

Using GMail's App Passwords With Paperless-NGX

October 9, 2022    paperless-ngx gmail self-hosted ☕️ buy me a coffee



I saw some errors in my paperless-ngx logs recently:

[2022-11-09 15:33:13,556] [ERROR] [paperless_mail] 
  Error while authenticating account paperless gmail: 
    Response status "OK" expected, but "NO" received. 
    Data: [b'[AUTHENTICATIONFAILED] Invalid credentials (Failure)']

After doing some digging, I discovered the following that will be affecting a lot of Paperless-ngx users with dedicated gmail accounts for ingress.

As of 30/05/2022, Google stopped supporting the Less Secure Apps mode which was often used to enable Paperless-NG to work with GMail via IMAP. Now, you need to enable 2FA and then generate an App Password (with instructions here). This password is then used within paperless-ngx like the account password previously.

For more guidance on how to set up Paperless-ngx with automated email ingress and rules, have a look at my other articles

Tips

  1. Make sure to select Mail as the app type. You’ll then want to select Other Custom Name for the device type. B
  2. Make sure to use a meaningful name C
  3. The app password is only ever shown once so make sure to copy it there and then. It is made up of 16 characters. DO NOT SHARE OR RE-USE THIS PASSWORD D