aboutsummaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-03-06 22:45:51 +0800
committerAaron LI <aly@aaronly.me>2018-03-14 11:35:08 +0800
commit38826abb2377165d8d5d07d3419c3504955048bc (patch)
treeb126172c956a5c8c0984c2226a49ea3180d9cff8 /roles
parentc81d7334e5c6c31c4133edbd411b7f306d50ae8c (diff)
downloadansible-dfly-vps-38826abb2377165d8d5d07d3419c3504955048bc.tar.bz2
mail/postfix: Fix $virtual_mailbox_maps descriptions and update
Diffstat (limited to 'roles')
-rw-r--r--roles/mail/templates/postfix/main.cf.j210
-rw-r--r--roles/mail/templates/postfix/virtual-users.j236
2 files changed, 13 insertions, 33 deletions
diff --git a/roles/mail/templates/postfix/main.cf.j2 b/roles/mail/templates/postfix/main.cf.j2
index 914d45b..524b3d6 100644
--- a/roles/mail/templates/postfix/main.cf.j2
+++ b/roles/mail/templates/postfix/main.cf.j2
@@ -619,8 +619,7 @@ smtpd_tls_session_cache_timeout = 3600s
# virtual mailbox address do not need to have a UNIX system account.
#
-# Tell Postfix which domain(s) its virtual users live in.
-# The specified domain(s) is also the final destination; mail is
+# List of domain(s) that Postfix is the final destination; mail is
# delivered via the $virtual_transport mail delivery transport.
#
# WARNING: NEVER list a "virtual_mailbox_domains" name as a
@@ -628,8 +627,11 @@ smtpd_tls_session_cache_timeout = 3600s
#
virtual_mailbox_domains = $config_directory/virtual-domains
-# Tell Postfix the virtual users for which its actually responsible
-# for mail delivery.
+# Specfiy the lookup table with all valid recipient addresses. The
+# lookup result (i.e., the right column) is ignored by Postfix when
+# using a non-Postfix delivery agent ($virtual_transport).
+#
+# Credit: http://www.postfix.org/VIRTUAL_README.html#in_virtual_other
#
virtual_mailbox_maps = hash:$config_directory/virtual-users
diff --git a/roles/mail/templates/postfix/virtual-users.j2 b/roles/mail/templates/postfix/virtual-users.j2
index 2408196..17c2623 100644
--- a/roles/mail/templates/postfix/virtual-users.j2
+++ b/roles/mail/templates/postfix/virtual-users.j2
@@ -2,12 +2,8 @@
# /usr/local/etc/postfix/virtual-users
# Postfix: $virtual_mailbox_maps
#
-# Tell Postfix the virtual users for which its actually responsible
-# for mail delivery.
-#
-# References:
-# * Postfix SASL HOWTO - Envelope sender address authorization
-# http://www.postfix.org/SASL_README.html#server_sasl_authz
+# Lookup table with all valid recipient addresses for virtual(8)
+# delivery.
#
# Aaron LI
#
@@ -16,31 +12,13 @@
# NOTE # Once modified this file, run "postmap" on it!
#======#
-# NOTE
-# ----
-# Make sure to have two columns, since this file will be used to map
-# e-mail addresses to allowed SASL-authenticated accounts --- in other
-# words, one of the things we're defining here is that when you
-# authenticate to Dovecot as "you@yourdomain.com," Postfix knows that
-# you're allowed to send e-mail from the "you@yourdomain.com" e-mail
-# address.
-#
-# NOTE
-# ----
-# By default an SMTP client may specify *any* envelope sender address
-# in the "MAIL FROM" command, because the server only knows the remote
-# client's hostname and IP address, but not the user who controls the
-# remote client.
-# But the Postfix SMTP server knowns who the sender is once the SASL
-# authentication is used. This table file provides the maps betwee
-# envelope sender addresses and SASL login names, which is used by the
-# server to decide if the SASL authenticated client is allowed to use
-# a particular envelope sender address.
-#
+# NOTE:
+# The lookup result (i.e., the right column) is ignored since we are
+# using a non-Postfix delivery agent ($virtual_transport = dovecot).
-# Envelope sender | Owner (SASL login names)
+# Address | (ignored)
# ---------------------------------------------------------------------
{% set mydomain = mail.domains[0] %}
{% for user in mail.userdb %}
-{{ user.name }}@{{ mydomain }} {{ user.name }}@{{ mydomain }}
+{{ user.name }}@{{ mydomain }} OK
{% endfor %}