Package: getmail6
getmail6 is a flexible, extensible mail retrieval system with
support for POP3, IMAP4, SSL variants of both, maildirs, mboxrd files,
external MDAs, arbitrary message filtering, single-user and domain-mailboxes,
and many other useful features.getmail is Copyright (C) 1998-2023 Charles Cazabon and others.
getmail is licensed for use under the GNU General Public License version 2 (only).
Seedocs/COPYINGfor specific terms and distribution information.getmail6 has adaptations to work with Python 3.
These changes might still contain some bugs.
Please report them athttps://github.com/getmail6/getmail6.
Seedocs/BUGSfor instructions on reporting bugs.getmail6 will probably not work with Python versions older than 2.7.
Use getmail 5.14 with them.InstallationTo install:pip install getmail6To uninstall:pip uninstall getmail6You can install getmail6 in your home directory if you add--user.If getmail6 is available via your Linux distribution, you better use that.Usagegetmail6 is not a python API.
getmail6 provides command line tools:getmailgetmail_maildir,getmail_mboxgetmail_fetchgetmail-gmail-xoauth-tokensBefore usinggetmailyou must configure it.
Seedocs/configuration.txtanddocs/getmailrc-examples.
An example:[retriever]
type = SimpleIMAPSSLRetriever
server = imap.gmail.com
port = 993
username = <your_email_here>
#password = ... or
password_command = ("pass", "<your_email_here>")

[destination]
type = Maildir
path = ~/Mail/<your_email_here>/INBOX/

[options]
read_all = true
delete = trueGoogle gmailForgmail,
after having enabled 2-Step Authentication,
let google generate an “app password” for you.
Then, for the above example,
usepass edit <your_email_here>and change to the generate one.Go tohttps://mail.google.comIf you are signed in, on the left upper corner there is a cogwheel symbol for settingsChoose “See all Settings”“Accounts and Imports” tab, then “Other Google Account Settings”/”Security” brings you tohttps://myaccount.google.com/u/0/security?hl=enTurn on “2-Step Verification” (also known as 2-factor-authentication or 2FA)In “App passwords”, generate a password for your deviceUpdate this in your password command.See also:https://support.google.com/accounts/answer/185833Oauth2 Privacy Policygetmail is a native app.
Seehttps://developers.google.com/identity/protocols/oauth2/native-appStill, to download your email from gmail to your computer using OAuth2
you need to grant getmail OAuth2 access to the scopehttps://mail.google.com/,
as you would to web apps.
Unfortunately, the init step in example 12 indocs/getmailrc-exampleshas to be repeated regularly.
This makes theapp passwordmethod above a better alternative.
Don’t forget to remove theuse_xoauth2line,
if you switch from Oauth2 toapp password.Testsgetmail 5.14 did not come with tests.There is now a test folder that usesdocker-mailserverfor black box testing.This still tests Python 2.7.Tests are work in progress.DocumentationSee the HTML documentation for details on setting up and usinggetmail.
It is included in thedocssubdirectory,
and will be installed in<PREFIX>/doc/getmail-<version>/(by default).docs/documentation.txt
docs/configuration.txt
docs/faq.txt
docs/troubleshooting.txt