mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-09-12 17:34:44 +08:00
Added HEADER_CHECKS configuration option (#15)
* Added HEADER_CHECKS configuration option
This commit is contained in:
parent
4d6919e54c
commit
a9a09b0085
4 changed files with 29 additions and 3 deletions
|
@ -40,6 +40,7 @@ RUN true && \
|
|||
COPY supervisord.conf /etc/supervisord.conf
|
||||
COPY rsyslog.conf /etc/rsyslog.conf
|
||||
COPY opendkim.conf /etc/opendkim/opendkim.conf
|
||||
COPY header_checks /etc/header_checks
|
||||
COPY run.sh /run.sh
|
||||
COPY opendkim.sh /opendkim.sh
|
||||
RUN chmod +x /run.sh /opendkim.sh
|
||||
|
|
|
@ -138,6 +138,15 @@ Example:
|
|||
docker run --rm --name postfix -e "ALLOWED_SENDER_DOMAINS=example.com example.org" -e "MASQUERADED_DOMAINS=example.com" -p 1587:587 boky/postfix
|
||||
```
|
||||
|
||||
### `HEADER_CHECKS`
|
||||
|
||||
Each message header line is compared against a pre-configured list of patterns. When a match is found the corresponding action is executed. The default patterns can be found in the `header_checks` file. Simply append new or delete unwanted patterns. Set to a non-empty string (usually "1" or "yes") to enable.
|
||||
|
||||
Example:
|
||||
```
|
||||
docker run --rm --name postfix -e "HEADER_CHECKS="yes" example.org" -p 1587:587 boky/postfix
|
||||
```
|
||||
|
||||
## `DKIM`
|
||||
|
||||
**This image is equiped with support for DKIM.** If you want to use DKIM you will need to generate DKIM keys yourself.
|
||||
|
|
11
header_checks
Normal file
11
header_checks
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Sample For Dropping Headers:
|
||||
#/^Header: IfContains/ IGNORE
|
||||
/^Received:.*with ESMTPSA/ IGNORE
|
||||
/^Received:.*with ESMTPS/ IGNORE
|
||||
/^Received:.*with SMTP/ IGNORE
|
||||
/^Received:/ IGNORE
|
||||
/^X-Originating-IP:/ IGNORE
|
||||
/^X-Mailer:/ IGNORE
|
||||
/^X-PHP-Originating-Script:/ IGNORE
|
||||
/^User-Agent:/ IGNORE
|
||||
/^Mime-Version:/ REPLACE Mime-Version: 1.0
|
11
run.sh
11
run.sh
|
@ -195,9 +195,14 @@ else
|
|||
fi
|
||||
|
||||
if [ ! -z "$MASQUERADED_DOMAINS" ]; then
|
||||
echo -en "‣ $notice Setting up address masquerading: ${emphasis}$MASQUERADED_DOMAINS${reset}"
|
||||
postconf -e "masquerade_domains = $MASQUERADED_DOMAINS"
|
||||
postconf -e "local_header_rewrite_clients = static:all"
|
||||
echo -e "‣ $notice Setting up address masquerading: ${emphasis}$MASQUERADED_DOMAINS${reset}"
|
||||
postconf -e "masquerade_domains = $MASQUERADED_DOMAINS"
|
||||
postconf -e "local_header_rewrite_clients = static:all"
|
||||
fi
|
||||
|
||||
if [ ! -z "$HEADER_CHECKS" ]; then
|
||||
echo -e "‣ $notice Setting up header_checks"
|
||||
postconf -e "smtp_header_checks=regexp:/etc/header_checks"
|
||||
fi
|
||||
|
||||
DKIM_ENABLED=
|
||||
|
|
Loading…
Add table
Reference in a new issue