Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ffe8bf6
Configure Postfix
quentinmit May 23, 2019
de4437e
Make /etc/scripts
quentinmit May 23, 2019
0c88576
Enable postfix
quentinmit May 23, 2019
579ff3c
Only accept mail on some VIPs
quentinmit May 23, 2019
cda3e5b
Install Postfix LDAP plugin
quentinmit May 23, 2019
7368b54
Use non-deprecated way to specify multiple packages
quentinmit May 23, 2019
f0f5272
Specify now-required smtpd_relay_restrictions
quentinmit May 23, 2019
f35bd7f
Configure Postfix with variable LDAP server
quentinmit May 24, 2019
05f8473
Reload postfix when config changes
quentinmit May 24, 2019
003949f
Install procmail
quentinmit May 25, 2019
53968ae
Install scripts's version of /etc/aliases
quentinmit May 29, 2019
e4eedf1
Delay postfix startup until network is online
quentinmit May 29, 2019
39ec12c
Create postfix unit override directory
quentinmit May 29, 2019
fa65200
Install and run Spamassassin
quentinmit May 29, 2019
c2a11ac
Configure spamass-milter
quentinmit May 29, 2019
a055fa1
Configure spamassassin
quentinmit May 29, 2019
fa72caa
Section null must be specified explicitly
quentinmit May 29, 2019
6c72056
Install prune-mailq
quentinmit Jun 24, 2019
e17d0e5
Generate postfix virtual_alias_domains from vips
quentinmit Jul 20, 2019
f532d23
Incoming mail blocks are now in LDAP
quentinmit Sep 5, 2019
c599ee6
authorized_submit_users is now in LDAP
quentinmit Sep 5, 2019
f7053d5
Install a bunch of packages from F20 on F30
quentinmit Dec 20, 2019
a7b99f9
Updating Postfix conf to forward messages to other server if current …
jkoppel Feb 1, 2020
ca1cf48
Only bind the VIPs for the current codename
quentinmit Feb 1, 2020
492fbb0
Adding transport-maps-ldap.cf to template list
jkoppel Feb 1, 2020
89eb801
Disable virtual_alias_maps for vhosts on another pool. Otherwise the …
quentinmit Feb 1, 2020
17af442
Make other pools into relay domains
quentinmit Feb 1, 2020
6d28907
cleanup checks virtual_alias_maps before both relay_domains and trans…
quentinmit Feb 1, 2020
8af2d41
Route mail for user@scripts.mit.edu based on user.scripts.mit.edu's pool
quentinmit Feb 5, 2020
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
Prev Previous commit
Next Next commit
Make other pools into relay domains
  • Loading branch information
quentinmit authored and dehnert committed Dec 11, 2020
commit 17af44294194c5ad74257dce8b1206afb7687ad1
3 changes: 2 additions & 1 deletion ansible/roles/real-postfix/templates/main.cf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ queue_directory = /var/spool/postfix
mail_owner = postfix
virtual_alias_domains = {% for vip in vips | rejectattr('type', 'defined') %}{% if (vip.codename|default(ansible_lsb.codename) == ansible_lsb.codename) %}!{{ vip.host }}, !{{ vip.host | replace('.mit.edu', '') }}, {% endif %}{% endfor %}!$myhostname, !localhost, ldap:/etc/postfix/virtual-alias-domains-ldap.cf
virtual_alias_maps = ldap:/etc/postfix/virtual-alias-maps-ldap-reserved.cf, ldap:/etc/postfix/virtual-alias-maps-ldap.cf
transport_maps = ldap:/etc/postfix/transport-maps-ldap.cf
relay_domains = ldap:/etc/postfix/transport-maps-ldap.cf
transport_maps = $relay_domains
data_directory = /var/lib/postfix
authorized_flush_users = fail
authorized_mailq_users = /etc/postfix/mailq_users
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
# Find any vhost with a name or alias matching the domain of the
# e-mail address. We're queried with an entire e-mail address, but
# are only interested in checking whether the domain portion
# corresponds to a vhost; we'll simply deliver any mail for the vhost
# to its owner, appending the original lefthand side of the address as
# an extension. %d extracts only the domain. We don't match the
# scripts.mit.edu vhost here because we don't want to first resolve an
# arbitrary address to a scripts account, and then end up sending
# their mail to the owners of the scripts.mit.edu vhost. The uid
# attribute, generated by the CoS template
# cn=vhostOwnerCoS,ou=VirtualHosts,dc=scripts,dc=mit,dc=edu, is the
# name of the locker that owns the vhost. Protocol version 3 is
# necessary to use ldapi.
# Check if the vhost is served from another pool; if so, we relay to
# that pool's IP. This is also used as a relay_domains map to tell
# Postfix it's a relay domain.

server_host = {{ ldap_server }}
search_base = ou=VirtualHosts,dc=scripts,dc=mit,dc=edu
query_filter = (&(objectClass=scriptsVhost)(|(scriptsVhostName=%d)(scriptsVhostAlias=%d))(!(scriptsVhostName=scripts.mit.edu))(!(|{% for ip in ansible_all_ipv4_addresses %}(scriptsVhostPoolIPv4={{ip}}){% endfor %})))
result_attribute = scriptsVhostPoolIPv4
result_format = smtp:%s
result_format = relay:%s
bind = no
version = 3
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

server_host = {{ ldap_server }}
search_base = ou=VirtualHosts,dc=scripts,dc=mit,dc=edu
query_filter = (&(objectClass=scriptsVhost)(|(scriptsVhostName=%s)(scriptsVhostAlias=%s))(!(scriptsVhostName=scripts.mit.edu)))
query_filter = (&(objectClass=scriptsVhost)(|(scriptsVhostName=%s)(scriptsVhostAlias=%s))(!(scriptsVhostName=scripts.mit.edu))(|{% for ip in ansible_all_ipv4_addresses %}(scriptsVhostPoolIPv4={{ip}}){% endfor %}))
Comment thread
quentinmit marked this conversation as resolved.
Comment thread
quentinmit marked this conversation as resolved.
result_attribute = scriptsVhostName
result_format = %S
bind = no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

server_host = {{ ldap_server }}
search_base = ou=VirtualHosts,dc=scripts,dc=mit,dc=edu
query_filter = (&(objectClass=scriptsVhost)(|(scriptsVhostName=%d)(scriptsVhostAlias=%d))(!(scriptsVhostName=scripts.mit.edu))(|{% for ip in ansible_all_ipv4_addresses %}(scriptsVhostPoolIPv4={{ip}}){% endfor %}))
query_filter = (&(objectClass=scriptsVhost)(|(scriptsVhostName=%d)(scriptsVhostAlias=%d))(!(scriptsVhostName=scripts.mit.edu)))
result_attribute = uid
result_format = %s+%U
bind = no
Expand Down