mailhook

command module
v0.0.0-...-0aa1e1f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2020 License: MIT Imports: 18 Imported by: 0

README

mailhook

Build Status Go Report Card

Micro service receiving emails and posting them to web hooks.

Install

Download the binary from the Releases Page or build from source.

Usage

mailhook -hook-dir /etc/mailhook/hooks -listen :25
Hook Directory

A hook directory contains a number of hook files with .yml extension.

Hook File

A hook file includes a YAML encoded set of web hooks and email address patterns.

---
# catch mails to tom@example.com and tom+arbitrary-tag@example.com
- hook: 'https://api.example.com/v1/mails'
  emails:
    - 'tom@example.com'

# catch mails to *@example.net and *@example.org
- hook: 'http://example.net/messages'
  emails:
    - '@example.net'
    - '@example.org'

# catch all mails
- hook: 'http://example.net/fallback'
  emails:
    - '@'
Payload

The request that will be sent to the HTTP endpoint will be encoded as multipart/form-data with the following payload:

Field Value
mail[sender] SMTP sender address
mail[recipient] SMTP recipient address
mail[message][from][][name] Names taken from the From header
mail[message][from][][email] Adresses takem from the From header
mail[message][to][][name] Names taken from the To header
mail[message][to][][email] Adresses takem from the To header
mail[message][cc][][name] Names taken from the Cc header
mail[message][cc][][email] Adresses takem from the Cc header
mail[message][bcc][][name] Names taken from the Bcc header
mail[message][bcc][][email] Adresses takem from the Bcc header
mail[message][reply_to][][name] Names taken from the ReplyTo header
mail[message][reply_to][][email] Adresses takem from the ReplyTo header
mail[message][subject] Subject of the message
mail[message][date] RFC3339 encoded date of the message
mail[message][message_id] ID taken from the MessageID header
mail[message][in_reply_to] ID taken from the InReplyTo header
mail[message][references][] IDs taken from the References header
mail[message][text] Text body of the message
mail[message][html] HTML body of the message (can be empty)
mail[message][attachments][] Attachments of the message

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL