introducing ENABLE_SRS env variable (Closes: #906, #852)

* making postsrsd optional
* added tests, added documentation
This commit is contained in:
17Halbe 2018-03-18 20:15:06 +01:00 committed by Johan Smits
parent a420b15370
commit 2167108ec0
9 changed files with 57 additions and 7 deletions

View file

@ -27,6 +27,7 @@ DEFAULT_VARS["POSTMASTER_ADDRESS"]="${POSTMASTER_ADDRESS:="postmaster@domain.com
DEFAULT_VARS["POSTSCREEN_ACTION"]="${POSTSCREEN_ACTION:="enforce"}"
DEFAULT_VARS["SPOOF_PROTECTION"]="${SPOOF_PROTECTION:="0"}"
DEFAULT_VARS["TLS_LEVEL"]="${TLS_LEVEL:="modern"}"
DEFAULT_VARS["ENABLE_SRS"]="${ENABLE_SRS:="0"}"
DEFAULT_VARS["REPORT_RECIPIENT"]="${REPORT_RECIPIENT:="0"}"
DEFAULT_VARS["REPORT_INTERVAL"]="${REPORT_INTERVAL:="daily"}"
##########################################################################
@ -126,6 +127,11 @@ function register_functions() {
_register_setup_function "_setup_spoof_protection"
fi
if [ "$ENABLE_SRS" = 1 ]; then
_register_setup_function "_setup_SRS"
_register_start_daemon "_start_daemons_postsrsd"
fi
_register_setup_function "_setup_postfix_access_control"
if [ ! -z "$AWS_SES_HOST" -a ! -z "$AWS_SES_USERPASS" ]; then
@ -733,6 +739,14 @@ function _setup_postfix_aliases() {
fi
}
function _setup_SRS() {
notify 'task' 'Setting up SRS'
postconf -e "sender_canonical_maps = tcp:localhost:10001"
postconf -e "sender_canonical_classes = envelope_sender"
postconf -e "recipient_canonical_maps = tcp:localhost:10002"
postconf -e "recipient_canonical_classes = envelope_recipient,header_recipient"
}
function _setup_dkim() {
notify 'task' 'Setting up DKIM'
@ -1292,6 +1306,11 @@ function _start_daemons_opendmarc() {
supervisorctl start opendmarc
}
function _start_daemons_postsrsd(){
notify 'task' 'Starting postsrsd ' 'n'
supervisorctl start postsrsd
}
function _start_daemons_postfix() {
notify 'task' 'Starting postfix' 'n'
supervisorctl start postfix