From 2faeb7c9481ee401ce40217e24208c7162421add Mon Sep 17 00:00:00 2001 From: "root@culturestrings" Date: Thu, 4 Jun 2020 10:57:21 +0000 Subject: postfix: make the configuration file site-agnostic. --- public/fs/etc/postfix/main-cf.sh | 5 ++++- public/fs/etc/postfix/main.cf.in | 12 ++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) mode change 100644 => 100755 public/fs/etc/postfix/main-cf.sh diff --git a/public/fs/etc/postfix/main-cf.sh b/public/fs/etc/postfix/main-cf.sh old mode 100644 new mode 100755 index 79e8e03..840aa9a --- a/public/fs/etc/postfix/main-cf.sh +++ b/public/fs/etc/postfix/main-cf.sh @@ -3,5 +3,8 @@ set -eu source /root/config/private/config/server.domains +source /root/config/private/config/hostname -sed -e 's/@server_domains@/'"${server_domains}"'/g' "$1" +sed -e 's/@server_domains@/'"${server_domains}"'/g' \ + -e 's/@smtphost@/'"${smtphost}"'/g' \ + "$1" diff --git a/public/fs/etc/postfix/main.cf.in b/public/fs/etc/postfix/main.cf.in index bcae80e..26b9530 100644 --- a/public/fs/etc/postfix/main.cf.in +++ b/public/fs/etc/postfix/main.cf.in @@ -1,6 +1,6 @@ # chain -myhostname = mail.culturestrings.org -mydomain = culturestrings.org +myhostname = mail.@smtphost@ +mydomain = @smtphost@ myorigin = $mydomain mydestination = $mydomain, localhost.$mydomain, localhost, @server_domains@ @@ -36,10 +36,10 @@ smtp_tls_loglevel = 3 smtp_tls_security_level = encrypt smtp_tls_CApath = /etc/ssl/certs -smtp_tls_CAfile = /srv/webroot/culturestrings.org/ssl/cert.pem +smtp_tls_CAfile = /srv/webroot/@smtphost@/ssl/cert.pem -smtpd_tls_key_file = /srv/webroot/culturestrings.org/ssl/privkey.pem -smtpd_tls_cert_file = /srv/webroot/culturestrings.org/ssl/fullchain.pem +smtpd_tls_key_file = /srv/webroot/@smtphost@/ssl/privkey.pem +smtpd_tls_cert_file = /srv/webroot/@smtphost@/ssl/fullchain.pem smtpd_tls_loglevel = 3 smtpd_tls_security_level = encrypt @@ -50,7 +50,7 @@ smtpd_tls_auth_only = yes smtpd_tls_received_header = yes smtpd_tls_CApath = /etc/ssl/certs -smtpd_tls_CAfile = /srv/webroot/culturestrings.org/ssl/cert.pem +smtpd_tls_CAfile = /srv/webroot/@smtphost@/ssl/cert.pem meta_directory = /usr/lib/postfix setgid_group = maildrop -- cgit v1.2.3