Skip to main content

a simple mail check utility, currently supporting IMAP

Project description

README

mailck is a simple mail check utility, currently supporting IMAP, designed with the following in mind:

  • light: small size and resource usage
  • low dependencies: low or no external dependencies
  • terminal-focused: terminal usage focused (input and output) - primarily focused on usage through conky

Latest Changes

  • minor cleanup of --version
  • update copyright date

Notices

  • it does not make much sense to run this more frequently than every 10s as connecting takes ~1-2s

Features

  • no configuration: install and run
  • supports password or password-cmd (getting a password from an external command such as spw)
  • scriptable: designed to be ran from conky, cron, or the command line
  • minimal: around 250 lines of code, no dependencies
  • safe: the code is clean and easy to review with no dependencies so you can easily review to see exactly what it does

Requirements

  • python

Overview

mailck is a utility to check mail. The default usage simply returns a count of new (unseen) messages but you can have it return a summary (showing From, Date, and Subject) of the messages if needed. See --help and the Examples section below for more details.

We use mailck daily via conky to check several mail accounts. mailck was designed for this purpose and built because we could not find a simple, trustworthy application for this that is currently maintained. mailck has no dependencies so keeping it up-to-date is simple but we strive to keep the application functioning as designed and to address any issues quickly.

Comments / Issues / Feedback

If you find an issue, have a question, or would like a feature added please create an issue as we would be happy to hear from you.

Install

We recommend using pipx. To install:

  • with pipx: pipx install mailck
  • with pip: pip install --user mailck

Usage

Using mailck is straightforward, see --help for details or the Examples section below for example usage.

By default, mailck uses LOG_LEVEL=WARNING which shows minimal extra info. If you are having issues you may want to increase application verbosity by setting the LOG_LEVEL to 'DEBUG'. You can do this by setting a LOG_LEVEL envvar (e.g. LOG_LEVEL='DEBUG' mailck --server mail.example.com --port 993 --username me@example.com --password='my-password'). Valid values for LOG_LEVEL are as follow: [CRITICAL|ERROR|WARNING|INFO|DEBUG] (suggest WARNING).

Examples

  • Terminal Usage:
    • basic: mailck --server mail.example.com --port 993 --username me@example.com --password='my-password'
      • output: 0 # indicating no new email
    • basic with password-cmd: mailck --server mail.example.com --port 993 --username me@example.com --password-cmd='spw -g mail/example@x -u'
      • output: 0 # indicating no new email
    • add prefix and suffix with password-cmd: mailck --server mail.example.com --port 993 --username me@example.com --password-cmd='spw -g mail/example@x -u' --prefix='example@x: ' --suffix=" (new)"
      • output: example@x: 0 (new) # indicating no new email
    • basic with password-cmd returning message summary: mailck --server mail.example.com --port 993 --username me@example.com --password-cmd='spw -g mail/example@x -u' -m true --prefix='Total: ' --suffix=' (new)'
      • output:
        SA <sa@adercon.com>, 2023-12-20 20:58, Example Email 1
        SA <sa@adercon.com>, 2023-12-20 20:59, Example Email 2
        Total: 2 (new)
        
  • conky usage:
    conky.text = [[
    ...
    Mail:
    - devops@ac: ${texeci 60 mailck --server mail.example.com --username me@example.com --password-cmd='spw -g mail/me@ac -u' --suffix=' (new)'}
    - dr@ac:     ${texeci 60 mailck --server mail.example.com --username dr@example.com --password-cmd='spw -g mail/dr@ac -u' --suffix=' (new)'}
    ...
    ]]
    
    will produce something like the following in conky:
    ...
    Mail:
    - devops@ac: 2 (new)
    - dr@ac      0 (new)
    ...
    

Links

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

mailck-0.4.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

mailck-0.4.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file mailck-0.4.0.tar.gz.

File metadata

  • Download URL: mailck-0.4.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.6.30-2-lts

File hashes

Hashes for mailck-0.4.0.tar.gz
Algorithm Hash digest
SHA256 bc440dd756f2fa7041d7fb1c7ccc66eeab170c98ff43f268410b324dec4ef296
MD5 a492d13446ba67843cac1fa5e92a00c9
BLAKE2b-256 b238f683993835785e6870b1445180bb941ae4de60c3fd2a0a1309861d64f088

See more details on using hashes here.

File details

Details for the file mailck-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: mailck-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.6.30-2-lts

File hashes

Hashes for mailck-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6186a358429e253c0e52c2b35d0245db790b212e30cef11548f0b0b630edf70
MD5 58faa7f51f57f1503023913d9addeee0
BLAKE2b-256 ac428a06b9b4b8813956ad110e4388e2e682af044fc94926427a36e992f2d4c6

See more details on using hashes here.

Supported by

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