Skip to content

Commit 71df4ba

Browse files
committed
Reject incoming mail which fails SPF checks
1 parent cf017d3 commit 71df4ba

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

cookbooks/exim/templates/default/exim4.conf.erb

+18
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ hostlist relay_from_hosts = <; <%= @relay_from_hosts.join(" ; ") %>
107107
# manual for details. The lists above are used in the access control lists for
108108
# checking incoming messages. The names of these ACLs are defined here:
109109

110+
acl_smtp_mail = acl_check_mail
110111
acl_smtp_rcpt = acl_check_rcpt
111112
acl_smtp_data = acl_check_data
112113

@@ -377,6 +378,23 @@ smtp_accept_max = <%= node[:exim][:smtp_accept_max] %>
377378

378379
begin acl
379380

381+
# This access control list is used for the MAIL command in an incoming
382+
# SMTP message.
383+
384+
acl_check_mail:
385+
<% if node[:exim][:smarthost_name] -%>
386+
387+
# Reject mail that fails SPF checks
388+
389+
deny spf = fail
390+
message = $sender_host_address is not allowed to send mail from \
391+
${if def:sender_address_domain \
392+
{$sender_address_domain}{$sender_helo_name}}.
393+
!hosts = +relay_from_hosts
394+
<% end -%>
395+
396+
accept
397+
380398
# This access control list is used for every RCPT command in an incoming
381399
# SMTP message. The tests are run in order until the address is either
382400
# accepted or denied.

0 commit comments

Comments
 (0)