Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ linux/arm64

* `POSTFIX_DEBUG`: Enable debug (default `false`)
* `POSTFIX_MESSAGE_SIZE_LIMIT`: The maximal size in bytes of a message, including envelope information (default `26214400`)
* `POSTFIX_STRIP_SENDER_HEADER`: Strip the Sender header from incoming emails to prevent SES rejection issues (default `false`)
* `POSTFIX_SMTPD_TLS`: Enabling TLS in the Postfix SMTP server (default `false`, possible values: `true`|`may`|`encrypt`|`ask`|`require`, see [Postfix TLS README](https://www.postfix.org/TLS_README.html#client_tls_levels))
* `POSTFIX_SMTPD_TLS_CERT_FILE`: File with the Postfix SMTP server RSA certificate in PEM format
* `POSTFIX_SMTPD_TLS_ECCERT_FILE`: File with the Postfix SMTP server RSA private key in PEM format
Expand Down
1 change: 1 addition & 0 deletions rootfs/etc/cont-init.d/00-env
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ MAIL_ENCRYPTION=${MAIL_ENCRYPTION:-null}

POSTFIX_DEBUG=${POSTFIX_DEBUG:-false}
POSTFIX_MESSAGE_SIZE_LIMIT=${POSTFIX_MESSAGE_SIZE_LIMIT:-26214400}
POSTFIX_STRIP_SENDER_HEADER=${POSTFIX_STRIP_SENDER_HEADER:-false}
POSTFIX_SMTPD_TLS=${POSTFIX_SMTPD_TLS:-false}
POSTFIX_SMTP_TLS=${POSTFIX_SMTP_TLS:-false}
POSTFIX_RELAYHOST_AUTH_ENABLE=${POSTFIX_RELAYHOST_AUTH_ENABLE:-false}
Expand Down
14 changes: 14 additions & 0 deletions rootfs/etc/cont-init.d/15-config-postfix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,20 @@ EOL
chmod o= /etc/postfix/mysql-virtual-alias-domains-and-subdomains.cf
chgrp postfix /etc/postfix/mysql-virtual-alias-domains-and-subdomains.cf

if [ "$POSTFIX_STRIP_SENDER_HEADER" = "true" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add the default value for this env at

POSTFIX_DEBUG=${POSTFIX_DEBUG:-false}
POSTFIX_MESSAGE_SIZE_LIMIT=${POSTFIX_MESSAGE_SIZE_LIMIT:-26214400}
POSTFIX_SMTPD_TLS=${POSTFIX_SMTPD_TLS:-false}
POSTFIX_SMTP_TLS=${POSTFIX_SMTP_TLS:-false}
POSTFIX_RELAYHOST_AUTH_ENABLE=${POSTFIX_RELAYHOST_AUTH_ENABLE:-false}
POSTFIX_RELAYHOST_SSL_ENCRYPTION=${POSTFIX_RELAYHOST_SSL_ENCRYPTION:-false}
#POSTFIX_SPAMHAUS_DQS_KEY=${POSTFIX_SPAMHAUS_DQS_KEY:-null}
#POSTFIX_RELAYHOST_USERNAME=${POSTFIX_RELAYHOST_USERNAME:-null}
#POSTFIX_RELAYHOST_PASSWORD=${POSTFIX_RELAYHOST_PASSWORD:-null}

echo "Setting Postfix header_checks to strip Sender header"
cat >/etc/postfix/header_checks <<EOL
/^Sender:/ IGNORE
EOL
cat >>/etc/postfix/main.cf <<EOL

# Header checks configuration
mime_header_checks = regexp:/etc/postfix/header_checks
header_checks = regexp:/etc/postfix/header_checks
EOL
postmap /etc/postfix/header_checks
fi

if [ -f "/data/postfix-main.alt.cf" ]; then
cat "/data/postfix-main.alt.cf" > /etc/postfix/main.cf
fi
Expand Down