Skip to content

digital-scouts/mailserver

Repository files navigation

Docker Image

wakatime

Mailserver

Dieser Mail-Server ist zur einfachen Weiterleitung von E-Mails an Opt-In Nutzer gedacht.

I. Development

Start dev server

Starting the dev server also starts MongoDB and a fake mail server as a service in a docker container using the compose script at docker-compose.dev.yml.

$ npm run nodemon Running the above commands results in

  • 🌏 API Server running at http:https://localhost:3000
  • ⚙️Swagger UI at http:https://localhost:3000/dev/api-docs
  • 🛢️ MongoDB running at mongodb:https://localhost:27017

Environment

To edit environment variables, create a file with name .env and copy the contents from .env.default to start with.

Var Name Type Default Description
NODE_ENV string development API runtime environment. eg: staging
PORT number 3000 Port to run the API server on
HOST string example.com:3000 Hostname the mail footer refers to, to unsubscribe
MONGO_URL string localhost URL for MongoDB
MONGO_USER string someUsername Username the MongoDB will be accessed
MONGO_PASS string somePassword Password the MongoDB will be accessed
MONGO_PORT string 27017 PORT for MongoDB
MAIL_HOST string localhost URL for Mailserver to send mails
MAIL_PORT number 1025 Port for Mailserver
MAIL_USER string project.1 Username for Mailserver login
MAIL_PASS string secure.1 Password for Mailserver login
MAIL_SECURE boolean false Wherever the Mailserver is in secure mode. Most local dev servers are not.
MAIL_IMAP_HOST string imap.strato.de Mailserver host name to receive mails
MAIL_IMAP_PORT string 993 Mailserver port name to receive mails

It is possible to observe multiple mailboxes on one server. To do so, add them to env/mails.json

[
  {
    "user": "[email protected]",
    "password": "Password"
  },
  {
    "user": "[email protected]",
    "password": "Password"
  }
]

II. Architecture

III. Aufgaben

MVP

  • Am Verteiler mittels Opt-In anmelden
  • E-Mails mit Formatierung
  • E-Mails mit Anhängen
  • Verteiler Einstellungen ändern (Von bestehenden abmelden, neue anmelden)
  • Antworten auf E-Mails an den Absender weiterleiten
  • Administrative Oberfläche
    • Absender zulassen (ID des Verteilers im User eintragen)
    • Verteiler hinzufügen
    • Absender entfernen
    • Empfänger einsehen

Spätere Aufgaben

  • Spamschutz
  • E-Mail Historie
  • Sendungsstatus zu E-Mails und Empfängern
  • HTML Templates

IV. Funktionen

  • Nutzer können sich selbstständig im Verteiler eintragen (Opt-In)
    • Dazu wird eine Bestätigungs-Mail versendet.
  • Es können E-Mails an eine Verteiler-Adresse gesendet werden.
    • E-Mail wird an alle Opt-In Nutzer weitergeleitet, wenn der Absender zugelassen ist.