exim4:access_control
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
exim4:access_control [2016/11/04 10:32] – peter | exim4:access_control [2020/07/15 09:30] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 26: | Line 26: | ||
</ | </ | ||
+ | <WRAP warning> | ||
**WARNING**: | **WARNING**: | ||
+ | </ | ||
Line 143: | Line 145: | ||
domains | domains | ||
</ | </ | ||
+ | |||
+ | |||
+ | ===== Recipient: manual redirect by the sender ===== | ||
+ | |||
+ | The idea is to send an automatic reply, using " | ||
+ | |||
+ | In a filter: | ||
+ | |||
+ | < | ||
+ | ### reply for someone@msharewiz.net | ||
+ | if $original_local_part is " | ||
+ | seen mail from drop@sharewiz.net subject "Re: $h_subject" | ||
+ | finish | ||
+ | endif | ||
+ | </ | ||
+ | |||
===== Recipient: emails addresses to catch spams ===== | ===== Recipient: emails addresses to catch spams ===== | ||
Line 210: | Line 228: | ||
accept | accept | ||
</ | </ | ||
- | | + | |
+ | |||
+ | ===== Greylist ===== | ||
+ | |||
+ | Greylisting use the fact that most of the time spammers softwares do not take account tempory errors to retry later. | ||
+ | |||
+ | When exim send a " | ||
+ | |||
+ | * Not if the host is in a white list of " | ||
+ | * Not if there is no sender: it is a bounce message. | ||
+ | * Not if the HELO argument is well configured and the host name seams owned by the sender. | ||
+ | * if the greylist daemon want to. | ||
+ | |||
+ | The two lines with **set acl_m9** are used to send the request to the daemon and get the result. | ||
+ | |||
+ | < | ||
+ | ###################################################################### | ||
+ | # MAIN CONFIGURATION SETTINGS | ||
+ | ###################################################################### | ||
+ | # Mandatory to use " | ||
+ | helo_try_verify_hosts = !+own_hosts | ||
+ | . . . | ||
+ | ###################################################################### | ||
+ | # ACL CONFIGURATION | ||
+ | ###################################################################### | ||
+ | # ACL " | ||
+ | # hosts which have not their own registered domain-name (probably spammer). | ||
+ | # Return ok if the HELO argument correspond to the connected HOST and | ||
+ | # if the argument does not contain an IP in decimal or hexa. | ||
+ | # I have created this ACL subroutine because we can't do a list of " | ||
+ | # in ACL (it's a list of " | ||
+ | # no (no A and no B) = A or B. | ||
+ | acl_clean_helo: | ||
+ | accept | ||
+ | verify | ||
+ | condition | ||
+ | |||
+ | |||
+ | acl_check_rcpt: | ||
+ | . . . | ||
+ | |||
+ | # Greylisting, | ||
+ | # a dialin name (with IP included in the name). Some hosts from big | ||
+ | # providers are in a white list to avoid testing. When there is no | ||
+ | # sender then it is a bounce message, so no greylist. | ||
+ | | ||
+ | message = Please try later. | ||
+ | !hosts | ||
+ | !senders | ||
+ | !acl = acl_clean_helo | ||
+ | log_message = greylisted. | ||
+ | set acl_m9 | ||
+ | set acl_m9 | ||
+ | condition | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Anti-virus: Windows executable in attachment ===== | ||
+ | |||
+ | It's a very basic anti-virus: every emails with a windows executable as attachment is rejected. | ||
+ | |||
+ | < | ||
+ | acl_check_data: | ||
+ | . . . | ||
+ | deny message = This message contains an attachment of a type which we do not accept (.$found_extension) | ||
+ | demime = bat: | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== anti-virus: clamav ===== | ||
+ | |||
+ | < | ||
+ | ###################################################################### | ||
+ | # MAIN CONFIGURATION SETTINGS | ||
+ | ###################################################################### | ||
+ | av_scanner = clamd:/ | ||
+ | . . . | ||
+ | ###################################################################### | ||
+ | # ACL CONFIGURATION | ||
+ | ###################################################################### | ||
+ | acl_check_data: | ||
+ | . . . | ||
+ | deny message = This message contains a virus or other harmful content ($malware_name) | ||
+ | demime = * | ||
+ | malware = * | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | anti-spam external detector: spamassassin | ||
+ | |||
+ | We add a " | ||
+ | |||
+ | Because of the " | ||
+ | |||
+ | < | ||
+ | ###################################################################### | ||
+ | # MAIN CONFIGURATION SETTINGS | ||
+ | ###################################################################### | ||
+ | spamd_address = 127.0.0.1 783 | ||
+ | . . . | ||
+ | ###################################################################### | ||
+ | # ACL CONFIGURATION | ||
+ | ###################################################################### | ||
+ | acl_check_data: | ||
+ | . . . | ||
+ | ## spamassassin, | ||
+ | ## limit its use under 500k. | ||
+ | accept | ||
+ | warn message = X-SA-Score: $spam_score | ||
+ | spam = nobody:true | ||
+ | warn message = X-SA-Report: | ||
+ | spam = nobody: | ||
+ | condition = ${if > | ||
+ | warn message = X-SA-Status: | ||
+ | spam = nobody: | ||
+ | condition = ${if > | ||
+ | deny message = This message scored $spam_score spam points. | ||
+ | spam = nobody:true | ||
+ | condition = ${if > | ||
+ | </ | ||
+ | |||
+ | In your " | ||
+ | |||
+ | <file bash ~/ | ||
+ | # Exim filter | ||
+ | if $h_X-SA-Status: | ||
+ | save $home/ | ||
+ | | ||
+ | endif | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Checking source of email associated with your domain in whois ===== | ||
+ | |||
+ | If you have an email published in a whois database (spammers scan these databases) but want emails just from your registrar, you can add this in your " | ||
+ | |||
+ | <file bash ~/ | ||
+ | # Exim filter | ||
+ | if $original_local_part is " | ||
+ | then | ||
+ | if $sender_address_domain is " | ||
+ | deliver john | ||
+ | else | ||
+ | save $home/ | ||
+ | finish | ||
+ | endif | ||
+ | endif | ||
+ | </ |
exim4/access_control.1478255524.txt.gz · Last modified: 2020/07/15 09:30 (external edit)