Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Alpine 3.14 / use lmdb instead of hash + btree #3

Merged
merged 2 commits into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.12
FROM alpine:3.14

RUN apk add --no-cache \
bash \
Expand Down
14 changes: 7 additions & 7 deletions etc/postfix/main_multi.cf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ smtpd_banner = $myhostname ESMTP $mail_name (Commodore Amiga)
# for syntax details. Adjust the file "etc/mail/aliases" which is
# included in my "kubernetes-postfix" Git repository accordingly.
# Same is true for "$alias_database" (see next parameter).
alias_maps = hash:/etc/mail/aliases
alias_maps = lmdb:/etc/mail/aliases
# The alias databases for local(8) delivery that are updated with "newaliases".
# This is a separate configuration parameter because not all the tables
# specified with "$alias_maps" have to be local files.
# The script "service/postfix/run" which basically starts Postfix in the pod
# run's "newaliases" command during startup.
alias_database = hash:/etc/mail/aliases
alias_database = lmdb:/etc/mail/aliases

# The maximal size of any local(8) individual mailbox or maildir file,
# or zero (no limit).
Expand Down Expand Up @@ -106,15 +106,15 @@ virtual_mailbox_domains = domain.tld anotherdomain.tld
# Replace www.xxx.yyy.zzz with the IP address of your LMTP server of course!
virtual_transport = lmtp:inet:www.xxx.yyy.zzz:2026

# Virtual user map. The script "service/postfix/run" will create a hash map
# Virtual user map. The script "service/postfix/run" will create a map
# of the virual users you specified here. See file "etc/postfix/vmailbox" as
# an example and for more information. Basically you specify all users here
# for which you want to receive mails line by line.
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_mailbox_maps = lmdb:/etc/postfix/vmailbox

# Optional lookup tables that alias specific mail addresses or domains to
# other local or remote address.
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_alias_maps = lmdb:/etc/postfix/virtual


###############################################################################
Expand Down Expand Up @@ -144,7 +144,7 @@ smtpd_tls_key_file = /etc/postfix/certs/tls.key
# Sender MAY use TLS but we also accept unencrypted connections.
smtpd_tls_security_level = may
smtpd_tls_loglevel = 1
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_database = lmdb:${data_directory}/smtpd_scache

# Better forward secrecy settings. With prime-field EDH, OpenSSL wants the
# server to provide two explicitly-selected (prime, generator) combinations.
Expand All @@ -163,7 +163,7 @@ smtpd_tls_dh512_param_file = ${config_directory}/dh512.pem
# Postfix MAY use TLS encryption if destination supports it.
smtp_tls_security_level = may
smtp_tls_loglevel = 1
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_tls_session_cache_database = lmdb:${data_directory}/smtp_scache
# A long list of all of trusted certificate authorities concatenated together.
# This one is maintained by Alpine Linux but you can add your own if you want.
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
Expand Down
14 changes: 7 additions & 7 deletions etc/postfix/main_single.cf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ smtpd_banner = $myhostname ESMTP $mail_name (Commodore Amiga)
# for syntax details. Adjust the file "etc/mail/aliases" which is
# included in my "kubernetes-postfix" Git repository accordingly.
# Same is true for "$alias_database" (see next parameter).
alias_maps = hash:/etc/mail/aliases
alias_maps = lmdb:/etc/mail/aliases
# The alias databases for local(8) delivery that are updated with "newaliases".
# This is a separate configuration parameter because not all the tables
# specified with "$alias_maps" have to be local files.
# The script "service/postfix/run" which basically starts Postfix in the pod
# run's "newaliases" command during startup.
alias_database = hash:/etc/mail/aliases
alias_database = lmdb:/etc/mail/aliases

# The maximal size of any local(8) individual mailbox or maildir file,
# or zero (no limit).
Expand Down Expand Up @@ -105,15 +105,15 @@ virtual_mailbox_domains = domain.tld anotherdomain.tld
# Replace www.xxx.yyy.zzz with the IP address of your LMTP server of course!
virtual_transport = lmtp:inet:www.xxx.yyy.zzz:2026

# Virtual user map. The script "service/postfix/run" will create a hash map
# Virtual user map. The script "service/postfix/run" will create a map
# of the virual users you specified here. See file "etc/postfix/vmailbox" as
# an example and for more information. Basically you specify all users here
# for which you want to receive mails line by line.
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_mailbox_maps = lmdb:/etc/postfix/vmailbox

# Optional lookup tables that alias specific mail addresses or domains to
# other local or remote address.
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_alias_maps = lmdb:/etc/postfix/virtual


###############################################################################
Expand Down Expand Up @@ -143,7 +143,7 @@ smtpd_tls_key_file = /etc/postfix/certs/tls.key
# Sender MAY use TLS but we also accept unencrypted connections.
smtpd_tls_security_level = may
smtpd_tls_loglevel = 1
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_database = lmdb:${data_directory}/smtpd_scache

# Better forward secrecy settings. With prime-field EDH, OpenSSL wants the
# server to provide two explicitly-selected (prime, generator) combinations.
Expand All @@ -162,7 +162,7 @@ smtpd_tls_dh512_param_file = ${config_directory}/dh512.pem
# Postfix MAY use TLS encryption if destination supports it.
smtp_tls_security_level = may
smtp_tls_loglevel = 1
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_tls_session_cache_database = lmdb:${data_directory}/smtp_scache
# A long list of all of trusted certificate authorities concatenated together.
# This one is maintained by Alpine Linux but you can add your own if you want.
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
Expand Down
4 changes: 2 additions & 2 deletions service/postfix/run_multi
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ SERVER_ID="${HOSTNAME//worker/}"
sed "s/@ID@/${SERVER_ID}/g" /etc/postfix/main_multi.cf.tmpl > /etc/postfix/main.cf

# Create virtual mailbox database
postmap /etc/postfix/vmailbox
postmap lmdb:/etc/postfix/vmailbox

# The optional virtual(5) alias table rewrites recipient
# addresses for all local, all virtual, and all remote mail
# destinations. This is unlike the aliases(5) table which
# is used only for local(8) delivery.
postmap /etc/postfix/virtual
postmap lmdb:/etc/postfix/virtual

# Rebuild the mail aliases database, /etc/aliases, after a change.
newaliases
Expand Down
4 changes: 2 additions & 2 deletions service/postfix/run_single
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ set -e
cp main_single.cf.tmpl /etc/postfix/main.cf

# Create virtual mailbox database
postmap /etc/postfix/vmailbox
postmap lmdb:/etc/postfix/vmailbox

# The optional virtual(5) alias table rewrites recipient
# addresses for all local, all virtual, and all remote mail
# destinations. This is unlike the aliases(5) table which
# is used only for local(8) delivery.
postmap /etc/postfix/virtual
postmap lmdb:/etc/postfix/virtual

# Rebuild the mail aliases database, /etc/aliases, after a change.
newaliases
Expand Down