exim4:configuration_file
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
exim4:configuration_file [2016/11/03 09:20] – peter | exim4:configuration_file [2020/07/15 09:30] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Exim4 - Configuration File ====== | ====== Exim4 - Configuration File ====== | ||
+ | |||
+ | <WRAP todo> | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | https:// | ||
+ | </ | ||
+ | |||
+ | |||
+ | The context is a host server with a public IP (5.42.134.35, | ||
+ | |||
+ | < | ||
+ | ###################################################################### | ||
+ | # MAIN CONFIGURATION SETTINGS | ||
+ | ###################################################################### | ||
+ | |||
+ | # If exim is used localy in batch mode (exim4 -bs) then " | ||
+ | hostlist | ||
+ | domainlist public_domains = sharewiz.net | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== ACLs ===== | ||
Here is the ACL section of my Exim configuration file | Here is the ACL section of my Exim configuration file | ||
Line 198: | Line 223: | ||
</ | </ | ||
+ | |||
+ | ===== Another config ===== | ||
+ | |||
+ | < | ||
+ | ###################################################################### | ||
+ | # MAIN CONFIGURATION SETTINGS | ||
+ | ###################################################################### | ||
+ | |||
+ | hostlist | ||
+ | domainlist public_domains = sharewiz.net | ||
+ | . . . | ||
+ | # Mandatory to use " | ||
+ | helo_try_verify_hosts = !+own_hosts | ||
+ | |||
+ | av_scanner = clamd:/ | ||
+ | spamd_address = 127.0.0.1 783 | ||
+ | |||
+ | acl_smtp_rcpt = acl_check_rcpt | ||
+ | acl_smtp_mail = acl_check_sender | ||
+ | acl_smtp_connect = acl_check_host | ||
+ | acl_smtp_data = acl_check_data | ||
+ | acl_smtp_helo = acl_check_helo | ||
+ | |||
+ | |||
+ | . . . | ||
+ | ###################################################################### | ||
+ | # ACL CONFIGURATION | ||
+ | ###################################################################### | ||
+ | acl_check_host: | ||
+ | accept | ||
+ | hosts = +own_hosts : / | ||
+ | |||
+ | deny | ||
+ | log_message = match host_reject.list | ||
+ | hosts = / | ||
+ | |||
+ | accept | ||
+ | |||
+ | acl_check_helo: | ||
+ | accept | ||
+ | |||
+ | # If the HELO pretend to be this host | ||
+ | deny condition = ${if or { \ | ||
+ | {eq {${lc: | ||
+ | {eq {${lc: | ||
+ | } {true}{false} } | ||
+ | |||
+ | # by default we accept | ||
+ | accept | ||
+ | |||
+ | acl_check_sender: | ||
+ | deny senders = / | ||
+ | accept | ||
+ | |||
+ | # ACL " | ||
+ | # Return ok if the HELO argument correspond to the connected HOST and | ||
+ | # if the HELO 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: | ||
+ | # refuse if the recipient string is a hack, | ||
+ | # see exim file example C043.txt.gz | ||
+ | deny | ||
+ | local_parts = ^.*[@%!/|] : ^\\. | ||
+ | |||
+ | # Relaying with no more check for my own hosts. | ||
+ | accept | ||
+ | hosts = +own_hosts | ||
+ | |||
+ | # For the rest, the domain of the recipient address | ||
+ | # must be my public domain. (no relay) | ||
+ | require | ||
+ | log_message = no relay. | ||
+ | domains | ||
+ | |||
+ | # Reffuse all the message if the recipient is only used by spammers. | ||
+ | drop | ||
+ | log_message | ||
+ | recipients = / | ||
+ | |||
+ | drop | ||
+ | log_message = match sbl-xbl.spamhaus.org | ||
+ | dnslists = sbl-xbl.spamhaus.org | ||
+ | |||
+ | # 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. | ||
+ | defer | ||
+ | message = Please try later. | ||
+ | !hosts | ||
+ | !senders | ||
+ | !acl = acl_clean_helo | ||
+ | log_message = greylisted. | ||
+ | set acl_m9 | ||
+ | set acl_m9 | ||
+ | condition | ||
+ | |||
+ | # Default rule: accept except if recipient address is unrouteable. | ||
+ | accept | ||
+ | message = unrouteable address | ||
+ | verify = recipient | ||
+ | |||
+ | |||
+ | acl_check_data: | ||
+ | |||
+ | accept | ||
+ | |||
+ | # if there is a windows executable as attachment then we reject | ||
+ | deny message = This message contains an attachment of a type which we do not accept (.$found_extension) | ||
+ | demime = bat: | ||
+ | |||
+ | # clamav | ||
+ | deny message = This message contains a virus or other harmful content ($malware_name) | ||
+ | demime = * | ||
+ | malware = * | ||
+ | | ||
+ | ## spamassassin, | ||
+ | ## limit its use under 500k. | ||
+ | accept | ||
+ | warn message = X-SA-Score: $spam_score | ||
+ | spam = nobody: | ||
+ | warn message = X-SA-Report: | ||
+ | spam = nobody:true | ||
+ | condition = ${if > | ||
+ | warn message = X-SA-Status: | ||
+ | spam = nobody:true | ||
+ | condition = ${if > | ||
+ | deny message = This message scored $spam_score spam points. | ||
+ | spam = nobody: | ||
+ | condition = ${if > | ||
+ | |||
+ | # accept by default | ||
+ | accept | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== A Basic config ===== | ||
+ | |||
+ | <file bash / | ||
+ | local_scan_path = / | ||
+ | |||
+ | hide pgsql_servers = localhost:: | ||
+ | |||
+ | primary_hostname = czarny06.aklin | ||
+ | |||
+ | domainlist local_domains = @ : czarny06.aklin : poczta.czarny06.aklin | ||
+ | domainlist relay_to_domains = czarny02.aklin : czarny04.aklin | ||
+ | hostlist | ||
+ | domainlist exdomains = fiw.local | ||
+ | |||
+ | acl_smtp_rcpt = acl_check_rcpt | ||
+ | acl_smtp_data = acl_check_data | ||
+ | acl_not_smtp | ||
+ | |||
+ | av_scanner = clamd:/ | ||
+ | |||
+ | tls_advertise_hosts = * | ||
+ | |||
+ | tls_certificate = / | ||
+ | tls_privatekey = / | ||
+ | |||
+ | daemon_smtp_ports = 25 : 465 : 587 | ||
+ | tls_on_connect_ports = 465 | ||
+ | |||
+ | never_users = root | ||
+ | |||
+ | host_lookup = * | ||
+ | |||
+ | rfc1413_hosts = !10.0.2.0/ | ||
+ | rfc1413_query_timeout = 5s | ||
+ | |||
+ | ignore_bounce_errors_after = 2d | ||
+ | |||
+ | timeout_frozen_after = 7d | ||
+ | |||
+ | begin acl | ||
+ | |||
+ | wiadomosci_z_sendmaila: | ||
+ | |||
+ | accept | ||
+ | |||
+ | acl_check_rcpt: | ||
+ | |||
+ | |||
+ | warn local_parts = pracownicy | ||
+ | domains = +local_domains | ||
+ | add_header = Reply-To: pracownicy@czarny06.aklin | ||
+ | |||
+ | warn hosts = czarny02.aklin : czarny04.aklin | ||
+ | add_header | ||
+ | |||
+ | accept | ||
+ | add_header | ||
+ | |||
+ | deny message | ||
+ | domains | ||
+ | local_parts | ||
+ | |||
+ | deny message | ||
+ | domains | ||
+ | local_parts | ||
+ | |||
+ | accept | ||
+ | domains | ||
+ | |||
+ | require verify | ||
+ | |||
+ | accept | ||
+ | add_header | ||
+ | control | ||
+ | |||
+ | accept | ||
+ | add_header = X-SA-Nie-Uruchamiaj-Mnie: | ||
+ | control | ||
+ | |||
+ | require message = relay not permitted | ||
+ | domains = +local_domains : +relay_to_domains : +exdomains | ||
+ | |||
+ | require verify = recipient | ||
+ | |||
+ | accept | ||
+ | |||
+ | acl_check_data: | ||
+ | |||
+ | deny malware | ||
+ | message | ||
+ | |||
+ | accept | ||
+ | |||
+ | begin routers | ||
+ | |||
+ | dnslookup: | ||
+ | driver = dnslookup | ||
+ | domains = ! +local_domains : ! +exdomains | ||
+ | transport = remote_smtp | ||
+ | ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 | ||
+ | no_more | ||
+ | |||
+ | aliases_poczta_czarny_06_aklin: | ||
+ | driver = redirect | ||
+ | allow_fail | ||
+ | allow_defer | ||
+ | domains = poczta.czarny06.aklin | ||
+ | data = ${lookup{$local_part}lsearch{/ | ||
+ | file_transport = address_file | ||
+ | pipe_transport = address_pipe | ||
+ | |||
+ | system_aliases: | ||
+ | driver = redirect | ||
+ | allow_fail | ||
+ | allow_defer | ||
+ | data = ${lookup pgsql{select goto from alias where address = ' | ||
+ | file_transport = address_file | ||
+ | pipe_transport = address_pipe | ||
+ | |||
+ | userforward: | ||
+ | driver = redirect | ||
+ | check_local_user | ||
+ | file = $home/ | ||
+ | no_verify | ||
+ | no_expn | ||
+ | check_ancestor | ||
+ | file_transport = address_file | ||
+ | pipe_transport = address_pipe | ||
+ | reply_transport = address_reply | ||
+ | |||
+ | localuser_spam_flag: | ||
+ | driver = accept | ||
+ | condition = ${lookup pgsql{select count(account_id) from account where username = ' | ||
+ | condition = ${if eq {$h_X-Spam-Flag}{YES} {1}{0}} | ||
+ | transport = local_delivery_spam | ||
+ | |||
+ | localuser: | ||
+ | driver = accept | ||
+ | condition = ${lookup pgsql{select count(account_id) from account where username = ' | ||
+ | transport = local_delivery | ||
+ | cannot_route_message = Unknown user | ||
+ | |||
+ | begin transports | ||
+ | |||
+ | remote_smtp: | ||
+ | driver = smtp | ||
+ | headers_remove = X-SA-Nie-Uruchamiaj-Mnie : X-SA-Exim-Connect-IP : X-SA-Exim-Rcpt-To : X-SA-Exim-Mail-From | ||
+ | |||
+ | remote_smtp_ex: | ||
+ | driver = smtp | ||
+ | headers_remove = X-SA-Nie-Uruchamiaj-Mnie : X-SA-Exim-Connect-IP : X-SA-Exim-Rcpt-To : X-SA-Exim-Mail-From | ||
+ | hosts_avoid_tls = * | ||
+ | |||
+ | local_delivery: | ||
+ | driver = appendfile | ||
+ | maildir_format | ||
+ | directory = ${lookup pgsql{SELECT maildir FROM account WHERE username = ' | ||
+ | # file = / | ||
+ | delivery_date_add | ||
+ | envelope_to_add | ||
+ | return_path_add | ||
+ | group = mail | ||
+ | mode = 0660 | ||
+ | headers_remove = X-SA-Nie-Uruchamiaj-Mnie : X-SA-Exim-Connect-IP : X-SA-Exim-Rcpt-To : X-SA-Exim-Mail-From | ||
+ | user = dovecot | ||
+ | |||
+ | local_delivery_spam: | ||
+ | driver = appendfile | ||
+ | maildir_format | ||
+ | directory = ${lookup pgsql{SELECT maildir FROM account WHERE username = ' | ||
+ | # file = / | ||
+ | delivery_date_add | ||
+ | envelope_to_add | ||
+ | return_path_add | ||
+ | group = mail | ||
+ | mode = 0660 | ||
+ | headers_remove = X-SA-Nie-Uruchamiaj-Mnie : X-SA-Exim-Connect-IP : X-SA-Exim-Rcpt-To : X-SA-Exim-Mail-From | ||
+ | user = dovecot | ||
+ | |||
+ | address_pipe: | ||
+ | driver = pipe | ||
+ | return_output | ||
+ | |||
+ | address_file: | ||
+ | driver = appendfile | ||
+ | delivery_date_add | ||
+ | envelope_to_add | ||
+ | return_path_add | ||
+ | |||
+ | address_reply: | ||
+ | driver = autoreply | ||
+ | |||
+ | begin retry | ||
+ | |||
+ | * * | ||
+ | |||
+ | begin rewrite | ||
+ | |||
+ | begin authenticators | ||
+ | |||
+ | PLAIN: | ||
+ | driver | ||
+ | server_set_id | ||
+ | server_prompts | ||
+ | server_condition | ||
+ | server_advertise_condition = ${if def: | ||
+ | |||
+ | LOGIN: | ||
+ | driver | ||
+ | server_set_id | ||
+ | server_prompts | ||
+ | server_condition | ||
+ | server_advertise_condition = ${if def: | ||
+ | </ |
exim4/configuration_file.1478164823.txt.gz · Last modified: 2020/07/15 09:30 (external edit)