All Projects → wader → postfix-relay

wader / postfix-relay

Licence: MIT License
Postfix SMTP relay docker image

Programming Languages

shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to postfix-relay

Hermes-Secure-Email-Gateway
Hermes Secure Email Gateway is a Free Open Source Ubuntu 18.04 or 20.04 Server based Email Gateway that provides Spam, Virus and Malware protection, full in-transit and at-rest email encryption as well as email archiving. It features the latest email authentication techniques such as SPF, DKIM and DMARC.
Stars: ✭ 35 (-53.95%)
Mutual labels:  postfix, spf, dkim
Docker Postfix
Simple SMTP relay docker image.
Stars: ✭ 162 (+113.16%)
Mutual labels:  postfix, smtp-server
mailauth
Command line utility and a Node.js library for email authentication
Stars: ✭ 57 (-25%)
Mutual labels:  spf, dkim
ControlCenter
Mirrored from GitLab! Monitoring and automation for Open Source email servers, starting with Postfix. Please do not submit issues or PRs here - join us at: https://gitlab.com/lightmeter
Stars: ✭ 88 (+15.79%)
Mutual labels:  postfix, smtp-server
Maddy
✉️ Composable all-in-one mail server.
Stars: ✭ 2,800 (+3584.21%)
Mutual labels:  spf, dkim
smf-spf
It's a lightweight, fast and reliable Sendmail milter that implements the Sender Policy Framework
Stars: ✭ 12 (-84.21%)
Mutual labels:  postfix, spf
Ansible Postfix
Ansible role to set up postfix in Debian-like systems
Stars: ✭ 102 (+34.21%)
Mutual labels:  relay, postfix
Docker Postfix
Simple SMTP server / postfix null relay host for your Docker and Kubernetes containers. Based on Alpine Linux.
Stars: ✭ 163 (+114.47%)
Mutual labels:  postfix, smtp-server
docker-mail-server
Ansible playbooks to deploy a full featured mail server stack using Docker.
Stars: ✭ 47 (-38.16%)
Mutual labels:  postfix, dkim
mailserver
Simple and full-featured mail server using Docker
Stars: ✭ 88 (+15.79%)
Mutual labels:  postfix, dkim
Haraka
A fast, highly extensible, and event driven SMTP server
Stars: ✭ 4,069 (+5253.95%)
Mutual labels:  spf, dkim
mailsec-check
Another utility to analyze state of deployment of security-related email protocols.
Stars: ✭ 37 (-51.32%)
Mutual labels:  spf, dkim
smtp-dkim-signer
SMTP-proxy that DKIM-signs e-mails before submission to an upstream SMTP-server.
Stars: ✭ 28 (-63.16%)
Mutual labels:  dkim, smtp-server
Postfixadmin
PostfixAdmin - web based virtual user administration interface for Postfix mail servers
Stars: ✭ 509 (+569.74%)
Mutual labels:  postfix, smtp-server
thundersec
ThunderSec is a security plugin for Mozilla Thunderbird that creates several pieces of additional security functionality, including DNSBL, RBL, SURBL, DKIM and SPF.
Stars: ✭ 42 (-44.74%)
Mutual labels:  spf, dkim
webadmin
SophiMail Webadmin and Dashboard
Stars: ✭ 48 (-36.84%)
Mutual labels:  postfix, smtp-server
toolbox-wiki
Internet.nl toolbox - how-to's for modern mail security standards (DMARC, DKIM, SPF and DANE)
Stars: ✭ 96 (+26.32%)
Mutual labels:  spf, dkim
Send2KindleBot
Send to Kindle Telegram Bot
Stars: ✭ 111 (+46.05%)
Mutual labels:  postfix
smtp-translator
An SMTP server that converts emails into Pushover notifications.
Stars: ✭ 23 (-69.74%)
Mutual labels:  smtp-server
sender policy flattener
Compact large SPF chains into flat blocks of IP addresses
Stars: ✭ 25 (-67.11%)
Mutual labels:  spf

postfix-relay

Postfix SMTP relay docker image. Useful for sending email without using an external SMTP server.

Default configuration is an open relay that relies on docker networking for protection. So be careful to not expose it publicly.

Usage

docker pull mwader/postfix-relay or clone/build it yourself. Docker hub image is built for amd64, arm/v7 and arm64.

Postfix variables

Postfix configuration options can be set using POSTFIX_<name> environment variables. See Dockerfile for default configuration. You probably want to set POSTFIX_myhostname (the FQDN used by 220/HELO).

Note that POSTFIX_myhostname will change the postfix option myhostname.

You can modify master.cf using postconf with POSTFIXMASTER_ variables. All double __ symbols will be replaced with /. For example

Postfix master.cf variables

- POSTFIXMASTER_submission__inet=submission inet n - y - - smtpd

will produce

postconf -Me submission/inet="submission inet n - y - - smtpd"

Postfix lookup tables

You can also create multiline tables using POSTMAP_<filename> like this example:

environment:
  - POSTFIX_transport_maps=hash:/etc/postfix/transport
  - |
    POSTMAP_transport=gmail.com smtp
    mydomain.com relay:[relay1.mydomain.com]:587
    * relay:[relay2.mydomain.com]:587

which will generate file /etc/postfix/transport

gmail.com smtp
mydomain.com relay:[relay1.mydomain.com]:587
* relay:[relay2.mydomain.com]:587

and run postmap /etc/postfix/transport.

OpenDKIM variables

OpenDKIM configuration options can be set using OPENDKIM_<name> environment variables. See Dockerfile for default configuration. For example OPENDKIM_Canonicalization=relaxed/simple.

Using docker run

docker run -e POSTFIX_myhostname=smtp.domain.tld mwader/postfix-relay

Using docker-compose

app:
  # use hostname "smtp" as SMTP server

smtp:
  image: mwader/postfix-relay
  restart: always
  environment:
    - POSTFIX_myhostname=smtp.domain.tld
    - OPENDKIM_DOMAINS=smtp.domain.tld

Logging

By default container only logs to stdout. If you also wish to log mail.* messages to file on persistent volume, you can do something like:

environment:
  ...
  - RSYSLOG_LOG_TO_FILE=yes
  - RSYSLOG_TIMESTAMP=yes
volumes:
  - /your_local_path:/var/log/

Known issues

I see key data is not secure: /etc/opendkim/keys can be read or written by other users error messages.

Some Docker distributions like Docker for Windows and RancherOS seems to handle volume permission in way that does not work with OpenDKIM default behavior of ensuring safe permissions on private keys.

A workaround is to disable the check using a OPENDKIM_RequireSafeKeys=no environment variable.

SPF

When sending email using your own SMTP server it is probably a good idea to setup SPF for the domain you're sending from.

DKIM

To enable DKIM, specify a whitespace-separated list of domains in the environment variable OPENDKIM_DOMAINS. The default DKIM selector is "mail", but can be changed to "<selector>" using the syntax OPENDKIM_DOMAINS=<domain>=<selector>.

At container start, RSA key pairs will be generated for each domain unless the file /etc/opendkim/keys/<domain>/<selector>.private exists. If you want the keys to persist indefinitely, make sure to mount a volume for /etc/opendkim/keys, otherwise they will be destroyed when the container is removed.

DNS records to configure can be found in the container log or by running docker exec <container> sh -c 'cat /etc/opendkim/keys/*/*.txt you should see something like this:

$ docker exec 7996454b5fca sh -c 'cat /etc/opendkim/keys/*/*.txt'

mail._domainkey.smtp.domain.tld. IN	TXT	( "v=DKIM1; h=sha256; k=rsa; "
	  "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Dx7wLGPFVaxVQ4TGym/eF89aQ8oMxS9v5BCc26Hij91t2Ci8Fl12DHNVqZoIPGm+9tTIoDVDFEFrlPhMOZl8i4jU9pcFjjaIISaV2+qTa8uV1j3MyByogG8pu4o5Ill7zaySYFsYB++cHJ9pjbFSC42dddCYMfuVgrBsLNrvEi3dLDMjJF5l92Uu8YeswFe26PuHX3Avr261n"
	  "j5joTnYwat4387VEUyGUnZ0aZxCERi+ndXv2/wMJ0tizq+a9+EgqIb+7lkUc2XciQPNuTujM25GhrQBEKznvHyPA6fHsFheymOuB763QpkmnQQLCxyLygAY9mE/5RY+5Q6J9oDOQIDAQAB" )  ; ----- DKIM key mail for smtp.domain.tld

License

postfix-relay is licensed under the MIT license. See LICENSE for the full license text.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].