feat(store): add postfix-relay app (#974)

Co-authored-by: Nicolas Meienberger <47644445+meienberger@users.noreply.github.com>
This commit is contained in:
JigSaw 2023-08-10 00:23:00 +02:00 committed by GitHub
parent 3f3d471fec
commit cf9a3dd55b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 140 additions and 0 deletions

View File

@ -0,0 +1,72 @@
{
"$schema": "../schema.json",
"name": "Postfix Mail Relay",
"available": true,
"exposable": false,
"no_gui": true,
"port": 2525,
"id": "postfix-relay",
"tipi_version": 1,
"version": "1.4.0",
"categories": [
"utilities"
],
"description": "Simple SMTP relay for environments where you may have private servers with no Internet connection.",
"short_desc": "Simple SMTP relay for environments where you may have private servers with no Internet connection.",
"author": "shamil",
"source": "https://github.com/shamil/docker-postfix-relay",
"form_fields": [
{
"type": "text",
"label": "Accepted Networks",
"hint": "Space delimited list of networks to accept mail from.",
"placeholder": "192.168.0.0/16 172.16.0.0/12 10.0.0.0/8",
"env_variable": "RELAY_ACCEPTED_NETWORKS"
},{
"type": "text",
"label": "SMTP Host",
"hint": "External relay DNS name.",
"placeholder": "smtp.sendgrid.net",
"required": true,
"env_variable": "RELAY_SMTP_HOST"
},
{
"type": "text",
"label": "SMTP Login",
"hint": "Login to connect to the external relay.",
"placeholder": "apikey",
"required": true,
"env_variable": "RELAY_SMTP_LOGIN"
},
{
"type": "password",
"label": "SMTP Password",
"hint": "Password to connect to the external relay.",
"placeholder": "password",
"required": true,
"env_variable": "RELAY_SMTP_PASSWORD"
},
{
"type": "number",
"label": "SMTP Port",
"hint": "External relay TCP port.",
"placeholder": "25",
"required": false,
"env_variable": "RELAY_SMTP_PORT"
},
{
"type": "text",
"label": "TLS Verify",
"hint": "Trust level for checking remote side cert: http://www.postfix.org/postconf.5.html#smtp_tls_security_level",
"placeholder": "none|may|encrypt|dane|dane-only|fingerprint|verify|secure",
"env_variable": "RELAY_TLS_VERIFY"
},
{
"type": "text",
"label": "Use TLS",
"hint": "Remote require tls.",
"placeholder": "yes|no",
"env_variable": "RELAY_USE_TLS"
}
]
}

View File

@ -0,0 +1,31 @@
version: "3.8"
services:
postfix-relay:
container_name: postfix-relay
# user: root
image: simenduev/postfix-relay:1.4.0
restart: unless-stopped
ports:
- ${APP_PORT}:25
volumes:
- ${APP_DATA_DIR}/data/config:/root/config:rw
environment:
- ACCEPTED_NETWORKS=${RELAY_ACCEPTED_NETWORKS}
- SMTP_HOST=${RELAY_SMTP_HOST}
- SMTP_LOGIN=${RELAY_SMTP_LOGIN}
- SMTP_PASSWORD=${RELAY_SMTP_PASSWORD}
- SMTP_PORT=${RELAY_SMTP_PORT}
- TLS_VERIFY=${RELAY_TLS_VERIFY}
- USE_TLS=${RELAY_USE_TLS}
healthcheck:
test: netstat -an | grep 25 > /dev/null; if [ 0 != $? ]; then exit 1; fi;
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
- tipi_main_network
labels:
# Main
traefik.enable: false

View File

@ -0,0 +1,37 @@
# Postfix Mail Relay
Simple SMTP relay, originally based on [alterrebe/docker-mail-relay](https://github.com/alterrebe/docker-mail-relay), but has been rewritten since.
## Description
The container provides a simple SMTP relay for environments like Amazon VPC where you may have private servers with no Internet connection
and therefore with no access to external mail relays (e.g. Amazon SES, SendGrid and others). You need to supply the container with your
external mail relay address and credentials. The image is tested with `Amazon SES`, `Sendgrid`, `Gmail` and `Mandrill`
## Changes since `alterrebe/docker-mail-relay`
* Uses `alpine` image instead of `ubuntu`.
* Uses `envsubst` for templating instead of `j2cli`.
* All output goes to `stdout` and `stderr` including `maillog`.
* Included `superviserd` event watcher which will exit the `supervisord` process if one of the monitored processes dies unexpectedly.
* Doesn't use TLS on `smtpd` side.
* And other changes to make the image as **KISS** as possible
## Changed in version `1.3.0`
* Remove `rsyslog` dependancy
* Remove `supervisor`
* Even more **KISS**, just single script used to configure and run `postfix`
## Environment variables
| ENV. Variable | Description |
| ------------------------ | -----------------------------------------------------------------------------------------------------------------------------------|
| `ACCEPTED_NETWORKS` | Space delimited list of networks to accept mail from. Default: `192.168.0.0/16 172.16.0.0/12 10.0.0.0/8` |
| `RECIPIENT_RESTRICTIONS` | Space delimited list of allowed `RCPT TO` addresses. Default: **unrestricted** |
| `SMTP_HOST` | External relay DNS name. Default: `email-smtp.us-east-1.amazonaws.com` |
| `SMTP_LOGIN` | Login to connect to the external relay. **Required** |
| `SMTP_PASSWORD` | Password to connect to the external relay. **Required** |
| `SMTP_PORT` | External relay TCP port. Default: `25` |
| `TLS_VERIFY` | Trust level for checking remote side cert. Default: `may` (<http://www.postfix.org/postconf.5.html#smtp_tls_security_level>) |
| `USE_TLS` | Remote require tls. Must be `yes` or `no`. Default: `no` |

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB