Raspberry pi 3B - Authentication Error when trying to Read Gmail

Glen Hikvision <[email protected]>
Newsgroups gmane.mail.getmail.user
Message-ID <CAEd79sjhJAbQaUfJz+uK7v74THZ40CKfkknf+mm0tGZ7E3WGKQ@mail.gmail.com>
I am using a Raspberry pi 3B to try to access Gmail and bring certain
emails on to the Rpi to massage with Python scripts. I set this up using
Getmail and ProcMail to do what I wanted numerous months ago and had it
working nicely! However, I got involved with other projects and only
recently got back to this project. My original success was with a Raspberry
using the Raspian Stretch OS. Before I got back to this project, I updated
the Raspberry to the newer Raspian Buster OS, and it was at that point that
I ran into Authentication errors! I tried numerous things and then finally
went back to the older OS to see if I could get it to work... however, I am
now getting the same errors with the old OS also!

Here is my getmailrc file:

[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

When logging on to my headless Raspberry, using a PuTTY terminal session, I
enter the command *'getmail'* I receive the following response...

pi@raspberrypi:~ $ getmail
getmail version 4.54.0
Copyright (C) 1998-2012 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

I also tried the getmail --dump command and here are the results:

pi@raspberrypi:~ $ getmail --dump
getmail version 4.54.0
Copyright (C) 1998-2012 Charles Cazabon.  Licensed under the GNU GPL
version 2.
getmail configuration:
  getmail version 4.54.0
  Python version 2.7.13 (default, Sep 26 2018, 18:42:22)
[GCC 6.3.0 20170516]
  retriever:  SimpleIMAPSSLRetriever(ca_certs="None", certfile="None",
getmaildir="/home/pi/.getmail/", keyfile="None", mailboxes="(u'INBOX',)",
move_on_delete="None", password="*", port="993", server="imap.gmail.com",
ssl_ciphers="None", ssl_         fingerprints="()", ssl_version="None",
timeout="180", use_cram_md5="False", use_kerberos="False", use_peek="True",
username="myemailname")
  destination:  MDA_external(allow_root_commands="False", arguments="('-f',
'%(sender)')", command="procmail", group="None", ignore_stderr="False",
path="/usr/bin/procmail", unixfrom="False", user="None")
  options:
    delete : False
    delete_after : 0
    delete_bigger_than : 0
    delivered_to : True
    fingerprint : False
    logfile : logfile(filename="~/.getmail/log-getmail")
    max_bytes_per_session : 0
    max_message_size : 0
    max_messages_per_session : 0
    message_log : ~/.getmail/log-getmail
    message_log_syslog : False
    message_log_verbose : False
    read_all : False
    received : True
    verbose : 1


I read somewhere that I should change the security of the gmail account to
allow less secure apps but changing this didn't change the outcome!

Hopefully you can shed some light on why this isn't working. Thanks.

Gary
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.