Skip to main content

Watch Maildir for incoming mail and display notifications

Project description

https://badge.fury.io/py/maildirwatch.svg

maildirwatch - Watch Maildir for new mail and display notifications

This program allows you to watch a Maildir for incoming email and display notifications when new messages arrive.

The displayed notifications are interactive - programs can be run when the user clicks on them.

Installation

Installation from PyPI:

pip3 install --user maildirwatch

Python3 is required.

Note: PyGObject is a dependency of this program. To install it, you might have to install GObject development libraries on your system. On Debian, the packages libgirepository1.0-dev and gir1.2-notify-0.7 provide these libraries.

Usage

Use the maildirwatch command, or:

python3 -m maildirwatch

The program will run forever or until you interrupt it with Ctrl-C.

To list available options, run:

maildirwatch --help

Configuration

The program looks for the configuration file in $XDG_CONFIG_HOME/maildirwatch.conf or ~/.config/maildirwatch.conf if XDG_CONFIG_HOME is not defined.

The configuration file is in Python’s standard config format (understood by the configparser module).

Global options

These options should be put in the [global] section.

  • maildir

    The directory to scan for maildirs. Default value: ~/Maildir.

  • ignore

    Comma-separated list of maildir patterns to ignore. Each pattern must be in fnmatch style. By default, no maildirs are ignored.

  • whitelist

    Comma-separated list of maildir patterns to watch, even if they’re matched by ignore.

    You can explicitly select maildirs to watch by setting ignore to **/** and whitelist to patterns that you want to watch, e.g. *Inbox*,*Important*.

  • inhibit-command

    Command to run to check if notifications should be inhibited. If the command exits with 0, the notification is NOT displayed and only a message is logged. Otherwise the notification is displayed.

    If this is undefined, notifications are always displayed.

Actions

Each action is a path to a program and a list of arguments. Every action also has a name that is displayed to the user.

Actions are typically displayed as text buttons below the notification body. When the user clicks on the action button, the action program is started.

Action definitions must be put in [actions] section. Each action is defined like this:

action name = /path/to/program arg1 arg2 arg3...

One action name is special - the default action. The default action’s value should be the name of another action instead of path to a program. The program associated with default action is run when the user clicks on the notification itself, not an action button.

Example configuration

Below is an example configuration file that modifies path to the Maildir, ignores spam folder, defines two actions and disables notifications if VLC is running:

[global]
maildir = ~/mail
ignore = *Spam,*foo/bar*
inhibit-command = pgrep vlc

[actions]
default = Show mu4e
Show mu4e = emacs -f mu4e
Start thunderbird = thunderbird

License

Copyright (C) 2019-2024 Michał Krzywkowski

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

Project details


Download files

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

Source Distribution

maildirwatch-0.2.1.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

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

maildirwatch-0.2.1-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file maildirwatch-0.2.1.tar.gz.

File metadata

  • Download URL: maildirwatch-0.2.1.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for maildirwatch-0.2.1.tar.gz
Algorithm Hash digest
SHA256 6e2afe850aec83ce5ecddbd67365190e05c4aa19d95870b08665dfe8b0d6c79d
MD5 195fe651f072c6b8e9d29ba65b98ece0
BLAKE2b-256 5c0e2fce6f9c4ebb364b86247f52c41e4d18f42340c2c44078573786be1df839

See more details on using hashes here.

File details

Details for the file maildirwatch-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: maildirwatch-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for maildirwatch-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5f10dfcfc643eb5507811dc2c30923fa882edd0ebead92d1c37e241a0d919103
MD5 1e21717d64c54861abc6a7474072fba5
BLAKE2b-256 b8e68b8e02bedf99442ae723ca014870b6b9e8a0e32023635cdc3aaedb10b62e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page