Skip to content
/ maildog Public

A friendly email assistant that reads your emails and replies to those which have a fitting ruleset, using the associated template.

Notifications You must be signed in to change notification settings

oneyb/maildog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple email reply automation with python

This puppy aims to make life easier for those that write too many of the same kind of email.

Being part of a growing organization means answering alot of questions about the organization from newcomers. This can be tedious especially when the information is readily available. Many people seek a human connection via internet, so they write an email.

If many people do this the replying human may not have the time to be as informative or as friendly as one wishes. Alas, the newcomer has a sour taste from reading a short, uninformative, hastily written, or a possibly brusk reply.

Everyone likes dogs. Dogs are friendly and attuned to our emotions, habits, and lives. We train them to be helpful. This software is supposed to be like a dog that retrieves the newspaper, barks only at intruders, amiably nuzzles the newcomer, and keeps quiet when it doesn’t know what to do, other than telling the owner that there is trouble. We train it to be helpful. It has the propensity to learn and grow.

Specifically it does the following.

  • reads the email account that you have configured
  • deduces the language
  • analyzes the text according to its language
  • extracts information from the analysis
  • chooses the appropiate ruleset that you have configured
  • if no appropriate ruleset can be found, the email is not answered and the owner of the email account is notified.
    • It only sends one reply for each unknown email. You will not be bombarded with notification emails.
  • if an appropriate ruleset can be found, the email is answered and deleted.

Get maildog working for you

The idea of maildog is that you train it for your needs. The following steps detail what this entails.

Install and configure it

  1. Get the software.
    pip3 install git+https://github.com/oneyb/maildog
    # Or:
    git clone https://github.com/oneyb/maildog
    cd maildog && python3 setup.py install
        

    NOTE: you will need to install it as root or as your user (pip install –user), in order to have the following scripts in the system path.

  2. Copy the tests directory to where you want it.
    cp -r /usr/local/lib/python3.5/dist-packages/maildog/maildog/tests/ my_maildog/
    # or
    cp -r maildog/maildog/tests/ my_maildog/
        
  3. Inspect and modify the following files according to your taste.
  4. Install a systemd service for your user.
    cp maildog/tests/config/maildog.timer maildog/tests/config/maildog.service $HOME/.config/systemd/user/
    systemctl --user enable maildog.timer
        
    • If you have this running on a raspberry pi, you may consider having the service run without you having to login. I mean:
    loginctl enable-linger $USER
        
  5. Check whether the dog does what you want.
  6. Enjoy the helpfulness of the new pet.

Anatomy of maildog

Given access to an email server, maildog fetches email and chews them into a useful form (Mail).

  • Mail:
    • has a tokenized (spaCy) form of the email’s subject and body,
    • knows the language it was written in (ccld2), and
    • based on how you trained the dog (how the rulesets are defined), has chosen a template.

See the definition for more information

Contributions are welcome

I have maildog working for me to reply to certain emails which generally come in two languages. You likely have an interesting case as well. Please contribute if you can. See the open issues for inspiration.

About

A friendly email assistant that reads your emails and replies to those which have a fitting ruleset, using the associated template.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages