Вот конфигурация exim:
MAIN CONFIGURATION SETTINGS
primary_hostname = server.mydomain.com
smtp_banner = "$primary_hostname ESMTP mail server $tod_full"
message_size_limit=30M
av_scanner = clamd:/tmp/clamd
system_filter = /usr/local/etc/exim/filter
smtp_accept_queue_per_connection = 0domainlist local_domains = mydomain.com
domainlist relay_to_domains = mydomain.com
hostlist relay_from_hosts = localhost : 192.168.0.0/22 : 195.128.xx.xx/28 : 213.247.xx.xx
acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_data
acl_smtp_helo = acl_check_helo
qualify_domain = mydomain.com
exim_user = mailnull
exim_group = mail
never_users = root
spool_directory = /var/spool/exim
split_spool_directory
rfc1413_query_timeout = 0s
ignore_bounce_errors_after = 2d
timeout_frozen_after = 7d
ACL CONFIGURATION
begin acl
acl_check_rcpt:
accept hosts = 192.168.0.110 : 192.168.0.111 : 213.247.xx.xx : 195.128.xx.xx :
89.175.xx.xx : 192.168.0.200 : 127.0.0.1
deny local_parts = ^.*[@%!/|] : ^\\.
accept domains = +local_domains
accept domains = +relay_to_domains
accept hosts = +relay_from_hosts
accept authenticated = *
deny message = relay not permitted
acl_check_data:
deny message = we do not need virus
demime = *
malware = *
warn message = X-XXX-AV: contains malformed MIME ($demime_reason)
demime = *
condition = ${if >{$demime_errorlevel}{2}{1}{0}}
warn message = X-XXX-AV: contains an attachment we donot accept (.$found_extension)
demime = bas:bat:chm:cmd:com:cpl:exe:hta:inf:ins:jsp:js:jse:lnk:pif:prf:reg:scr:vb:vbe:vbs:wsh
accept
acl_check_helo:
deny message = helo invalid: cannot be '$sender_helo_name'
hosts = !195.128.xx.xx
condition = ${if or {{eq{$sender_helo_name}{$interface_address}} \
{! match{$sender_helo_name}{\N^[a-zA-Z0-9\[]+.*\.[a-zA-Z0-9\]]+$\N}} \
{match_domain{$sender_helo_name}{+local_domains}}} {yes}{no}}
accept
ROUTERS CONFIGURATION
begin routers
root_redirect:
driver = redirect
domains = server.mydomain.com
condition = ${if eq {$local_part}{root} {1}{0}}
data = root@mydomain.com
dnslookup:
driver = dnslookup
domains = ! +local_domains
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more
autoanswer_router:
driver = accept
transport = autoreply_custom
require_files = "/usr/local/etc/exim/answer/${original_local_part}.answer"
senders = "! ^.*-request@.*:\
! ^owner-.*@.*:\
! ^postmaster@.*:\
! ^listmaster@.*:\
! ^mailer-daemon@.*"
condition = "${if or {{match {$h_precedence:} {(?i)junk|bulk|list}} \
{eq {$sender_address} {}} \
{ and {{!eq {$local_part} {$original_local_part}} \
} } } {no} {yes}}"
unseen
no_expn
no_verify
user = mailnull
do_not_need_messages:
driver = accept
transport = black_hole_transport
domains = +local_domains
condition = ${if or {{eq {$local_part}{www-forum}} \
{eq {$local_part}{root}} \
{eq {$local_part}{spambox98}} \
{eq {$local_part}{fun}} \
{eq {$local_part}{mailnull}}} {yes}{no}}
ms_exchange_virus:
driver = manualroute
transport = remote_smtp_filter
condition = ${if def:header_X-XXX-AV: {1}{0}}
domains = +local_domains
route_list = * 192.168.0.110
no_more
ms_exchange_router:
driver = manualroute
transport = remote_smtp
domains = +local_domains
route_list = * 192.168.0.110
no_more
other_mail:
driver = accept
transport = collect_to_file
no_more
localuser:
driver = accept
check_local_user
transport = local_delivery
TRANSPORTS CONFIGURATION
begin transports
remote_smtp:
driver = smtp
remote_smtp_filter:
driver = smtp
transport_filter=/usr/local/etc/exim/filter.virus "$h_X-XXX-AV:"
user = mailnull
group = mail
collect_to_file:
driver = appendfile
file = /var/log/exim/not_found_mail
delivery_date_add
envelope_to_add
return_path_add
group = mail
mode = 0660
black_hole_transport:
driver = appendfile
file = /dev/null
group = mail
mode = 0660
autoreply_custom:
driver = autoreply
user = mailnull
file = "/usr/local/etc/exim/answer/${original_local_part}.answer"
to = "${sender_address}"
from = "${local_part}@nival.com"
subject = "This is an autoreply message"
local_delivery:
driver = appendfile
file = /var/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
RETRY CONFIGURATION
begin retry
* * F,2h,15m; G,16h,1h,1.5; F,4d,6h
REWRITE CONFIGURATION
begin rewrite
*@server.mydomain.com $1@mydomain.com Ffrs
#*@server.mydomain.com $1@mydomain.com h
www@www.mydomain.com www-forum@mydomain.com Ffrs
AUTHENTICATION CONFIGURATION
begin authenticators