Rename vars

Signed-off-by: René Jochum <rene@jochum.dev>
master
René Jochum 4 years ago
parent a4cdbe7ad2
commit f7d8ea092b

@ -12,12 +12,14 @@ ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO postfix;
## Environment variables
- HOSTNAME - Host-/Mailname, defaults to the containers HOSTNAME.
- DOVECOT_HOST - Dovecot host, defaults to `dovecot`
- DOVECOT_AUTH_PORT - Auth port, defaults to `12345`
- DOVECOT_LMTP_PORT - LMTP port, defaults to `2525`
- MYDOMAIN
- SUBNET
- RELAYNETS
- RELAYHOST - outgoing relay
- RELAY_NETS
- RELAY_HOST - outgoing relay
- SQL_TYPE - either `pgsql` or `mysql`
- SQL_USER - readonly Database user
- SQL_PASSWORD

@ -2,17 +2,17 @@ compatibility_level=2
# basic domain settings
myhostname = {{ HOSTNAME }}
mailname = {{ HOSTNAME }}
mydomain = {{ MYDOMAIN }}
myorigin = {{ HOSTNAME }}
mydestination = $myhostname, localhost
# mynetworks = 192.168.1.0/24, 127.0.0.0/8
mynetworks = 127.0.0.1/32 [::1]/128 {{ SUBNET }} {{ RELAYNETS }}
mynetworks = 127.0.0.1/32 [::1]/128 {{ SUBNET }} {{ RELAY_NETS }}
myorigin = $mydomain
relay_domains = proxy:{{ SQL_TYPE }}:/etc/postfix/sql/relay_domains.cf
maillog_file = /dev/stdout
# In kube we don't often don't have a stable outgoing IP Address, use a relayhost for this.
relayhost = {{ RELAYHOST }}
relayhost = {{ RELAY_HOST }}
# enable auth via Dovecot
smtpd_sasl_auth_enable = yes
@ -29,7 +29,7 @@ virtual_alias_maps = proxy:{{ SQL_TYPE }}:/etc/postfix/sql/virtual_alias_maps.cf
virtual_uid_maps = static:8
virtual_gid_maps = static:8
virtual_minimum_uid = 8
virtual_transport=lmtp:inet:{{ DOVECOT_HOST }}:2525
virtual_transport=lmtp:inet:{{ DOVECOT_HOST }}:{{ DOVECOT_LMTP_PORT }}
# also local accounts are handled via virtual users, configure aliases for those in PostfixAdmin
local_transport = virtual

@ -26,9 +26,15 @@ if "MESSAGE_SIZE_LIMIT" not in os.environ:
if "DOVECOT_HOST" not in os.environ:
os.environ['DOVECOT_HOST'] = 'dovecot'
if "DOVECOT_LMTP_PORT" not in os.environ:
os.environ['DOVECOT_LMTP_PORT'] = '2525'
if "DOVECOT_AUTH_PORT" not in os.environ:
os.environ['DOVECOT_AUTH_PORT'] = '12345'
if "RELAY_NETS" not in os.environ:
os.environ['RELAY_NETS'] = ''
for postfix_file in glob.glob("/conf/**/**.cf", recursive=True):
p = pathlib.Path(postfix_file)
p = p.relative_to(*p.parts[:2])

Loading…
Cancel
Save