Code Monkey home page Code Monkey logo

matrix-email-bot's Introduction

matrix-email-bot

A bot that posts messages to rooms when an email is received. Ideal for uses where a short message is desired in a chat room when a newsletter goes out.

Run your own

Note: Some experience with MX records is ideal.

The bot runs best on port 25 to receive all incoming mail to your server. The bot does not (currently) send mail out, but does process all inbound emails to try and get them to the proper room (letting them disappear if no room can be mapped).

  1. Set up an MX record to point to your domain. For example, email.example.com 10 vps3.example.com (email.example.com being the domain, 10 the priority, and vps3.example.com being the server's hostname)
  2. Optionally install spamassassin and spamc: sudo apt-get install spamassassin spamc - be sure to enable them!
  3. Install nodejs and npm (v18+ preferred).
  4. Clone this repository and run yarn install.
  5. Copy config/default.yaml to config/production.yaml and configure accordingly.
  6. Set the environment variable NODE_ENV to production and run yarn start.
  7. Start using your bot!

There is also a Docker image available at darkdecoy/matrix-email-bot - map your config to /app/config/production.yaml.

Subscribing to mailing lists

Some mailing lists require you to send an email in order to subscribe. This requires setting up a mailserver (such as postfix) in send-only mode because the bot is handling incoming mail. After setting up your mail server, use it to send an email to the list with the From address being the room you'd like to announce to. For example: echo "Subscribe" | mail -s "Subscribe" [email protected] -aFrom:[email protected]

Credits

matrix-email-bot's People

Contributors

dependabot[bot] avatar greenkeeper[bot] avatar rubo77 avatar turt2live avatar

matrix-email-bot's Issues

Bug: Cannot read properties of undefined (reading '0')

Receiving message from [email protected]
Processing message from [email protected]
id: undefined message: Message Found
/app/EmailProcessor.js:57
const primaryFrom = message.from.value[0];
^
TypeError: Cannot read properties of undefined (reading '0')
at EmailProcessor. (/app/EmailProcessor.js:57:51)
at Generator.next ()
at fulfilled (/app/EmailProcessor.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v20.11.1

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.