diff --git a/README.md b/README.md index 955a64c..ffe51e3 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,16 @@ TLS and OpenDKIM support are optional. -v /path/to/certs:/etc/postfix/certs \ --name postfix -d catatnight/postfix ``` +4. Customize configs for postfix + + ```bash + $ sudo docker run -p 25:25 \ + -e maildomain=mail.example.com -e smtp_user=user:pwd \ + -e postconf=key:value \ + --name postfix -d hkcomori/postfix + # Set multiple configs: -e postconf=key1:value1,key2:value2,...,keyN:valueN + # Restrictions: key, value must not contain `,`, `:` + ``` ## Note + Login credential should be set to (`username@mail.example.com`, `password`) in Smtp Client diff --git a/assets/install.sh b/assets/install.sh index 0b2aaff..bcd83e9 100755 --- a/assets/install.sh +++ b/assets/install.sh @@ -68,6 +68,13 @@ if [[ -n "$(find /etc/postfix/certs -iname *.crt)" && -n "$(find /etc/postfix/ce postconf -P "submission/inet/smtpd_recipient_restrictions=permit_sasl_authenticated,reject_unauth_destination" fi +############# +# postconf +############# +echo "$postconf" | tr , \\n | while IFS=':' read -r _key _value; do + postconf -e $_key=$_value; +done + ############# # opendkim #############