I have recently installed Raspbian Buster with desktop on my Pi3B. I was previously using Stretch but ran into issues with a certain application unrelated to this question.

This question concerns using getmail to read mail from a Gmail inbox. I installed getmail on the Raspberry and set up my getmailrc file as follows

type = SimpleIMAPSSLRetriever
server = imap.gmail.com
port = 993
username = myemailname
password = mycleverpassword

type = MDA_external
path = /usr/bin/procmail
arguments = ("-f", "%(sender)")

read_all = false
delete = false
message_log = ~/.getmail/log-getmail

Then when, using a PuTTY terminal session, I enter the command 'getmail' I receive the following response...

getmail version 5.13
Copyright (C) 1998-2019 Charles Cazabon.  Licensed under the GNU GPL version 2.
SimpleIMAPSSLRetriever:[email protected]:993:
getmailrc: credential/login error ([AUTHENTICATIONFAILED] Invalid credentials (Failure))
  0 messages (0 bytes) retrieved, 0 skipped

This setup was working previously on Raspian Stretch.

Any thoughts on why it doesn't work on Buster?

  • @Milliways... I looked at the link you attached and that issue relates to sending emails in Buster versus Stretch, whereas my issue is about receiving emails using Getmail! That issue concluded that 'Apparently ssmtp is deprecated in Buster' which is an email delivery program! I won't claim to understand it all but I believe that part of the OAuth2 system is 2-Factor Authentication, and as you can see, from my answer to my own question, 2-FA is in fact how I solved the issue.
    – Gary
    Feb 4, 2020 at 21:28

1 Answer 1


Given that I had problems with this project using Buster, I loaded an SD card with Stretch and tried the same setup. The result was the same! I then tried the suggested solution of setting my Gmail account to allow less secure apps to logon, but this still did not work!

What does work is to setup 2-Step Verification for the Gmail account and then create a specific app password for this application. Placing this specific app password into the getmailrc file allows the application to work as it should. Note that this works for both Stretch and Buster

  • It seems to be a trend now. Github is also disabling git password authentication this summer, in favor of "tokens" which are essentially app-specific passwords. Mar 1, 2021 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.