Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F45947120
D4190.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D4190.diff
View Options
diff --git a/pillar/mailserver/postfix.sls b/pillar/mailserver/postfix.sls
--- a/pillar/mailserver/postfix.sls
+++ b/pillar/mailserver/postfix.sls
@@ -10,3 +10,8 @@
service: db-a
database: mail
credential: dbserver/cluster-A/users/postfix
+
+ discard_mailboxes:
+
+ # Phabricator likes to send mail to its own no-reply address (T2349)
+ - notifications-noreply@devcentral.nasqueron.org
diff --git a/roles/mailserver/postfix/config.sls b/roles/mailserver/postfix/config.sls
--- a/roles/mailserver/postfix/config.sls
+++ b/roles/mailserver/postfix/config.sls
@@ -21,6 +21,13 @@
dirs: {{ dirs }}
postfix_dirs: {{ postfix_dirs }}
+{{ dirs.etc }}/postfix/blackhole.cf:
+ file.managed:
+ - source: salt://roles/mailserver/postfix/files/blackhole.cf
+ - template: jinja
+ - context:
+ discard_mailboxes: {{ pillar["postfix_config"].get("discard_mailboxes", [])
+
{{ dirs.etc }}/postfix/postfix-to-mailman.py:
file.managed:
- source: salt://roles/mailserver/postfix/files/postfix-to-mailman.py
diff --git a/roles/mailserver/postfix/files/blackhole.cf b/roles/mailserver/postfix/files/blackhole.cf
new file mode 100644
--- /dev/null
+++ b/roles/mailserver/postfix/files/blackhole.cf
@@ -0,0 +1,19 @@
+# -------------------------------------------------------------
+# Postfix main configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Description: Mail sent to these addresses is accepted then discarded.
+# License: Trivial work, not eligible to copyright
+# Source file: roles/mailserver/postfix/files/blackhole.cf
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+{% for address in discard_mailboxes %}
+{{ address }} discard:
+{% endfor %}
diff --git a/roles/mailserver/postfix/files/main.cf b/roles/mailserver/postfix/files/main.cf
--- a/roles/mailserver/postfix/files/main.cf
+++ b/roles/mailserver/postfix/files/main.cf
@@ -34,10 +34,14 @@
virtual_uid_maps = static:6000
virtual_gid_maps = static:6000
+virtual_mailbox_maps =
+ pgsql:{{ dirs.etc }}/postfix/pgsql-virtual-mailbox-maps.cf,
+ texthash:{{ dirs.etc }}/postfix/blackhole.cf
virtual_mailbox_domains=pgsql:{{ dirs.etc }}/postfix/pgsql-virtual-mailbox-domains.cf
-virtual_mailbox_maps=pgsql:{{ dirs.etc }}/postfix/pgsql-virtual-mailbox-maps.cf
virtual_alias_maps=pgsql:{{ dirs.etc }}/postfix/pgsql-virtual-alias-maps.cf
+transport_maps = texthash:{{ dirs.etc }}/postfix/blackhole.cf
+
alias_maps = hash:/etc/mail/aliases
alias_database = hash:/etc/mail/aliases
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Aug 25, 07:05 (23 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4033691
Default Alt Text
D4190.diff (2 KB)
Attached To
Mode
D4190: Accept then discard mails from Phabricator instances
Attached
Detach File
Event Timeline
Log In to Comment