Skip to content

Commit 19a7bb0

Browse files
committed
postfix: Extend automatic address tagging to non-*.scripts.mit.edu hosts
We previously delivered [email protected][email protected]. Extend this to tag@any-domain ↦ [email protected], not because this is a particularly important feature, but mostly because this reduces the amount of special-case configuration. Signed-off-by: Anders Kaseorg <[email protected]>
1 parent ee42b1b commit 19a7bb0

File tree

4 files changed

+15
-21
lines changed

4 files changed

+15
-21
lines changed

server/fedora/config/etc/postfix/main.cf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ newaliases_path = /usr/bin/newaliases
2929
mailq_path = /usr/bin/mailq
3030
queue_directory = /var/spool/postfix
3131
mail_owner = postfix
32-
virtual_alias_domains = texthash:/etc/postfix/virtual, regexp:/etc/postfix/virtual_re, ldap:/etc/postfix/virtual-alias-domains-ldap.cf
33-
virtual_alias_maps = texthash:/etc/postfix/virtual, regexp:/etc/postfix/virtual_re, ldap:/etc/postfix/virtual-alias-maps-ldap-reserved.cf, ldap:/etc/postfix/virtual-alias-maps-ldap.cf
32+
virtual_alias_domains = !scripts.mit.edu, !scripts, !$myhostname, !scripts-test.mit.edu, !scripts-test, !localhost, scripts-vhosts.mit.edu, scripts-vhosts-old.mit.edu, ldap:/etc/postfix/virtual-alias-domains-ldap.cf
33+
virtual_alias_maps = ldap:/etc/postfix/virtual-alias-maps-ldap-reserved.cf, ldap:/etc/postfix/virtual-alias-maps-ldap.cf
3434
data_directory = /var/lib/postfix
3535
authorized_flush_users = fail
3636
authorized_mailq_users = /etc/postfix/mailq_users
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
scripts-vhosts-old.mit.edu true
2-
scripts-vhosts.mit.edu true
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
# Find any vhost with a name or alias matching the domain of the e-mail
2-
# address. We're queried with an entire e-mail address, but are only
3-
# interested in checking whether the domain portion corresponds to a
4-
# vhost; we'll simply deliver any mail for the vhost to its owner, regardless
5-
# of the lefthand side of the address. %d extracts only the domain.
6-
# We don't match the scripts.mit.edu vhost here because we don't want
7-
# to first resolve an arbitrary address to a scripts account, and then
8-
# end up sending their mail to the owners of the scripts.mit.edu vhost.
9-
# Once we've found the scriptsVhost object corresponding to the domain
10-
# the e-mail is for, we recursively search the suffix for the vhost's
11-
# scriptsVhostAccount, and take the uid from that object. This uid is
12-
# the name of the locker that owns the vhost. Protocol version 3 is
1+
# Find any vhost with a name or alias matching the domain of the
2+
# e-mail address. We're queried with an entire e-mail address, but
3+
# are only interested in checking whether the domain portion
4+
# corresponds to a vhost; we'll simply deliver any mail for the vhost
5+
# to its owner, appending the original lefthand side of the address as
6+
# an extension. %d extracts only the domain. We don't match the
7+
# scripts.mit.edu vhost here because we don't want to first resolve an
8+
# arbitrary address to a scripts account, and then end up sending
9+
# their mail to the owners of the scripts.mit.edu vhost. The uid
10+
# attribute, generated by the CoS template
11+
# cn=vhostOwnerCoS,ou=VirtualHosts,dc=scripts,dc=mit,dc=edu, is the
12+
# name of the locker that owns the vhost. Protocol version 3 is
1313
# necessary to use ldapi.
1414

1515
server_host = ldapi://%2fvar%2frun%2fslapd-scripts.socket/
1616
search_base = ou=VirtualHosts,dc=scripts,dc=mit,dc=edu
1717
query_filter = (&(objectClass=scriptsVhost)(|(scriptsVhostName=%d)(scriptsVhostAlias=%d))(!(scriptsVhostName=scripts.mit.edu)))
1818
result_attribute = uid
19-
special_result_attribute = scriptsVhostAccount
19+
result_format = %s+%U
2020
bind = no
2121
version = 3
2222

server/fedora/config/etc/postfix/virtual_re

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)