Sign inSign up

siebsie23/docker-postal

By siebsie23

Updated 7 months ago

Dockerized Postal SMTP server based on Alpine Linux and Ruby

Image
0

1.2K

siebsie23/docker-postal repository overview

Docker-Postal

GitHub release Build Status


About

This is a fork of the tiredofit/docker-postal repository that is updated to use the latest version of Postal and fix some bugs.

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

  • Contains Fail2Ban for blocking repeat authentication offenders

Prerequisites

Installation

Use the pre-built package

Prebuilt images are available on Docker Hub at siebsie23/docker-postal and are built daily.

Available tags:

Image tagDescription
mainPostal image built on the 'main' branch containing the latest and in-development features (Stuff will break, use at your own risk!)
latestLatest postal v3 release
*.*.*Postal image built on a release tag. To view all available images visit siebsie23/docker-postal/tags
Build from Source

Clone this repository and build the image with make build POSTAL_VERSION="version" version being a valid postal branch or tag.

Configuration

Quick Start
Persistent Storage

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

DirectoryDescription
/config/Auto generated Postal Config and Signing Key resides here
/logs/Logfiles
/assets/customOptional 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:

ImageDescription
OS BaseCustomized Image based on Alpine Linux
Admin Accounts
ParameterDescriptionDefault
ADMIN_EMAILEmail address of admin[email protected]
ADMIN_FNAMEName of Admin First NamePostal
ADMIN_LNAMEName of Admin Last NameAdmin
ADMIN_PASSPassword of Admin userPostalMailServer
Application Settings
ParameterDescriptionDefault
MAXIMUM_DELIVERY_ATTEMPTSMaximum Delivery Attempts before failing18
MAXIMUM_HOLD_EXPIRY_DAYSMaximum Holding days before expiring7
SUPPRESSION_LIST_AUTOMATIC_REMOVAL_DAYSSuppression List expiry in days30
DNS Settings
ParameterDescriptionDefault
DNS_HELO_HOSTNAMEHELO Domain Name Mail Serverpostal.example.com
DNS_MXMX Record Hostnames - Seperate multiple with commas
DNS_SPF_INCLUDESPF Hostnamespf.$DNS_HELO_HOSTNAME
DNS_RETURN_PATH_DOMAINReturn path Hostnamerp.$DNS_HELO_HOSTNAME
DNS_ROUTE_DOMAINRouting Domainroutes.$DNS_HELO_HOSTNAME
DNS_TRACK_DOMAINTracking Domaintrack.$DNS_HELO_HOSTNAME
DNS_DKIM_IDENTIFIERDKIM Identifierpostal
DNS_DOMAIN_VERIFY_PREFIXDomain verification prefixpostal-verification
DNS_RETURN_PATH_PREFIXCustom Return Path Prefixpsrp
Security Settings
ParameterDescriptionDefault
ENABLE_FAIL2BANBlock hsots that repeatedly fail authenticationTRUE
FAIL2BAN_LOG_FILELog Location for Fail2ban/logs/fail2ban/fail2ban.log
FAIL2BAN_TIME_FINDTrack failures for this time period10m
FAIL2BAN_TIME_BANTime to ban repeat offenders10m
FAIL2BAN_MAX_RETRYBan after how many tries during time period5
Performance Settings
ParameterDescriptionDefault
WORKERS_THREADSAmount of Threads per worker.2
WEB_MAX_THREADSMaximum amount of webserver threads5
Logging Settings
ParameterDescriptionDefault
LOG_CONSOLELog to Stdout Console true or falsetrue
LOG_PATHLog Location/logs/
LOG_SIZE_MAXMaximum Log Size in KB9999
Database Settings
ParameterDescriptionDefault
DB_HOSTHostname of MariaDB Container e.g. postal-db
DB_NAMEName of MariaDB Database e.g. postal
DB_USERDatabase Username e.g. postal
DB_PASSPassword for Above User e.g. password
DB_PORTMariaDB Server Port3306
DB_ROOT_PASSNeeded for first boot - Assigns privileges to $DB_USER. This is your MariaDB Root Pass
Anti Spam Settings
ParameterDescriptionDefault
ENABLE_SPAMASSASSINEnable Spamassassin true or falsefalse
SPAMASSASSIN_HOSTHostname of Spamassassin daemon
SPAMASSASSIN_PORTTCP Port of spamassassin daemon737
ParameterDescriptionDefault
ENABLE_RSPAMDEnable RSpamD checking true or falsefalse
RSPAMD_FLAGSFlags to pass to rspamd daemonnull
RSPAMD_HOSTHostname of rspamd daemon
RSPAMD_PASSRSpamd controller passwordnull
RSPAMD_PORTTCP Port of rspamd daemon11334
RSPAMD_SSLUse SSL for connecting to rspamdFALSE
ParameterDescriptionDefault
SPAM_THRESHOLDAmount to classify as Spam5
SPAM_FAILURE_THRESHOLDAmount to fail as Spam20
Anti Virus Settings
ParameterDescriptionDefault
ENABLE_CLAMAVEnable ClamAV true or falsefalse
CLAMAV_HOSTHostname of Clamd Server
CLAMAV_PORTTCP Port of Clamd Server3310
SMTP Settings
Client
ParameterDescriptionDefault
SMTP_CLIENT_OPEN_TIMEOUTTimeout for an Open Connection in seconds30
SMTP_CLIENT_READ_TIMEOUTTimeout for Reading Data in seconds30
Server
ParameterDescriptionDefault
SMTP_SERVER_HOSTNAMESMTP Server hostname$DNS_HELO_HOSTNAME
SMTP_SERVER_ENABLE_TLSEnable TLSfalse
SMTP_SERVER_LOG_CONNECTIONSLog SMTP Connectionsfalse
SMTP_SERVER_MAX_MESSAGE_SIZEMax message size in Megabytes50
SMTP_SERVER_PORTListening Port for Postal Main SMTP Server25
SMTP_SERVER_PROXY_PROTOCOLUtilize Proxy Protocolfalse
SMTP_SERVER_TLS_SSL_VERSIONSSL VersionsSSLv23
SMTP_SERVER_TLS_CERTTLS Cert Location (Will authgenerate if not exist)/certs/cert.pem
SMTP_SERVER_TLS_CIPHERSTLS Ciphers to use
SMTP_SERVER_TLS_KEYTLS Key Location (Will autogenerate if not exist)/certs/key.pem
Management System
ParameterDescriptionDefault
SMTP_FROM_ADDRESSFrom Address for Postam Management System[email protected]
SMTP_FROM_NAMEFrom Name for Postal Management SystemPostal
SMTP_HOSTSMTP Server to be used to send messages from Postal Management System to users127.0.0.1
SMTP_PORTSMTP Port to be used to send messages from Postal Management System to Users25
SMTP_USERUsername to authenticate to SMTP Server
SMTP_PASSPassword to authenticate to SMTP Server
Other Settings
ParameterDescriptionDefault
CONFIG_FILEConfiguration Filepostal.yml
CONFIG_PATHConfiguration Path/config/
FAST_SERVER_BIND_IPBind IP for the Web Interface0.0.0.0
FAST_SERVER_BIND_PORT_TLSBind Port for the TLS Tracking Service8443
FAST_SERVER_BIND_PORTBind Port for the Tracking Server8080
SETUP_TYPEChoose AUTO or MANUAL Setup type - Auto uses these environment variablesAUTO
SIGNING_KEY_FILESigning Key Filesigning.key
SIGNING_KEY_SIZESigning Key Size1024
WEB_BIND_ADDRESSBind IP for the Web Interface0.0.0.0
WEB_PORTBind Port for the Web Interface5000
WEB_HOSTNAMEHostname for Web Interfacepostal.example.com
WEB_PROTOCOLProtocol for Web Interface http or httpshttp
WORKER_HEALTH_SERVER_BIND_ADDRESSBind IP for the worker health server0.0.0.0
WORKER_HEALTH_SERVER_PORTBind Port for the worker health server9090
Networking
PortDescription
25SMTP
80Web Interface
8080Fast Server /Tracking
8443Fast Server / Tracking
5000Puma`

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

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.

License

MIT. See LICENSE for more details.

References

Tag summary

Content type

Image

Digest

sha256:f1200609e

Size

153.2 MB

Last updated

7 months ago

docker pull siebsie23/docker-postal