Giter Club home page Giter Club logo

imap_monkey_task's Introduction

Email attachment executor

The application receives commands from the body of incoming emails. If the body contains keyword it looks for an python file attachment, executes it and responds with the result in email body. When the keyword is missing, responds with Invalid keyword in the body and when just attachment is missing, it returns Attachment missing.

How does it work

The application uses a configured IMAP account/folder, retrieves emails from the sender matching certain pattern, executes commands in the body of the email. and responds accordingly. If the email is successfully processed, a flag is set to prevent it from being processed the next time it is run.

Requirements:

  • User credentials and configuration for some email account with IMAP and SMTP access.

Configurations

Application is configured through an ENV variables. Use env file template env/monkey.env.template. Make the copy in env/monkey.env and replace placeholders with your own values.

Running

It can be run from shell or by included docker-compose.

Shell

All you will need is python and pipenv installed.

pipenv shell
bash  # if not already
set -o allexport && source env/monkey.env && set +o allexport
python monkey/run.py

Docker-compose

docker-compose up

running tests

pipenv shell
pipenv install --dev
pytest .

Notes

  • Code is typed, you can check it by running mypy . from pipenv shell (dev packages required, see the "running test" above).
  • Code is formatted by Black.
  • Isort is used for sorting imports.

imap_monkey_task's People

Contributors

vikipha 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.