chiark / gitweb /
exchange.m4: Reluctantly accept local senders from remote clients.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 10 Jan 2014 11:28:46 +0000 (11:28 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 25 Jan 2014 13:15:43 +0000 (13:15 +0000)
exchange.m4

index 08fe4a0f60b6fcfa267ccffc987a67ee5cebdeb7..d38e1371682c7180e0e0fe148e9435a254078bea 100644 (file)
@@ -56,13 +56,21 @@ mail_client_addr:
        ## If this is a message submission then that's handled elsewhere.
        accept   condition = ${if eq{$acl_c_mode}{submission}}
 
-       ## Make sure that the sender matches the client address.
-       require  message = Client host invalid for sender domain
-                hosts = ${LOOKUP_DOMAIN($sender_address_domain,
+       ## Make sure that the sender matches the client address.  I feel like
+       ## I want to reject these, but that will break stuff.  For example,
+       ## if I send mail to an externally hosted address which is really a
+       ## distribution list containing some local address, then we'll
+       ## (approximately legitimately) receive mail with an apparently-local
+       ## sender from a remote host.
+       warn    !hosts = ${LOOKUP_DOMAIN($sender_address_domain,
                           {KV(hosts, {$value}{+allnets})},
                           {${if match_domain {$sender_address_domain} \
                                              {+public} \
                                 {+allnets}{! +allnets}}})}
+                add_header = :after_received:X-Distorted-Warning: \
+                       RCLNTLSNDR \
+                       Apparently local sender, but received from remote \
+                       server.
 
        ## OK.
        accept