Docker Postfix
Docker - Postfix with sasldb2 support
Build
|
|
Usage
Host Directories and Volume Mapping
Host | Inside Container | Mapping Required | Usage |
---|---|---|---|
${POSTFIX_CNF} | /postfix | Yes | postfix configuration volume |
${POSTFIX_HOSTNAME} | hostname | no | hostname inside container |
${TZ} | ${P_TZ} | no | time zone |
Postfix Configuration
Configuration Volume
Container will automatically exit if no configuration volume (${POSTFIX_CNF}
), or if configuration volume is empty.
The permission and ownership of ${POSTFIX_CNF}
is not important. Container start.sh
copies /postfix
to /etc/
and applies ownership and permission to /etc/postfix
accordingly.
Postfix configuration come with Alpine package install is included in the container at /postfix.pkg.tgz
. Retrieve it with following commands:
|
|
aliases
If aliases
is used, it should be placed at ${POSTFIX_CNF}/aliases
. Container start.sh
script will execute newaliases
.
In main.cf
:
|
|
sasldb2
If sasldb2 is to be used, sasldb2
and smtpd.conf
should be placed in ${POSTFIX_CNF}/sasl2/
. Container start.sh
script will copy them to /etc/sasl2/
.
Sample smtpd.conf
content:
|
|
Logs
There are two ways to log to journald.
/dev/log
Mount host /dev/log
to container /dev/log
to enable postfix logs to host logging system.
/dev/stdout
To have postfix log to stdout:
Add following to master.cf
|
|
Add following to main.cf
|
|
Show postfix log from journald:
|
|
Run
|
|
Compose
Get docker-compose template from image:
|
|
Fill in .env
according to your environment.
|
|
Repository
Contributors
Change Log
- 1.0
- Initial commit.
- 1.1
- Dockerfile remove apk update
- start.sh
- Use exec so start.sh can exit
- 3.5.3-r0
- Adopt Postfix version
- Postfix version 3.5.3-r0
- 3.5.4-r0
- Auto update to 3.5.4-r0
- 3.5.4-r0-p0
- Remove cyrus-sasl-plain
- 3.5.6-r0
- Auto update to 3.5.6-r0
- 3.5.7-r0
- Auto update to 3.5.7-r0
- 3.5.7-r2
- Auto update to 3.5.7-r2
- 3.5.8-r0
- Auto update to 3.5.8-r0
- 3.5.8-r0-p1
- Create /etc/sasl2 directory
- 3.5.8-r0-p2
- Fix start.sh
- 3.5.9-r0
- Auto update to 3.5.9-r0
- 3.5.9-r0-p0
- Force rebuild to use cyrus-sasl 2.1.27-r12
- 3.6.0-r0
- Auto update to 3.6.0-r0
- 3.6.1-r0
- Auto update to 3.6.1-r0
- 3.7.0-r2
- Auto update to 3.7.0-r2
- 3.7.0-r2-p1
- Add docker push github workflow
- 3.7.1-r1
- Auto update to 3.7.1-r1
- 3.7.2-r0
- Auto update to 3.7.2-r0
License
The MIT License
Copyright (c) 2022
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.