Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- acl_check_rcpt:
- # only allow local domains to send
- accept condition = ${if match_local_part{$sender_address_domain}{lsearch;/etc/exim/domains} {yes}{no}}
- message = "Sender domain allowed for sending"
- deny message = "Sender domain NOT allowed for sending"
- .ifdef VIRUS_SCAN
- warn
- set acl_m3 = no
- warn
- condition = ${lookup{$domain}lsearch{/etc/clamav.whitelist} {yes}{no}}
- set acl_m3 = ok
- .endif
- accept hosts = +relay_from_hosts
- !authenticated = *
- set acl_m6 = whitelisted
- accept domains = +local_domains : +relay_to_domains
- condition = ${lookup{$sender_address}wildlsearch{/etc/exim/whitelist}{yes}{no}}
- set acl_m6 = whitelisted
- logwrite = Accepted from $sender_address to $local_part@$domain by whitelist.
- accept domains = +local_domains : +relay_to_domains
- hosts = net-lsearch;/etc/exim/whitelist
- set acl_m6 = whitelisted
- logwrite = Accepted from $sender_address to $local_part@$domain by whitelist.
- deny condition = ${lookup{$sender_address}wildlsearch{/etc/exim/blacklist}{yes}{no}}
- set acl_m6 = blacklisted
- logwrite = Rejected from $sender_address to $local_part@$domain by blacklist.
- deny hosts = net-lsearch;/etc/exim/blacklist
- set acl_m6 = blacklisted
- logwrite = Rejected from $sender_address to $local_part@$domain by blacklist.
- deny message = Restricted characters in address
- domains = +local_domains
- local_parts = ^[.] : ^.*[@%!/|]
- deny message = Restricted characters in address
- domains = !+local_domains
- local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
- accept local_parts = postmaster
- verify = recipient
- domains = +local_domains
- require verify = sender
- # check ratelimits by emails
- warn authenticated = *
- set acl_c0 = group${extract{2}{:}{${lookup{$authenticated_id}lsearch{/etc/exim/passwd}}}}
- set acl_c1 = ${lookup{$authenticated_id}lsearch*{/etc/exim/ratelimits}}
- ratelimit = ${lookup{$acl_c0}lsearch*{/etc/exim/ratelimits}} / 1h / strict / $acl_c0
- ratelimit = $acl_c1 / 1h / strict / $authenticated_id
- log_message = Sender rate overlimit - $sender_rate / $sender_rate_period / $authenticated_id
- condition = ${if match_local_part{$authenticated_id}{lsearch;/etc/exim/ratelimits} {yes}{no}}
- deny authenticated = *
- set acl_c1 = ${lookup{$authenticated_id}lsearch*{/etc/exim/ratelimits}}
- ratelimit = $acl_c1 / 1h / leaky / $authenticated_id
- message = Sender rate overlimit - $sender_rate / $sender_rate_period / $authenticated_id
- condition = ${if match_local_part{$authenticated_id}{lsearch;/etc/exim/ratelimits} {yes}{no}}
- # check ratelimits by group
- warn authenticated = *
- set acl_c0 = group${extract{2}{:}{${lookup{$authenticated_id}lsearch{/etc/exim/passwd}}}}
- ratelimit = ${lookup{$acl_c0}lsearch*{/etc/exim/ratelimits}} / 1h / strict / $acl_c0
- log_message = Sender rate overlimit - $sender_rate / $sender_rate_period / $acl_c0
- condition = ${if match_local_part{$acl_c0}{lsearch;/etc/exim/ratelimits} {yes}{no}}
- deny authenticated = *
- set acl_c0 = group${extract{2}{:}{${lookup{$authenticated_id}lsearch{/etc/exim/passwd}}}}
- ratelimit = ${lookup{$acl_c0}lsearch*{/etc/exim/ratelimits}} / 1h / leaky / $acl_c0
- message = Sender rate overlimit - $sender_rate / $sender_rate_period / $acl_c0
- condition = ${if match_local_part{$acl_c0}{lsearch;/etc/exim/ratelimits} {yes}{no}}
- .ifdef DEFAULT_RATELIMIT
- # check ratelimits by default
- deny authenticated = *
- ratelimit = DEFAULT_RATELIMIT / 1h / strict / $authenticated_id
- message = Sender rate overlimit - $sender_rate / $sender_rate_period / $authenticated_id
- condition = ${if or{{eq{$acl_c1}{}}{eq{$acl_c0}{}}}{yes}{no}}
- .endif
- accept hosts = +relay_from_hosts
- !authenticated = *
- control = submission/sender_retain
- accept authenticated = *
- condition = ${if eq{${extract{5}{:}{${lookup{$authenticated_id}lsearch{/etc/exim/passwd}}}}}{no} {yes}{no}}
- condition = ${if eq{${extract{3}{:}{${lookup{${domain:$authenticated_id}}lsearch{/etc/exim/domains}}}}}{no} {yes}{no}}
- control = submission/domain=
- deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\\n$dnslist_text
- dnslists = ${readfile {/etc/exim/dnsbllist}{:}}
- require message = relay not permitted
- domains = +local_domains : +relay_to_domains
- require verify = recipient
- .ifdef POSTGREY_SOCKET
- defer log_message = greylisted host $sender_host_address
- set acl_m0 = request=smtpd_access_policy\nprotocol_state=RCPT\nprotocol_name=${uc:$received_protocol}\nhelo_name=$sender_helo_name\nclient_address=$sender_hos>
- set acl_m0 = ${sg{${readsocket{POSTGREY_SOCKET}{$acl_m0}{5s}{}{action=DUNNO}}}{action=}{}}
- message = ${sg{$acl_m0}{^\\w+\\s*}{}}
- condition = ${if eq{${uc:${substr{0}{5}{$acl_m0}}}}{DEFER}{true}{false}}
- .endif
- accept
Advertisement
Add Comment
Please, Sign In to add comment