]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Use sender_address_domain when checking sender stuff
authorTollef Fog Heen <tfheen@err.no>
Thu, 24 Apr 2014 08:26:56 +0000 (10:26 +0200)
committerTollef Fog Heen <tfheen@err.no>
Thu, 24 Apr 2014 08:26:56 +0000 (10:26 +0200)
Make sure to look up data for the sending domain when checking
senders, not receivers.

modules/exim/templates/eximconf.erb

index 66e01f2e8b34fdc14b60710101306bf505320a14..aec6edbe9242992db3302793a700b327b8c560b8 100644 (file)
@@ -251,6 +251,7 @@ received_header_text = Received: ${if def:sender_rcvhost {from $sender_rcvhost\n
 # macro definitions.
 # Do not wrap!
 VDOMAINDATA = ${lookup{$domain}partial-lsearch{/etc/exim4/virtualdomains}{$value}}
+VSENDERDOMAINDATA = ${lookup{$sender_address_domain}partial-lsearch{/etc/exim4/virtualdomains}{$value}}
 WHITELIST = ${if match_domain{$domain}{+virtual_domains}\
             {${if exists {${extract{directory}{VDOMAINDATA}{${value}/whitelist}}}\
             {${lookup{$local_part}lsearch{${extract{directory}{VDOMAINDATA}{${value}/whitelist}}}{$value}{}}}{}}}\
@@ -626,14 +627,14 @@ check_recipient:
          message       = mail from <$sender_address> not allowed externally
 
   deny    sender_domains= +virtual_domains
-          condition     = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/localusers}}}}
-          condition     = ${lookup{$sender_address_local_part}lsearch{${extract{directory}{VDOMAINDATA}{${value}/localusers}}}{true}}
+          condition     = ${if exists {${extract{directory}{VSENDERDOMAINDATA}{${value}/localusers}}}}
+          condition     = ${lookup{$sender_address_local_part}lsearch{${extract{directory}{VSENDERDOMAINDATA}{${value}/localusers}}}{true}}
          hosts         = !+debianhosts
          message       = mail from <$sender_address> not allowed externally
 
   deny    condition     = ${if match_domain{$sender_address_domain}{+virtual_domains}{1}{0}}
-          condition     = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
-          condition     = ${lookup{$sender_address_local_part}lsearch{${extract{directory}{VDOMAINDATA}{${value}/neversenders}}{true}}
+          condition     = ${if exists {${extract{directory}{VSENDERDOMAINDATA}{${value}/neversenders}}}{1}{0}}
+          condition     = ${lookup{$sender_address_local_part}lsearch{${extract{directory}{VSENDERDOMAINDATA}{${value}/neversenders}}{true}}
          message       = no mail should ever come from <$sender_address>
 
   warn    condition     = ${if eq{$acl_m_prf}{localonly}}