summaryrefslogtreecommitdiffstats
path: root/roles/IMAP/templates/etc/postfix/main.cf.j2
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2014-04-17 04:56:43 +0200
committerGuilhem Moulin <guilhem@fripost.org>2015-06-07 02:51:47 +0200
commite9e8ce2add2b7c020daa02228e506e7c02828c15 (patch)
tree88aee2a20e3c1961aa94769a4df4f236a21741bc /roles/IMAP/templates/etc/postfix/main.cf.j2
parent3d4b17515fc21dbb218873b23ff9272ca9474e8e (diff)
Decongestion potential bottlenecks on trivial_rewrite(8).
Which might be caused by slow LDAP lookups in transport_maps. Instead, we alias each addresses for which we want a custom transport to a dedicated "dummy" domain, and use a static (CDB) transport_maps to map said domains to their transport; the receiver can then use canonical(8) to restore the original envelope recipient. Since the alias resolution is performed by cleanup(8), which can run in parallel with other instances, it should decongestion bottlenecks under heavy loads. So far only the MX:es have been decongestioned. The list manager and the MDA should be treated as well.
Diffstat (limited to 'roles/IMAP/templates/etc/postfix/main.cf.j2')
-rw-r--r--roles/IMAP/templates/etc/postfix/main.cf.j25
1 files changed, 5 insertions, 0 deletions
diff --git a/roles/IMAP/templates/etc/postfix/main.cf.j2 b/roles/IMAP/templates/etc/postfix/main.cf.j2
index e4c01bd..d0421ce 100644
--- a/roles/IMAP/templates/etc/postfix/main.cf.j2
+++ b/roles/IMAP/templates/etc/postfix/main.cf.j2
@@ -38,24 +38,29 @@ inet_protocols = ipv4
mydestination =
local_transport = error:5.1.1 Mailbox unavailable
alias_maps =
alias_database =
local_recipient_maps =
message_size_limit = 67108864
recipient_delimiter = +
# No relay: this server is inbound-only
relay_transport = error:5.1.1 Relay unavailable
default_transport = error:5.1.1 Transport unavailable
# Virtual transport (the alias resolution is already done by the MX:es)
virtual_transport = lmtp:unix:private/dovecot-lmtpd
lmtp_bind_address = 127.0.0.1
virtual_mailbox_domains = ldap:$config_directory/virtual/mailbox_domains.cf
virtual_mailbox_maps = ldap:$config_directory/virtual/mailbox.cf
transport_maps = ldap:$config_directory/virtual/transport_content_filter.cf
+# Restore the original envelope recipient
+relay_domains = $myhostname
+recipient_canonical_classes = envelope_recipient
+recipient_canonical_maps = pcre:$config_directory/recipient_canonical.pcre
+
# Don't rewrite remote headers
local_header_rewrite_clients =
# Tolerate occasional high latency
smtpd_timeout = 1200s