Giter Club home page Giter Club logo

mailnotify's Introduction

mailnotify

Fire notifications when new emails appear in your offline mailboxes. Needs a notification service such as dunst to be usable.

Dependencies:

TODO: get rid of python dependency for decoding the email header. Seems to be non-trivial with awk or sed. Since python 3 is usually installed on most systems, it's not high on the priority list.

Should be POSIX compliant and work in most shells (tested in dash, bash and zsh)

Installation

Copy or symlink all sh scripts to bin directory of your choice (names must be kept the same).

When using the systemd unit file, the choice of bin directory matters. See section Systemd unit for further instructions.

Usage

mailnotify [OPTION]... [DIR_TO_WATCH]

    Options:
      -e, --exclude-dir       Directory to exclude from watching. Mail files
                              created in this directory will not trigger a
                              notification. May be applied multiple times for
                              multiple directories.

Directory that should be watched for new emails may hold multiple email accounts. Specify one additional argument per subdirectory that should be excluded, e.g. for Trash, Sent, Read Later, [Gmail]/Sent Items etc.

Example

mailnotify \
    -e Trash \ 
    -e Sent \
    -e 'Read Later' \
    -e '[Gmail]/Sent Items' \
    ~/.local/share/mail

Systemd unit

To run mailnotify as a systemd service, the executable mailnotify-run is used. This script is a wrapper for mailnotify and should be run it with the desired options.

First create a shell script named mailnotify-run. The unit file's ExecStart expects the script to sit at ~/.local/bin/mailnotify-run, so change the path accordingly if necessary. Also, if the path to the binaries is not in the unit file's Environment option, the path must be added there as well.

Copy or symlink mailnotify.service to ~/.config/systemd/user/ and run systemctl --user enable mailnotify.service && systemctl --user start mailnotify.service.

Limitations

  • Multiple recipients can not be included in the notification. The string may be malformed in this case.
  • HTML content will be rendered as-is and may result in unreadable notifications.

Ideas and/or PRs to address these limitations are always welcome.

mailnotify's People

Contributors

bratekarate avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.