Coder Social home page Coder Social logo

email-order's Introduction

email-order

A small tool that sends an email from a draft.

This tool was originally created for an AWS Lambda function being invoked by an AWS IoT button. The button's current purpose is to send an email to the local beverage dealer to order new beverages.

A few configuration values aside, this tool does not depend on any data stored in S3 or something else. The message template and the last send date are fetched via IMAP to allow simple adjustments on the template.

Workflow

  1. Check if any messages, younger than a configurable timeout, are placed in the sent folder. If there are, no new mail is sent.
  2. Get a draft from draft folder
  3. Adjust some headers in the draft message
  4. Store the message in sent folder
  5. Send the message

Configuration

The configuration of this tool is done by setting environment variables.

IMAP_ADDR

Defines the IMAP server address and port. Currently, plain IMAP is not supported.

Example:

IMAP_ADDR=imap.host.com:993

SMTP_ADDR

Defines the SMTP server address and port. Currently, plain SMTP is not supported.

Example:

SMTP_ADDR=smtp.host.com:465

USER

The username to use for IMAP and SMTP login.

Example:

PASS

The password to use for IMAP and SMTP login.

Example:

PASS=s3cr3tpassw0rd

SENT_MBOX

The name of the mailbox (folder) that contains sent messages.

Example:

SENT_MBOX=Sent

DRAFT_MBOX

The name of the mailbox (foldeR) that contains draft messages.

Example:

DRAFT_MBOX=Drafts

WAIT_DAYS

The number of days to wait until allowing the next email to be sent.

Example:

WAIT_DAYS=7

DRAFT_SEARCH

The IMAP search key to filter for a draft.

Example:

DRAFT_SEARCH="TO [email protected]"

Todo

  • Use SPECIAL-USE to get sent and draft folder names
  • Make send interval configurable
  • Enhance documentation
  • Allow specification of sent search key
  • Add tests
  • Automate build

License

GNU General Public License v3.0

See LICENSE for full license text.

email-order's People

Contributors

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