• Stars
    star
    40
  • Rank 680,660 (Top 14 %)
  • Language
    Dockerfile
  • License
    MIT License
  • Created over 6 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dockerized Postal SMTP Server based on Alpine Linux and Ruby

github.com/tiredofit/docker-postal

GitHub release Build Status Docker Stars Docker Pulls Become a sponsor Paypal Donate


About

Dockerfile to build a Postal SMTP server for sending and receiving SMTP / HTTP API email.

  • Contains Fail2Ban for blocking repeat authentication offenders

Maintainer

Prerequisites and Assumptions

Installation

Build from Source

Clone this repository and build the image with docker build <arguments> (imagename) .

Prebuilt Images

Builds of the image are available on Docker Hub and is the recommended method of installation.

The following image tags are available along with their tagged release based on what's written in the Changelog:

Container OS Tag
Alpine :latest

Multi Architecture

Images are built primarily for amd64 architecture, and may also include builds for arm/v6, arm/v7, arm64 and others. These variants are all unsupported. Consider sponsoring my work so that I can work with various hardware. To see if this image supports multiple architecures, type docker manifest (image):(tag)

Configuration

Quick Start

Persistent Storage

The following directories are used for configuration and can be mapped for persistent storage.

Directory Description
/config/ Auto generated Postal Config and Signing Key resides here
/logs/ Logfiles
/assets/custom Optional Use this to drop files overop of the Postal sourcode for cherry picked overrides of files

Environment Variables

Base Images used

This image relies on an Alpine Linux base image that relies on an init system for added capabilities. Outgoing SMTP capabilities are handlded via msmtp. Individual container performance monitoring is performed by zabbix-agent. Additional tools include: bash,curl,less,logrotate, nano,vim.

Be sure to view the following repositories to understand all the customizable options:

Image Description
OS Base Customized Image based on Alpine Linux

Admin Accounts

Parameter Description Default
ADMIN_EMAIL Email address of admin [email protected]
ADMIN_FNAME Name of Admin First Name Postal
ADMIN_LNAME Name of Admin Last Name Admin
ADMIN_PASS Password of Admin user PostalMailServer

Application Settings

Parameter Description Default
ENABLE_TRACKING Enable Click Tracking true or false true
MAX_DELIVERY_ATTEMPTS Maximum Delivery Attempts before failing 18
MAX_HOLD_EXPIRY_DAYS Maximum Holding days before expiring 7
SUPPRESSION_LIST_EXPIRY Suppression List expiry in days 30

DNS Settings

Parameter Description Default
DNS_HOSTNAME Domain Name Mail Server example.com
DNS_MX MX Record Hostnames - Seperate multiple with commas
DNS_SPF SPF Hostname spf.$DNS_HOSTNAME
DNS_RETURN_PATH Return path Hostname rp.$DNS_HOSTNAME
DNS_ROUTE_DOMAIN Routing Domain routes.$DNS_HOSTNAME
DNS_TRACK_DOMAIN Tracking Domain track.$DNS_HOSTNAME
DNS_DKIM_IDENTIFIER DKIM Identifier postal
DNS_DOMAIN_VERIFY_PREFIX Domain verification prefix postal-verification
DNS_RETURN_PATH_PREFIX Custom Return Path Prefix psrp

Security Settings

Parameter Description Default
ENABLE_FAIL2BAN Block hsots that repeatedly fail authentication TRUE
FAIL2BAN_LOG_FILE Log Location for Fail2ban /logs/fail2ban/fail2ban.log
FAIL2BAN_TIME_FIND Track failures for this time period 10m
FAIL2BAN_TIME_BAN Time to ban repeat offenders 10m
FAIL2BAN_MAX_RETRY Ban after how many tries during time period 5

Performance Settings

Parameter Description Default
WORKERS_AMOUNT Amount of Workers 1
WORKERS_THREADS Amount of Threads per worker 4

Logging Settings

Parameter Description Default
LOG_CONSOLE Log to Stdout Console true or false true
LOG_PATH Log Location /logs/
LOG_SIZE_MAX Maximum Log Size in KB 9999

Database Settings

Parameter Description Default
DB_HOST Hostname of MariaDB Container e.g. postal-db
DB_NAME Name of MariaDB Database e.g. postal
DB_USER Database Username e.g. postal
DB_PASS Password for Above User e.g. password
DB_PORT MariaDB Server Port 3306
DB_ROOT_PASS Needed for first boot - Assigns privileges to $DB_USER. This is your MariaDB Root Pass
RABBITMQ_HOST RabbitMQ Hostname or Container
RABBITMQ_VHOST RabbitMQ VHost shard
RABBITMQ_USER RabbitMQ Username
RABBITMQ_PASS RabbitMQ Password
RABBITMQ_PORT RabbitMQ Port 5672

Anti Spam Settings

Parameter Description Default
ENABLE_SPAMASSASSIN Enable Spamassassin true or false false
SPAMASSASSIN_HOST Hostname of Spamassassin daemon
SPAMASSASSIN_PORT TCP Port of spamassassin daemon 737
Parameter Description Default
ENABLE_RSPAMD Enable RSpamD checking true or false false
RSPAMD_FLAGS Flags to pass to rspamd daemon null
RSPAMD_HOST Hostname of rspamd daemon
RSPAMD_PASS RSpamd controller password null
RSPAMD_PORT TCP Port of rspamd daemon 11334
RSPAMD_SSL Use SSL for connecting to rspamd FALSE
Parameter Description Default
SPAM_THRESHOLD Amount to classify as Spam 5.0
SPAM_FAILURE_THRESHOLD Amount to fail as Spam 5.0

Anti Virus Settings

Parameter Description Default
ENABLE_CLAMAV Enable ClamAV true or false false
CLAMAV_HOST Hostname of Clamd Server
CLAMAV_PORT TCP Port of Clamd Server 3310

SMTP Settings

Client
Parameter Description Default
SMTP_CLIENT_OPEN_TIMEOUT Timeout for an Open Connection in seconds 30
SMTP_CLIENT_READ_TIMEOUT Timeout for Reading Data in seconds 60
Server
Parameter Description Default
SMTP_SERVER_ENABLE_TLS Enable TLS false
SMTP_SERVER_HELO_HOSTNAME What Hostname to send for HELO $DNS_HOSTNAME
SMTP_SERVER_LOG_CONNECTIONS Log SMTP Connections true
SMTP_SERVER_MAX_MESSAGE_SIZE Max message size in Megabytes 50
SMTP_SERVER_PORT Listening Port for Postal Main SMTP Server 25
SMTP_SERVER_PROXY_PROTOCOL Utilize Proxy Protocol false
SMTP_SERVER_SSL_VERSION SSL Versions SSLv23
SMTP_SERVER_STRIP_RECEIVED_HEADERS Strip Recieved Headers false
SMTP_SERVER_TLS_CERT TLS Cert Location (Will authgenerate if not exist) /certs/cert.pem
SMTP_SERVER_TLS_CIPHERS TLS Ciphers to use
SMTP_SERVER_TLS_KEY TLS Key Location (Will autogenerate if not exist) /certs/key.pem
Management System
Parameter Description Default
SMTP_FROM_ADDRESS From Address for Postam Management System [email protected]
SMTP_FROM_NAME From Name for Postal Management System Postal
SMTP_HOST SMTP Server to be used to send messages from Postal Management System to users 127.0.0.1
SMTP_PORT SMTP Port to be used to send messages from Postal Management System to Users 25
SMTP_USER Username to authenticate to SMTP Server
SMTP_PASS Password to authenticate to SMTP Server
Relay
Parameter Description Default
SMTP_RELAY_HOST Relay all outbound messages to this hostname
SMTP_RELAY_PORT SMTP Relay Port 25
SMTP_RELAY_SSL_MODE Relay SSL / TLS Mode Auto

Other Settings

Parameter Description Default
CONFIG_FILE Configuration File postal.yml
CONFIG_PATH Configuration Path /config/
FAST_SERVER_BIND_IP Bind IP for the Web Interface 0.0.0.0
FAST_SERVER_BIND_PORT_TLS Bind Port for the TLS Tracking Service 8443
FAST_SERVER_BIND_PORT Bind Port for the Tracking Server 8080
SETUP_TYPE Choose AUTO or MANUAL Setup type - Auto uses these environment variables AUTO
SIGNING_KEY_FILE Signing Key File signing.key
SIGNING_KEY_SIZE Signing Key Size 1024
WEB_BIND_IP Bind IP for the Web Interface 0.0.0.0
WEB_BIND_PORT Bind Port for the Web Interface 5000
WEB_HOSTNAME Hostname for Web Interface postal.example.com
WEB_MAX_THREADS Max Threads for Web Interface 5
WEB_PROTOCOL Protocol for Web Interface http or https http

Networking

Port Description
25 SMTP
80 Web Interface
8080 Fast Server /Tracking
8443 Fast Server / Tracking
5000 Puma`

Maintenance

Shell Access

For debugging and maintenance purposes you may want access the containers shell.

bash docker exec -it (whatever your container name is) bash

Support

These images were built to serve a specific need in a production environment and gradually have had more functionality added based on requests from the community.

Usage

  • The Discussions board is a great place for working with the community on tips and tricks of using this image.
  • Consider sponsoring me personalized support.

Bugfixes

  • Please, submit a Bug Report if something isn't working as expected. I'll do my best to issue a fix in short order.

Feature Requests

  • Feel free to submit a feature request, however there is no guarantee that it will be added, or at what timeline.
  • Consider sponsoring me regarding development of features.

Updates

  • Best effort to track upstream changes, More priority if I am actively using the image in a production environment.
  • Consider sponsoring me for up to date releases.

License

MIT. See LICENSE for more details.

References

More Repositories

1

docker-freepbx

Dockerized FreePBX 15 w/Asterisk 17, Seperate MySQL Database support, and Data Persistence and UCP
496
star
2

docker-db-backup

Backup multiple database types on a scheduled basis with many customizable options
Dockerfile
472
star
3

docker-traefik-cloudflare-companion

Automatically Create CNAME records for containers served by Traefik
Python
274
star
4

docker-freescout

Dockerized Freescout Helpdesk
Dockerfile
146
star
5

docker-self-service-password

Dockerized LDAP Tollbox Self Service Password Changer with many customizable options
Dockerfile
115
star
6

docker-nginx-php-fpm

Dockerized Nginx + PHP FPM images with many customizable options
Dockerfile
106
star
7

docker-openldap

Dockerized OpenLDAP server with many customizable options
99
star
8

docker-jitsi-meet

Docker Jitsi Meet WebRTC conferencing system w/Prosody XMPP and s6 overlay
Dockerfile
64
star
9

docker-collabora-online

Dockerized Collabora Office Online with customizable options
Dockerfile
62
star
10

docker-osticket

Dockerized Help Desk Software
PHP
48
star
11

docker-tinc

Docker Tinc VPN Mesh server w/S6 Overlay Init, Zabbix Monitoring, and distributed configuration updating based on Alpine
Dockerfile
43
star
12

docker-fusiondirectory

Dockerized FusionDirectory LDAP Manager
Dockerfile
39
star
13

docker-lemonldap

Dockerized Authentication Server with Single Sign On SAML, OpenID Connect, CAS, and Header support
Dockerfile
39
star
14

docker-openldap-fusiondirectory

Dockerized OpenLDAP server with FusionDirectory Schema Support
34
star
15

docker-wordpress

Dockerized Wordpress Image with customizable options
Python
31
star
16

docker-alpine

Docker Alpine Linux Base Images
Dockerfile
30
star
17

docker-traefik

Dockerized Traefik Reverse Proxy with customizable options
Dockerfile
29
star
18

docker-mongodb-backup

Docker MongoDB Backup Container based on Alpine w/S6 init, Zabbix Monitoring
Dockerfile
28
star
19

docker-nginx-proxy-cloudflare-companion

Automatically update CNAME records when Docker container starts via Cloudflare
Python
27
star
20

docker-spamassassin

Docker Spamassassin Spam filtering based on Alpine Linux
Dockerfile
26
star
21

docker-clamav

Docker ClamAV Image with Zabbix Monitoring and Customizable Configuration
Dockerfile
23
star
22

docker-baserow

Dockerized Baserow No/Low code data management application based on Alpine
Dockerfile
22
star
23

docker-nginx

Dockerzed webserver with many customizable options
Dockerfile
22
star
24

docker-nextcloud

Dockerized Nextcloud Server with many customizable options
17
star
25

docker-gitlab-ee

Dockerized Gitlab Enterprise Edition
Dockerfile
17
star
26

docker-debian

Docker Debian Base Images
Dockerfile
15
star
27

docker-discourse

Dockerized Discourse Forum
Dockerfile
15
star
28

docker-backuppc

Docker BackupPC with Zabbix monitoring support
Perl
15
star
29

docker-gcds

Docker Google Cloud Directory Sync service (GADS) w/S6 Overlay, Zabbix Monitoring
Dockerfile
14
star
30

docker-mariadb-backup

Docker MariaDB Backup Container w/ S6 Overlay, Zabbix Monitoring based on Alpine
Dockerfile
13
star
31

docker-zabbix

Dockerized Zabbix Server, Proxy, and Frontend
Dockerfile
13
star
32

docker-insync

Docker Insync Headless Client
Dockerfile
12
star
33

docker-rspamd

Dockerized Anti Spam Filter
Python
12
star
34

docker-nginx-ldap

Docker Nginx Image w/LDAP Authentication, Zabbix agent monitoring, S6 init, logrotate based on Alpine
Dockerfile
11
star
35

docker-bookstack

Dockerized Information Manager
Dockerfile
11
star
36

docker-mariadb

Docker MariaDB server w/ S6 Overlay, Zabbix Monitoring based on Alpine
11
star
37

docker-gitlab

Dockerized Gitlab CE w/Alpine Linux, Zabbix Monitoring and S6 Overlay
Dockerfile
10
star
38

docker-staytus

Docker Staytus Image w/s6 overlay, zabbix monitoring based on Alpine
HTML
10
star
39

docker-leantime

Dockerized Project Managment tool with many configurable options
Dockerfile
10
star
40

docker-otrs

Dockerized OTRS ITSM Helpdesk/Ticketing System based on Alpine w/Nginx
Dockerfile
9
star
41

docker-unbound

Docker Unbound DNS Resolver based on Alpine
Dockerfile
9
star
42

docker-postgres

Dockerized Postgresql Server with multiple databases/users, replication, and monitoring support
Dockerfile
9
star
43

docker-postfix

Dockerized MTA with many customizable features, LDAP, SASL, Milter, Relay Support
Dockerfile
8
star
44

docker-matomo

Dockerized Matomo (Piwik) Analytics
Dockerfile
8
star
45

docker-yourls

Dockerized YOURLS link shortener based on Alpine
Dockerfile
8
star
46

docker-invoiceninja

Dockerized Invoicing web application
Dockerfile
7
star
47

docker-nodejs

Docker NodeJS Base Images
7
star
48

docker-postfix-relay

Dockerized Postfix Relay for easy SMTP capabilities
Shell
7
star
49

docker-openvpn

Dockerized OpenVPN server w/Alpine+Debian Variants w/s6 overlay, and LDAP Authentication support
7
star
50

docker-rocketchat

Docker Rocketchat Server with S6 Initsystem and Zabbix Monitoring based on Alpine
6
star
51

docker-kopano

Dockerized Kopano Groupware server
Dockerfile
6
star
52

docker-n8n

Dockerized n8n workflow automation tool
Dockerfile
6
star
53

docker-listmonk

Dockerized Listmonk Mailing List server built iwth Alpine w/Zabbix Monitoring
Dockerfile
6
star
54

docker-cpuminer

Cryptocurrency Miner based on Alpine
6
star
55

docker-kopano-core

Dockerized Kopano Groupware Server
6
star
56

docker-grafana

Dockerfile
5
star
57

docker-moodle

Dockerized Moodle Learning Management System
Dockerfile
5
star
58

docker-loki

Dockerized Loki Log Analyzer
Dockerfile
5
star
59

docker-teampass

Dockerized Password Vault for Teams based on Alpine w/nginx,php-fpm
Dockerfile
5
star
60

docker-orbeon

Docker Orbeon Forms CE w/S6 Init, Tomcat, based on Alpine
Dockerfile
5
star
61

docker-redis

Docker Redis Server with S6 Initsystem and Zabbix Monitoring based on Alpine
5
star
62

docker-elasticsearch

Dockerized Elasticsearch based on Alpine linux
4
star
63

fusiondirectory-plugin-kopano

Plugin to manage users/groups for Kopano (fork of Zarafa) within Fusion Directory LDAP Manager
PHP
4
star
64

docker-novnc

Run GUI applications within a browser - Base image
Dockerfile
4
star
65

docker-flarum

Dockerized Flarum Web Forum Software based on Alpine
Shell
4
star
66

docker-registry

Dockerized Docker Registry
Dockerfile
4
star
67

docker-rabbitmq

Dockerized RabbitMQ server
Python
4
star
68

docker-gitlab-runner

Docker Gitlab runner w/ Zabbix monitoring support based on Alpine
4
star
69

docker-openeats

Dockerized Openeats Recipe manager based on Alpine Linux w/Zabbix Monitoring
Dockerfile
3
star
70

docker-restic

Dockerized Backup application
Dockerfile
3
star
71

docker-dovecot

Docker Dovecot IMAP server based on Alpine w/LDAP Support
TSQL
3
star
72

docker-uptimekuma

Dockerized Service availability monitoring system
Dockerfile
3
star
73

docker-draw-io

Docker Draw.IO image based on Alpine and Nginx
3
star
74

docker-logrotate

Docker Logrotate to keep logfiles compressed and rotated based on Alpine
Shell
3
star
75

docker-mailhog

Dockerized SMTP Test server
Dockerfile
3
star
76

docker-cachet

Dockerized Cachet Status monitoring application based on Alpine Linux
Dockerfile
3
star
77

docker-sentry

Dockerized Sentry.IO Exception tracking system based on Debian w/LDAP and SAML
Python
3
star
78

docker-airsonic-advanced

Dockerized Airsonic Advanced Server based on Alpine
Dockerfile
3
star
79

docker-limesurvey

Dockerized Limesurvey application based on Alpine
Dockerfile
3
star
80

docker-mongo

Docker MongoDB server w/ S6 Overlay, Zabbix Monitoring based on Alpine
3
star
81

docker-haraka

Docker Haraka MTA based on Alpine
JavaScript
3
star
82

docker-ruby

Docker Ruby base images w/ S6 Overlay and Zabbix monitoring support
3
star
83

docker-ubuntu

Dockerized Ubuntu Base Images
Dockerfile
2
star
84

docker-memcached

Docker Memcached Server w/ S6 Initsystem and Zabbix Monitoring based on Alpine
Dockerfile
2
star
85

home

Home-Manager configuration ala Nix flakes
Nix
2
star
86

docker-kopano-meet

Dockerfile
2
star
87

docker-soulseek

Dockerized Soulseek Client
Dockerfile
2
star
88

docker-kopano-kapi

Dockerfile
2
star
89

docker-kopano-konnect

Dockerfile
2
star
90

docker-olefy

Dockerized Olefy TCP listener for OLE Tools
Dockerfile
2
star
91

docker-logchimp

Dockerized Logchimp Application
Dockerfile
2
star
92

docker-transmission

Dockerized Transmission client
Dockerfile
2
star
93

docker-dind

Docker in Docker Image with Zabbix monitoring Support and --squash --compress options by default based on Alpine
Dockerfile
2
star
94

docker-matrix-bridges

Dockerized Matrix Bridges to interconnect services
Dockerfile
2
star
95

docker-monica

Dockerized Monica PRM
Dockerfile
2
star
96

tiredofit

2
star
97

docker-minio

Dockerized Minio Server based on Alpine
Dockerfile
2
star
98

docker-tomcat

Docker Apache Tomcat based on Alpine
2
star
99

docker-mongo-builder

Docker Image to build MongoDB and associated tools for Alpine Edge from aports/non-free
Dockerfile
2
star
100

nixos-config

NixOS configurations
Nix
1
star