base.m4: New `senders' entry in `domains.conf'.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 20 Jul 2014 13:53:18 +0000 (14:53 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 29 Oct 2014 09:37:34 +0000 (09:37 +0000)
This is a get-out-of-gaol card for sending domains too badly
misconfigured to manage a valid DNS A or MX record.

base.m4

diff --git a/base.m4 b/base.m4
index d42d98d..579e835 100644 (file)
--- a/base.m4
+++ b/base.m4
@@ -161,11 +161,8 @@ mail:
        ## Always allow the empty sender, so that we can receive bounces.
        accept   senders = :
 
-       ## Ensure that the sender is routable.  This is important to prevent
-       ## undeliverable bounces.
-       require  message = Invalid sender; \
-                       ($sender_verify_failure; $acl_verify_message)
-                verify = sender
+       ## Ensure that the sender looks valid.
+       require  acl = mail_check_sender
 
        ## If this is directly from a client then hack on it for a while.
        warn     condition = ${if eq{$acl_c_mode}{submission}}
@@ -184,6 +181,23 @@ SECTION(acl, mail-tail)m4_dnl
        ## And we're done.
        accept
 
+SECTION(acl, misc)m4_dnl
+mail_check_sender:
+
+       ## See whether there's a special exception for this sender domain.
+       accept   senders = ${LOOKUP_DOMAIN($sender_address_domain,
+                            {KV(senders, {$value}{})},
+                            {})}
+
+       ## Ensure that the sender is routable.  This is important to prevent
+       ## undeliverable bounces.
+       require  message = Invalid sender; \
+                       ($sender_verify_failure; $acl_verify_message)
+                verify = sender
+
+       ## We're good, then.
+       accept
+
 SECTION(global, acl)m4_dnl
 acl_smtp_connect = connect
 SECTION(acl, connect)m4_dnl