Skip to main content

Description

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.

Licence

getmail is Copyright (C) 1998-2026 Charles Cazabon and others. getmail is licensed for use under the GNU General Public License version 2 (only). See docs/COPYING for specific terms and distribution information.

getmail-gmail-xoauth-tokens is Copyright 2012 Google Inc. getmail-gmail-xoauth-tokens is licensed for under the Apache License, Version 2.0

Bugs

getmail6 has adaptations to work with Python 3. These changes might still contain some bugs. Please report them at https://github.com/getmail6/getmail6. See docs/BUGS for instructions on reporting bugs.

Installation

To install:

pip install getmail6

To uninstall:

pip uninstall getmail6

You can install getmail6 in your home directory if you add --user.

If getmail6 is available via your Linux distribution, you better use that.

Usage

getmail6 is not a python API. getmail6 provides command line tools:

  • getmail

  • getmail_maildir

  • getmail_mbox

  • getmail_fetch

  • getmail-gmail-xoauth-tokens

Configuration

Before using getmail you must configure it. See docs/configuration.txt and docs/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 = true

Gmail

For gmail, after having enabled 2-Step Authentication, let google generate an “app password” for you. Then, for the above example, use pass edit <your_email_here> and change to the generate one.

  • Go to https://mail.google.com

  • If you are signed in, on the left upper corner there is a cogwheel symbol for settings

  • Choose “See all Settings”

  • “Accounts and Imports” tab, then “Other Google Account Settings”/”Security” brings you to https://myaccount.google.com/u/0/security?hl=en

  • Turn on “2-Step Verification” (also known as 2-factor-authentication or 2FA)

  • In “App passwords”, generate a password for your device

  • Update this in your password command.

See also: https://support.google.com/accounts/answer/185833

getmail is a native app. See https://developers.google.com/identity/protocols/oauth2/native-app Still, to download your email from gmail to your computer using OAuth2 you need to grant getmail OAuth2 access to the scope https://mail.google.com/, as you would to web apps. Unfortunately, the init step in example 12 in docs/getmailrc-examples has to be repeated regularly. This makes the app password method above a better alternative. Don’t forget to remove the use_xoauth2 line, if you switch from Oauth2 to app password.

Tests

There is now a test folder that uses docker-mailserver for black box testing.

Tests are work in progress.

Documentation

See the HTML documentation for details on setting up and using getmail.

docs/documentation.html
docs/configuration.html
docs/faq.html
docs/troubleshooting.html

It is included in the docs subdirectory, and will be installed in <PREFIX>/doc/getmail-<version>/ (by default).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

getmail-6.20.1.tar.gz (210.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

getmail-6.20.1-py3-none-any.whl (230.4 kB view details)

Uploaded Python 3

File details

Details for the file getmail-6.20.1.tar.gz.

File metadata

  • Download URL: getmail-6.20.1.tar.gz
  • Upload date:
  • Size: 210.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for getmail-6.20.1.tar.gz
Algorithm Hash digest
SHA256 0a32eb42b5813f35f595566d9c1e9ca7724368ba003a8e6c58ffa33b77a5f7e8
MD5 555414e4b32eb478a2382959317517ab
BLAKE2b-256 cad7f24f2c719a16d7280f8dbe8e885a90de66918dafc4af5c937f4fbd077812

See more details on using hashes here.

Provenance

The following attestation bundles were made for getmail-6.20.1.tar.gz:

Publisher: publish.yml on getmail6/getmail6

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file getmail-6.20.1-py3-none-any.whl.

File metadata

  • Download URL: getmail-6.20.1-py3-none-any.whl
  • Upload date:
  • Size: 230.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for getmail-6.20.1-py3-none-any.whl
Algorithm Hash digest
SHA256 614503aab375a5d520e79c758a43a33a42ee77f12881a005a1e76dbcb989feb6
MD5 c797b5a4c19786aded20e0131a7e0759
BLAKE2b-256 51cd703c54dfc02b122f230ab93d2bfc86e6a64f11f5a59dafa8a00b138cb258

See more details on using hashes here.

Provenance

The following attestation bundles were made for getmail-6.20.1-py3-none-any.whl:

Publisher: publish.yml on getmail6/getmail6

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

6.20.1 This release

2 files

6.20.0

2 files

6.19.12

2 files

6.19.11

2 files

6.19.10

2 files

6.19.9

2 files

6.19.8

2 files

6.19.7

1 file

6.19.6

1 file

6.19.5

1 file

6.19.4

1 file

6.19.3

1 file

6.19.2

1 file

6.19.1

1 file

6.19.0

1 file

6.18.14

1 file

6.18.13

1 file

6.18.12

1 file

6.18.11

1 file

6.18.10

1 file

6.18.9

1 file

6.18.8

1 file

6.18.7

1 file

6.18.6

1 file

6.18.5

1 file

6.18.4

1 file

6.18.3

1 file

6.18.1

1 file

6.18

1 file

6.17

1 file

6.16

1 file

6.15

1 file

6.14

1 file

6.13

1 file

6.12

1 file

6.11

1 file

6.10

1 file

6.9

1 file

6.8

1 file

6.7

1 file

6.6

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page