################################################################################# # UWAGA! plik konfigurujący exima z zastosowaniem TLS/SSL oraz clamav. # Ten konfig sprawdzony został w praktyce - aby dostosować go do swoich wymagań # musisz zmienić wpisy dotyczące domeny (jest exim_domain), nazwy hosta (jest exim_hostname) # oraz ewentualnie zakresu wewnętrznej sieci (jest exim_localnet). # Możesz też uruchomić nndconf i wybrać konfigurację exima. ###################################################################### # Plik konfiguracyjny Exima # ###################################################################### ########### WAŻNE ############# WAŻNE ############ WAŻNE ############# # # # Po każdej zmianie w pliku konfiguracyjnym *MUSISZ* zrestartować Exima, # # aby zmiany zostały uwzględnione, chociaż każdy nowy proces Exima, który # # wystartuje np. w celu wysłania wiadomości, będzie "widział" zmiany # # w konfiguracji natychmiast. # # # # Nie ma potrzeby restartowania Exima po wprowadzeniu zmnian w innych # # plikach, do których odwołuje się ten konfig, ponieważ są one czytane # # na nowo za każdym razem, gdy Exim z nich korzysta. # # # # Nowo wprowadzone zmiany w konfiguracji można przetestować pod względem # # poprawności składniowej, np. uruchamiając polecenie # # "exim -C /config/konfig.new -bV". # # # ########### IMPORTANT ########## IMPORTANT ########### IMPORTANT ########### ###################################################################### # # Spamassassin uruchamiany przez wtyczkje sa-exim. # przed uruchomieniem nalezy skonfigurowac sa-exima!!. # local_scan_path = /usr/lib/exim/local_scan/sa-exim.so ###################################################################### # USTAWIENIA GŁÓWNE # ###################################################################### primary_hostname = exim_hostname.exim_domain domainlist local_domains = @:localhost:exim_domain domainlist relay_to_domains = hostlist relay_from_hosts = 127.0.0.1 acl_smtp_auth = acl_check_auth acl_smtp_mail = acl_check_mail acl_smtp_rcpt = acl_check_rcpt acl_smtp_data = acl_check_data av_scanner = clamd:/var/lib/clamav/clamd.sock # spamd_address = 127.0.0.1 783 tls_certificate = /etc/mail/exim.crt tls_privatekey = /etc/mail/exim.key tls_advertise_hosts = * # tls_verify_hosts = * daemon_smtp_ports = 25 : 465 tls_on_connect_ports = 465 qualify_domain = exim_domain # qualify_recipient = # allow_domain_literals # never_users = root host_lookup = * rfc1413_hosts = * rfc1413_query_timeout = 5s # sender_unqualified_hosts = # recipient_unqualified_hosts = # percent_hack_domains = ignore_bounce_errors_after = 2d timeout_frozen_after = 7d message_size_limit = 10M smtp_banner = +OK exim_domain ready ################################################# # DNS RBLs - lokalna biała lista # ################################################# # hostlist rbl_white_host = /etc/mail/white_hosts ################################################# # Zmienia nagłówki w poczcie od: # ################################################# received_header_text = "Received: \ ${if def:sender_rcvhost {from $sender_rcvhost\n\t} \ {${if def:sender_ident {from $sender_ident }}\ ${if def:sender_helo_name {(helo $sender_helo_name)}}\n\t}} \ by $primary_hostname (exim_hostname SMTP) \ ${if def:received_protocol {with $received_protocol}}\n\t \ ${if def:tls_cipher {(tls_cipher $tls_cipher) }}\ ${if def:tls_peerdn {(tls_peerdn $tls_peerdn) }}\ id $message_id\ ${if def:received_for {\n\t for <$received_for>}}" ###################################################################### # ACL CONFIGURATION # # Specifies access control lists for incoming SMTP mail # ###################################################################### begin acl acl_check_auth: accept encrypted = * deny message = STARTTLS required before AUTH acl_check_mail: accept condition = ${if or { \ {eq{$authenticated_id}{}} \ {eq{$authenticated_id@exim_domain}{$sender_address}} \ }{1}{0}} deny message = Authenticated user must match sender! acl_check_rcpt: accept hosts = : 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 domains = +local_domains require message = Can't verify sender verify = sender accept hosts = +relay_from_hosts accept authenticated = * require message = Authenticate first - Najpierw się zaloguj sender_domains = !+local_domains message = Relay not permitted domains = +local_domains : +relay_to_domains message = Can't verify recipient verify = recipient ############################################################################# # # # Odrzuca pocztę, jeśli host wysyłający znajduje się na spam-listach # # ( DNS RBLs ). # # UWAGA: to jest przykład, adresy list ciągle się zmieniają # # niektóre z niżej wymienionych mogą już nie funkcjonować, # # czasem powstają nowe. # # deny message = Host $sender_host_address is blacklisted in $dnslist_domain. # hosts = !+rbl_white_hosts # dnslists = \ # virbl.dnsbl.bit.nl : \ # list.dsbl.org : \ # dnsbl.sorbs.net : \ # bl.spamcop.net : \ # sbl.spamhaus.org : \ # xbl.spamhaus.org # ############################################################################# accept acl_check_data: # Odrzuca wiadomość z poważnym błędem MIME deny message = This message contains serious MIME error ($demime_reason) demime = * condition = ${if >{$demime_errorlevel}{2}{1}{0}} # Odrzuca wiadomość zawierającą potencjalnie niebezpieczny załącznik deny message = Unwanted file extension - nie akceptujemy plików (.$found_extension) demime = scr:vbs:bat:lnk:pif:exe:com:dll:reg # Odrzuca wiadomość zawierającą wirus(a|y) wykryte(go) przez clamav deny message = Virus found - znaleziono wirusa ($malware_name) malware = * ####################################################################################### # # # Odrzuca wiadomość, zawierającą w treści słowo "viagra", uwzględniając kombinacje # # ze spacjami oraz dużymi i małymi literami. # # UWAGA: to jest tylko przykład # deny message = This message matches a blacklisted regular expression ($regex_match_string) # regex = [Vv]*[Ii]*[Aa]*[Gg]*[Rr]*[Aa] # ###################################################################################### accept ###################################################################### # ROUTERS CONFIGURATION # # Specifies how addresses are handled # ###################################################################### # THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT! # # An address is passed to each router in turn until it is accepted. # ###################################################################### begin routers # domain_literal: # driver = ipliteral # domains = ! +local_domains # transport = remote_smtp dnslookup: driver = dnslookup domains = ! +local_domains transport = remote_smtp ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 no_more system_aliases: driver = redirect allow_fail allow_defer data = ${lookup{$local_part}lsearch{/etc/mail/aliases}} # user = exim file_transport = address_file pipe_transport = address_pipe userforward: driver = redirect check_local_user file = $home/.forward no_verify no_expn check_ancestor # allow_filter file_transport = address_file pipe_transport = address_pipe reply_transport = address_reply ################################# ## Procmail router ################################# # procmail: # driver = accept # check_local_user # transport = procmail_pipe # cannot_route_message = Procmail error ################################# localuser: driver = accept check_local_user transport = local_delivery cannot_route_message = Unknown user ###################################################################### # TRANSPORTS CONFIGURATION # ###################################################################### # ORDER DOES NOT MATTER # # Only one appropriate transport is called for each delivery. # ###################################################################### begin transports remote_smtp: driver = smtp local_delivery: driver = appendfile file = /var/spool/mail/$local_part delivery_date_add envelope_to_add return_path_add # group = mail # mode = 0660 address_pipe: driver = pipe return_output address_file: driver = appendfile delivery_date_add envelope_to_add return_path_add address_reply: driver = autoreply #################################### ## Procmail transport #################################### # procmail_pipe: # driver = pipe # command = /usr/bin/procmail -d $local_part # return_path_add # delivery_date_add # envelope_to_add # check_string = "From " # escape_string = ">From " # user = $local_part # # group = mail #################################### ###################################################################### # RETRY CONFIGURATION # ###################################################################### begin retry # This single retry rule applies to all domains and all errors. It specifies # retries every 15 minutes for 2 hours, then increasing retry intervals, # starting at 1 hour and increasing each time by a factor of 1.5, up to 16 # hours, then retries every 6 hours until 4 days have passed since the first # failed delivery. # Address or Domain Error Retries # ----------------- ----- ------- * * F,2h,15m; G,16h,1h,1.5; F,4d,6h ###################################################################### # REWRITE CONFIGURATION # ###################################################################### # There are no rewriting specifications in default configuration file. begin rewrite ###################################################################### # AUTHENTICATION CONFIGURATION # ###################################################################### begin authenticators plain: driver = plaintext public_name = PLAIN server_prompts = : server_condition = ${if pwcheck{$2:$3}{1}{0}} server_set_id = $2 login: driver = plaintext public_name = LOGIN server_prompts = "Username:: : Password::" server_condition = ${if pwcheck{$1:$2}{1}{0}} server_set_id = $1 ###################################################################### # CONFIGURATION FOR local_scan() # ###################################################################### # If you have built Exim to include a local_scan() function that contains # tables for private options, you can define those options here. Remember to # uncomment the "begin" line. It is commented by default because it provokes # an error with Exim binaries that are not built with LOCAL_SCAN_HAS_OPTIONS # set in the Local/Makefile. # begin local_scan # End of Exim configuration file