hide mysql_servers = "localhost/1111/1111/11111"
USER_QUERY=${lookup mysql{SELECT username AS home_dir, username AS username FROM users WHERE username='${quote_mysql:$local_part}' }}
smtp_accept_max = 500
smtp_accept_max_per_host = 5
######################################################################
# MAIN CONFIGURATION SETTINGS #
######################################################################
message_size_limit = 30M
domainlist local_domains = univ.kiev.ua : mail.univ.kiev.ua : rpd.univ.kiev.ua : econom.univ.kiev.ua : phys.univ.kiev.ua
domainlist relay_to_domains = *.univ.kiev.ua
hostlist relay_from_hosts = localhost : 10.0.0.0/8 : 91.202.128.0/22 : 193.41.88.0/24 : 195.39.242.0/23 : 193.254.221.0/24
#hostlist relay_from_hosts = 127.0.0.1
#ТБЪТЕЫЙФШ ПФРТБЧМСФШ _ЧУЕН_ ФПМШЛП РПУМЕ ХУРЕЫОПК БХОФЙЖЙЛБГЙЙ:
#hostlist auth_relay_from_hosts = 10.0.0.0/8
# Most straightforward access control requirements can be obtained by
# appropriate settings of the above options. In more complicated situations,
# you may need to modify the Access Control Lists (ACLs) which appear later in
# this file.
# The first setting specifies your local domains, for example:
#
# domainlist local_domains = mail.univ.kiev.ua
#
acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_data
#acl_smtp_data = acl_check_content
# You should not change those settings until you understand how ACLs work.
#av_scanner = clamd:127.0.0.1 3310
#spamd_address = 127.0.0.1 783
# Allow any client to use TLS.
tls_advertise_hosts = *
tls_certificate = /etc/ssl/certs/exim.pem
tls_privatekey = /etc/ssl/private/exim.pem
#tls_certificate = /usr/local/www/mail.univ.kiev.ua/certs/exim.crt
#tls_privatekey = /usr/local/www/mail.univ.kiev.ua/private/exim.crt
daemon_smtp_ports = 25 : 465 : 587
tls_on_connect_ports = 465
# qualify_domain =
# qualify_recipient =
# allow_domain_literals
exim_user = mailnull
exim_group = mail
never_users = root
host_lookup = *
# The settings below, which are actually the same as the defaults in the
rfc1413_hosts = *
rfc1413_query_timeout = 5s
auth_advertise_hosts = 10.0.0.0/8
ignore_bounce_errors_after = 2d
# This option cancels (removes) frozen messages that are older than a week.
timeout_frozen_after = 7d
######################################################################
# ACL CONFIGURATION #
# Specifies access control lists for incoming SMTP mail #
######################################################################
begin acl
acl_check_rcpt:
#deny message = only for official use
# hosts = !+relay_from_hosts
#condition = ${if eq{${lookup mysql{SELECT email FROM whitelist WHERE email = '$sender_address'}}}{}{yes}{no}}
# log_message = ЬФП ВЩМ ОЕ ОБЫ ЮЕМПЧЕЛ!
#ьФП РПУФБЧЙМ РП РТПУШВЕ чЙФБМЙЛБ
accept senders = *@backup.univ.kiev.ua : *@sauron.univ.kiev.ua
# Accept if the source is local SMTP (i.e. not over TCP/IP). We do this by
# testing for an empty sending host field.
accept hosts = :
# ъБРТЕЭЭБЕН ФЕИ, ЛФП ОЕ ПВНЕОЙЧБЕФУС РТЙЧЕФУФЧЕООЩНЙ
# УППВЭЕОЙСНЙ (HELO/EHLO)(ьФП аТБ РПУФБЧЙМ 22 НБТФБ 2010) оБЮБМП
deny message = "HELO/EHLO require by SMTP RFC"
condition = ${if eq{$sender_helo_name}{}{yes}{no}}
#ьФП ОБДП ТБУЛПНЕФЙФШ ЛПЗДБ ВХДЕФ ЧЛМАЮЕОБ БХОФЙФЙЖЙЛБГЙС АЪЕТБ
accept authenticated = *
#оЕ РТПРХУЛБЕН РПЮФПЧЙЛЙ Ч HELO/EHLO ЛПФПТЩИ ФПМШЛП ВХЛЧЩ, ГЙЖТЩ, -, _, РТПВЕМ. аТБ РПУФБЧЙМ 15 УЕОФСВТС 2010
#deny message = "Can not be only letters, numbers, -, _, space in HELO/EHLO. See SMTP RFC"
# condition = ${if match{$sender_helo_name}{\N^[A-Za-z0-9\_\-\ ]+$\N}{yes}{no}}
# !senders = :
# !authenticated = *
# hosts = !127.0.0.1 : !localhost : *
# logwrite = "Can not be only letters, numbers, -, _, space in HELO/EHLO. See SMTP RFC: [SH=$sender_host_address S=$sender_address HELO=$sender_helo_name LPLD=$local_part@$domain]"
#оЕ РТПРХУЛБЕН ЕУМЙ ОЕФ ПВТБФОПК ЪПОЩ доу аТБ РПУФБЧЙМ 15 УЕОФСВТС 2010
#deny message = "Inconsistent or no DNS reverse entry"
# !authenticated = *
# hosts = !127.0.0.1 : !localhost : *
# condition = ${if and{{def:sender_host_address}{!def:sender_host_name}}{yes}{no}}
# logwrite = "Inconsistent or no DNS reverse entry for $sender_host_address"
#оЕ РТПРХУЛБЕН ЕУМЙ ПФРТБЧЙФЕМШ Й РПМХЮБФЕМШ ПДЙОБЛПЧЩЕ, Ф.Е. ОЕМШЪС ВХДЕФ ПФРТБЧЙФШ УП УЧПЕЗП НЩМБ УЕВЕ РЙУШНП. аТБ РПУФБЧЙМ 15 УЕОФСВТС 2010
deny message = "Sender and recipient is equivalent"
!senders = :
condition = ${if eq{$sender_address}{$local_part@$domain}{yes}{no}}
logwrite = "Sender and recipient is equivalent. $sender_address = $local_part@$domain"
# тХВЙН ЕУМЙ ПФРТБЧЛБ ПФ УЕВС Л УЕВЕ ОЕ У ОБЫЕК УЕФЙ(жЙМШФТБГЙС УРБНБ ЧЙДБ from: user@domain.org to: user@domain.org)
deny hosts = !+relay_from_hosts
domains = +local_domains
condition = ${if or{ { eq{$sender_address}{$local_part@$domain} }\
{ eq{$sender_address_domain}{$domain} } } }
log_message = The same local addresses or domain in MAIL FROM and RCPT TO from nonlocal relay
message = Access denied
#ЛПОЕГ
#тХВБЕН ОБИ, ФЕИ, ЛФП РПДУФБЧМСЕФ УЧПК IP Ч HELO(аТБ РПУФБЧЙМ 22 НБТФБ 2010)
deny message = "Your IP in HELO - access denied!"
hosts = * : !+relay_from_hosts : !81-196.lissyara.su
condition = ${if eq{$sender_helo_name}\
{$sender_host_address}{true}{false}}
# тХВБЕН ФЕИ, ЛФП Ч HELO РЙИБЕФ НПК IP (2500 НХДБЛПЧ ЪБ НЕУСГ!)(аТБ РПУФБЧЙМ 22 НБТФБ 2010)
deny condition = ${if eq{$sender_helo_name}\
{$interface_address}{yes}{no}}
hosts = !127.0.0.1 : !localhost : *
message = "main IP in your HELO! Access denied!"
# тХВБЕН ФЕИ, ЛФП Ч HELO РЙИБЕФ ФПМШЛП ГЙЖТЩ(аТБ РПУФБЧЙМ)
# (ОЕ ВЩЧБЕФ ИПУФПЧ фпмшлп ЙЪ ГЙЖТ)
deny condition = ${if match{$sender_helo_name}\
{\N^\d+$\N}{yes}{no}}
hosts = !127.0.0.1 : !localhost : *
message = "can not be only number in HELO!"
deny message = "Bad host, use provider SMTP server"
condition = ${if match{$sender_host_name} \
# {dsl-|adsl|dynamic|\.hsd1\.|dialup|pool|dhcp|\
{dsl-|adsl|dynamic|\.hsd1\.|dialup|pool|dhcp|user.veloxzone.com.br|multi.surbl.org|black.uribl.com|\
ssrv\.cl|msmartin.com.pe|\.cablep\.|dial-up|\.dsl\.|fbx.proxad|hsd1.in|-ras1|cpe-|\
broadway.dreamhost|\.cable\.|dip..t-ipconnect} \
{yes}{no}}
#рТПЧЕТСЕН УХЭЕУФЧХФЕ МЙ ДПНЕО ПФРТБЧЙФЕМС
#deny log_message = Sender verify failed
# !verify = sender/callout=60s,maxwait=180s
#рТПЧЕТСЕН, УХЭЕУФЧХЕФ МЙ ДПНЕО РПМХЮБФЕМС
deny log_message = Recipient verify failed
authenticated = *
!verify = recipient/callout
#ДЕМБЕН ЪБРТЕФ ДПУФБЧЛЙ РПЮФЩ ЛПОЛТЕФОЩН АЪЕТБН
#deny senders = user@mail.ru : user2@rambler.ru
deny senders = Susan.Campbell@gmail.com : webmail@unical.it : inaderefyanko@inbox.com : kluefigorek@mail.ru : olegsammstroi@inbox.com : *@17.20.112.128 : noreply@kupiskidku.com
# Check recipient in local domains(ьФП аТБ РПУФБЧЙМ)
# # If not match go to other ACL
accept domains = +local_domains
endpass
message = "In my mailserver not stored this user"
verify = recipient
#лПОЕГ
#
#
#
#
# Check recipient in relayed domains(ЬФП аТБ РПУФБЧЙМ)
# # If not match go to other ACL
accept domains = +relay_to_domains
endpass
message = "Mail server not know how relay to this address"
verify = recipient
#лПОЕГ
#
#
#
#
#
#
#
#
#
#аТБ УФБЧЙФ ЪБДЕТЦЛХ (ОБЮБМП)
#
#warn
# УФБЧЙН ДЕЖПМФПЧХА ЪБДЕТЦЛХ Ч 20 УЕЛХОД
# set acl_m0 = 30s
#warn
# УФБЧЙН ЪБДЕТЦЛХ Ч 0 УЕЛХОД УЧПЙН ИПУФБН Й
# ДТХЦЕУФЧЕООЩН УЕФСН (УПУЕДОСС ЛПОФПТБ :))
# hosts = +relay_from_hosts:91.202.128.0/24:10.0.0.0/8
#set acl_m0 = 0s
#warn
# delay = $acl_m0
#ЛПОЕГ ЪБДЕТЦЛЙ
#
#
#
########## ьФП аТБ РПУФБЧЙМ################################################################# 23 НБТФБ 2010 АТБ РПУФБЧЙМ УАДБ
deny message = Administrative denied 'blind' ('hidden') copy messages
condition = ${if >{$acl_m0}{110}{yes}{no}}
hosts = !+relay_from_hosts:*
!verify = not_blind
#лПОЕГ
#############################################################################
# The following section of the ACL is concerned with local parts that contain
# @ or % or ! or / or | or dots in unusual places.
#
# The characters other than dots are rarely found in genuine local parts, but
# are often tried by people looking to circumvent relaying restrictions.
# Therefore, although they are valid in local parts, these rules lock them
# out, as a precaution.
#
# Empty components (two dots in a row) are not valid in RFC 2822, but Exim
# allows them because they have been encountered. (Consider local parts
# constructed as "firstinitial.secondinitial.familyname" when applied to
# someone like me, who has no second initial.) However, a local part starting
# with a dot or containing /../ can cause trouble if it is used as part of a
# file name (e.g. for a mailing list). This is also true for local parts that
# contain slashes. A pipe symbol can also be troublesome if the local part is
# incorporated unthinkingly into a shell command line.
#
# Two different rules are used. The first one is stricter, and is applied to
# messages that are addressed to one of the local domains handled by this
# host. The line "domains = +local_domains" restricts it to domains that are
# defined by the "domainlist local_domains" setting above. The rule blocks
# local parts that begin with a dot or contain @ % ! / or |. If you have
# local accounts that include these characters, you will have to modify this
# rule.
deny message = Restricted characters in address
domains = +local_domains
local_parts = ^[.] : ^.*[@%!/|]
# The second rule applies to all other domains, and is less strict. The line
# "domains = !+local_domains" restricts it to domains that are NOT defined by
# the "domainlist local_domains" setting above. The exclamation mark is a
# negating operator. This rule allows your own users to send outgoing
# messages to sites that use slashes and vertical bars in their local parts.
# It blocks local parts that begin with a dot, slash, or vertical bar, but
# allows these characters within the local part. However, the sequence /../
# is barred. The use of @ % and ! is blocked, as before. The motivation here
# is to prevent your users (or your users' viruses) from mounting certain
# kinds of attack on remote sites.
deny message = Restricted characters in address
domains = !+local_domains
local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
#############################################################################
require verify = sender
accept hosts = +relay_from_hosts
control = submission
accept authenticated = *
control = submission
require message = relay not permitted
domains = +local_domains : +relay_to_domains
require verify = recipient
accept domains = +local_domains
endpass
verify = recipient
deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text
dnslists = xbl.spamhaus.org : dnsbl.njabl.org : bl.spamcop.net : cbl.abuseat.org : dnsbl.sorbs.net : list.dsbl.org : dnsbl-1.uceprotect.net : rbls.org
acl_check_data:
# Deny if the message contains a virus. Before enabling this check, you
# must install a virus scanner and set the av_scanner option above.
#
deny malware = *
message = This message contains a virus ($malware_name)
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
smarthost_routers:
driver = manualroute
transport = remote_smtp
# route_list = !+local_domains smtp.ldc.net
route_data = ${lookup{$domain}partial-lsearch{/etc/mail/smarthosts}}
# no_more
dnslookup:
driver = dnslookup
domains = ! +local_domains
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more
userautoreply:
driver = accept
#condition = ${if eq{} {${lookup mysql{SELECT recipient FROM autoreply \ ---аТБ ХВТБМ НХУЛХМ
#WHERE recipient='${local_part}@${domain}'}}}{no}{yes}} ---аТБ ХВТБМ НХУЛХМ
#condition = ${if eq {${local_part}} {webmail} {yes} {no}}
condition = ${if match{$local_part}{\N^(webmail|admin|proxy)$\N}{yes}{no}}
senders = " ! ^.*-request@.*:\
! ^owner-.*@.*:\
! ^postmaster@.*:\
! ^listmaster@.*:\
! ^mailer-daemon@.*\
! ^root@.*\
! ^noreply@.*"
no_expn
no_verify
transport = userautoreply
unseen
#
system_aliases:
driver = redirect
#allow_fail
#allow_defer
data = ${lookup{$local_part}lsearch{/etc/aliases}}
user = mailnull
group = mail
file_transport = address_file
pipe_transport = address_pipe
userforward:
driver = redirect
check_local_user
# local_part_suffix = +* : -*
# local_part_suffix_optional
file = $home/.forward
# allow_filter
no_verify
no_expn
check_ancestor
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply
condition = ${if exists{$home/.forward} {yes} {no} }
virtualuser:
driver = accept
transport = virtual_delivery
condition = ${if eq {${extract{username}{USER_QUERY}}} {$local_part} {1}{0}}
######################################################################
# TRANSPORTS CONFIGURATION #
######################################################################
# ORDER DOES NOT MATTER #
# Only one appropriate transport is called for each delivery. #
######################################################################
# A transport is used only when referenced from a router that successfully
# handles an address.
begin transports
# This transport is used for delivering messages over SMTP connections.
remote_smtp:
driver = smtp
interface = 91.202.128.82
#аТБ РПУФБЧЙМ БЧФППФЧЕФЮЙЛ 30 НБТФБ 2010 (ОБЮБМП)
userautoreply:
driver = autoreply
#headers = "Content-Type: text/plain; charset=KOI8-U"
headers = "Content-Type: multipart/alternative; boundary=------------070003080309030305060704"
from = ${local_part}@${domain}
reply_to = ${local_part}@${domain}
to = ${sender_address}
subject = AutoReply from: ADMIN Mail.Univ.Kiev.Ua
#text = х ЧЙРБДЛХ ЧЙОЙЛОЕООС РТПВМЕН РТЙ ТПВПФ¦ Ъ РПЫФПА ЪЧЕТФБКФЕУШ РП email: webmail-net[УПВБЛБ]univ.kiev.ua, ДЕ [УПВБЛБ]=@
file = /home/bobot/text
#text = ${lookup mysql{SELECT message FROM autoreply WHERE recipient='${local_part}@${domain}'}} --- аТБ ХВТБМ ЮФПВ ТБВПФБМП ВЕЪ НХУЛХМБ
address_pipe:
driver = pipe
return_output
# This transport is used for handling deliveries directly to files that are
# generated by aliasing or forwarding.
address_file:
driver = appendfile
delivery_date_add
envelope_to_add
return_path_add
# This transport is used for handling autoreplies generated by the filtering
# option of the userforward router.
address_reply:
driver = autoreply
virtual_delivery:
driver = appendfile
maildir_format = true
directory = /mail/univ.kiev.ua/$local_part/Maildir
#quota = 100M ------ьФП аТБ ХВБМ ЮФПВ exim ВТБЪ ЛЧПФХ ЙЪ НХУЛХМБ
##############аТБ РПУФБЧЙМ ЮФПВ exim ВТБМ ТБЪНЕТ СЭЙЛБ ЙЪ НХУЛХМБ
quota = ${lookup mysql{SELECT quota FROM users \
WHERE username='${local_part}'}{${value}M}}
quota_filecount = 20000
maildir_use_size_file = true
quota_warn_threshold = 75%
quota_warn_message = "\
To: $local_part@$domain\n\
Subject: Your mailbox\n\n\
This message is automatically created \
by mail delivery software.\n\n\
The size of your mailbox has exceeded \
a warning threshold that is\n\
set by the system administrator. \n"
directory_mode = 770
delivery_date_add
envelope_to_add
return_path_add
group = mail
user = mailnull
mode = 0660
no_mode_fail_narrower
#filter delivery
######################################################################
# RETRY CONFIGURATION #
######################################################################
begin retry
# Address or Domain Error Retries
# ----------------- ----- -------
* * F,2h,15m; G,16h,1h,1.5; F,4d,6h
######################################################################
# AUTHENTICATION CONFIGURATION #
######################################################################
auth_plain:
driver = plaintext
public_name = PLAIN
server_condition = "${if crypteq{$2}{${extract{1}{:}{${lookup mysql{SELECT \
password FROM users WHERE username = '${quote_mysql:$2}'}}}}}{1}{0}}"
server_set_id = $2
auth_login:
driver = plaintext
public_name = LOGIN
server_condition = "${if crypteq{$2}{${extract{1}{:}{${lookup mysql{SELECT \
password FROM users WHERE username = '${quote_mysql:$1}'}}}}}{1}{0}}"
server_prompts = "Username:: : Password::"
server_set_id = $1
# End of Exim configuration file