primary_hostname = olymp.org.ua CONFIG_PREFIX=/usr/local/etc/exim BASEIP = 192.168.0.30 hide mysql_servers = localhost/exim_db/exim/Mta_MaileR host_lookup = * domainlist local_domains = @:mysql;SELECT domain from domains where domain='$domain' #hostlist relay_from_hosts = localhost hostlist relay_from_hosts = 127.0.0.1 : 192.168.0.0/16 : 172.16.100.0/24 message_id_header_domain = $sender_address_domain acl_smtp_helo = acl_check_helo acl_smtp_mail = acl_check_sender acl_smtp_rcpt = acl_check_rcpt acl_smtp_mime = acl_check_mime exim_user = mailnull exim_group = mail never_users = root rfc1413_hosts = !* rfc1413_query_timeout = 180s dns_again_means_nonexist = !+local_domains ignore_bounce_errors_after = 2d timeout_frozen_after = 7d message_size_limit = 25M smtp_active_hostname = ${lookup mysql{select host from domains where ip = '$interface_address'}{$value}{$primary_hostname} } smtp_banner = ${lookup mysql{select host from domains where ip = '$interface_address'}{$value}{$primary_hostname} } ESMTP Sendmail 8.14.3/8.14.3; $tod_full spool_directory = /var/spool/exim split_spool_directory = true remote_max_parallel = 20 queue_run_max = 20 helo_allow_chars = :_ smtp_accept_max = 50 smtp_connect_backlog = 90 smtp_accept_max_per_host = 30 smtp_accept_queue = 67 smtp_accept_queue_per_connection = 30 recipients_max = 32 recipients_max_reject = true accept_8bitmime 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 ${lookup mysql{select host from domains where ip = '$interface_address'}{$value}{$primary_hostname} } \ ${if def:received_protocol {with $received_protocol}} \ ${if def:tls_cipher {($tls_cipher)\n\t}}\ (8.13.1/8.13.1)\n\t\ id $message_id\ ${if def:received_for {\n\tfor $received_for}} begin acl acl_check_helo: accept hosts = +relay_from_hosts : 127.0.0.1 deny message = Your host did not present HELO/EHLO greeting. log_message = SPAM remote host did not present HELO/EHLO greeting. condition = ${if def:sender_helo_name {false}{true}} deny message = Your host used our name in HELO/EHLO greeting. log_message = SPAM remote host used our name in HELO/EHLO greeting. (host: $sender_helo_name) condition = \ ${if \ match_domain{$sender_helo_name}\ {\ $primary_hostname:\ +local_domains\ }\ {true}{false}\ } deny message = Your host used our name in HELO/EHLO greeting. log_message = SPAM remote host used our name in HELO/EHLO greeting. (ip: $sender_helo_name) condition = ${lookup mysql{select host from domains where host = '$sender_helo_name'}{true}{false}} deny message = You host use dynamic address log_message = SPAM remote host use dynamic address condition = \ ${if \ match{$sender_host_name}\ {\ ^.*([.-]\\d\{1,3\})([.-]\\d\{1,3\}).*|\ ^.*([.-]\\d\{1,3\}).*client.*|\ ^.*client.*([.-]\\d\{1,3\}).*|\ ^.*dial(up|in).*([.-]\\d\{1,3\}).*|\ ^.*(\\d\{1,3\}[.-]?).*dial(up|in).*|\ ^.*(\\d\{1,3\}[.-]?).*dsl.*|\ ^.*dsl.*(\\d\{1,3\}[.-]?).*|\ ^.*dhcp.*(\\d\{1,3\}[.-]?).*|\ ^.*(\\d\{1,3\}[.-]?).*dhcp.*|\ ^.*(\\d\{1,3\}[.-]?).*ppp.*|\ ^.*ppp.*(\\d\{1,3\}[.-]?).*|\ ^.*(\\d\{1,3\}[.-]?).*pool.*|\ ^.*pool.*(\\d\{1,3\}[.-]?).*\ }\ {yes}{no}\ } accept acl_check_sender: accept hosts = : accept hosts = +relay_from_hosts accept authenticated = * deny senders = *@+local_domains message = relay not permitted warn verify = reverse_host_lookup message = DNS-Warning: Reverse DNS lookup failed for host $sender_host_address deny message = You domain is in a blacklist. log_message = Remote domain in the blacklist condition = ${lookup mysql{select domain from spam_domains where domain='$sender_address_domain'}{true}{false}} deny message = You address is in a blacklist. log_message = Address is in the blacklist condition = ${lookup mysql{select sender from spam_emails where sender='$sender_address'}{true}{false}} deny message = You host is in a blacklist. log_message = Host is in the blacklist condition = ${lookup mysql{select ip from spam_ip_senders where ip='$sender_host_address'}{true}{false}} accept acl_check_rcpt: accept hosts = +relay_from_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 verify = sender accept domains = +local_domains endpass verify = recipient accept hosts = +relay_from_hosts accept authenticated = * deny message = relay not permitted acl_check_mime: warn decode = default deny message = Blacklisted file extension detected condition = ${if match \ {${lc:$mime_filename}} \ {\N(\.cpl|\.pif|\.bat|\.scr|\.lnk|\.com)$\N} \ {1}{0}} deny message = Sorry, We do not speak in this language (charset: $mime_charset) log_message = SPAM invalid language (charset: $mime_charset) condition = \ ${if \ match{${lc:$mime_charset}}\ {\ gb18030|\ shift_jis\ # big5\ }\ {true} {false}\ } accept warn message = WhiteListIP: YES condition = ${lookup mysql{select ip from white_ip_senders where ip='$sender_host_address'}{true}{false}} warn message = WhiteListDomain: YES condition = ${lookup mysql{select domain from white_domains where domain='$sender_address_domain'}{true}{false}} warn message = WhiteListSender: YES condition = ${lookup mysql{select sender from white_emails where sender='$sender_address'}{true}{false}} accept senders = ${lookup mysql{select sender from white_emails where sender='$sender_address'}{$sender_address}{}} accept hosts = ${lookup mysql{select ip from white_ip_senders where ip='$sender_host_address'}{$sender_host_address}{}} accept hosts = ${lookup mysql{select domain from white_domains where domain='$sender_address_domain'}{$sender_host_name}{}} log_message = SPAM message header fail syntax check !verify = header_syntax warn message = X-Sender-Verify-Failed: No valid sender in message header log_message = No valid sender in message header !verify = header_sender accept begin routers replace_header: driver = dnslookup domains = !+local_domains transport = remote_smtp headers_remove = \ ${if \ def:h_RelayHost: \ {}\ {\ Date : \ X-MimeOLE : \ X-Mailer : \ X-MSMail-Priority : \ User-Agent\ }\ }\ : RelayHost : Received headers_add = \ ${if \ def:h_RelayHost: \ {} \ {\ Date: $tod_full\n\ User-Agent: Mozilla Thunderbird 2.0.0.22\ }\ } no_more ##закаментировать при отрпавке через 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 mysql{select alias from aliases where mail ='${quote_mysql:$local_part@$domain}'}{$value}fail} user = mailnull group = mail file_transport = address_file pipe_transport = address_pipe userforward: driver = redirect file = ${lookup mysql{select maildir from accounts where login = '${quote_mysql:$local_part@$domain}'}{$value}fail}/.forward user = mailnull group = mail no_verify no_expn check_ancestor allow_filter file_transport = address_file pipe_transport = address_pipe reply_transport = address_reply condition = ${if exists{${lookup mysql{select maildir from accounts where login = '${quote_mysql:$local_part@$domain}'}{$value}fail}/.forward} {yes} {no} } autoreply_router: driver = accept senders = "! ^.*-request@.*:\ ! ^owner-.*@.*:\ ! ^postmaster@.*:\ ! ^listmaster@.*:\ ! ^mailer-daemon@.*" condition = ${if exists{AUTOREPLYPATH/$local_part@$domain}{yes}{no}} unseen no_expn no_verify transport = autoreply_transport localuser: driver = accept condition = ${lookup mysql {select uid from accounts where login = '${quote_mysql:$local_part@$domain}'}{yes}{no}} transport = local_delivery cannot_route_message = Unknown user begin transports remote_smtp: driver = smtp ###SMTP Поровайдера### #rmail: #driver = smtp #hosts = smtp.united.net.ua #####Конец### connect_timeout = 3m interface = ${lookup mysql{select ip from domains where domain = '$sender_address_domain'} {$value} {BASEIP} } helo_data = ${lookup mysql{select host from domains where domain = '$sender_address_domain'} {$value} {$primary_hostname} } local_delivery: driver = appendfile directory = ${lookup mysql{select maildir from accounts where login = '${quote_mysql:$local_part@$domain}'}{$value}fail} create_directory directory_mode = 0770 maildir_format delivery_date_add envelope_to_add return_path_add user = mailnull group = mail mode = 0660 no_mode_fail_narrower headers_remove = ${if match_domain{$sender_address_domain}{+local_domains}{received}{}} : RelayHost quota = ${lookup mysql{select mailquota from accounts where login = '${quote_mysql:$local_part@$domain}'}{$value}fail}M quota_warn_message = "\ To: $local_part@domain\n\ Subject: Your maildir is going full\n\ This message is automaticaly gnerated by your mail server.\n\ This means, that your mailbox is 75% full. If you would \n\ override this limit new mail would not be delivered to you!\n" quota_warn_threshold = 75% address_pipe: driver = pipe return_output address_file: driver = appendfile delivery_date_add envelope_to_add return_path_add autoreply_transport: driver = autoreply file = AUTOREPLYPATH/$local_part@$domain log = AUTOREPLYPATH/log/$local_part@$domain file_expand from = $local_part@$domain to = $sender_address user = mailnull subject = Re: $h_subject: address_reply: driver = autoreply begin retry * * F,4h,5m; G,16h,1h,1.5; F,4d,6h begin rewrite begin authenticators lookup_cram: driver = cram_md5 public_name = CRAM-MD5 server_secret = ${lookup mysql {select password from accounts where login='$1'}{$value}fail} server_set_id = $1 login: driver = plaintext public_name = LOGIN server_prompts = Username:: : Password:: server_condition = ${lookup mysql {select login from accounts where login='$1' and password='$2'}{yes}{no}} server_set_id = $1