1

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

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

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

[options]
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:glen.nvr99@imap.gmail.com: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?

1
  • @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 '20 at 21:28
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

1
  • 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 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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