У меня вот так заработало:
######################################################################
# MAIN CONFIGURATION SETTINGS #
######################################################################
hide mysql_servers = host/base/user/password
primary_hostname = my.host
domainlist local_domains = ${lookup mysql{SELECT domainname FROM domains \
WHERE domainname='$domain' AND type='LOCAL'}}
domainlist relay_to_domains = ${lookup mysql{SELECT domainname FROM domains \
WHERE domainname='$domain' AND type='RELAY'}}
hostlist relay_from_hosts = 127.0.0.1
acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_data
av_scanner = clamd:/var/run/clamav/clamd
log_selector = \
+all_parents \
+lost_incoming_connection \
+received_sender \
+received_recipients \
+smtp_confirmation \
+smtp_syntax_error \
+smtp_protocol_error
allow_domain_literals = false
never_users = root:bin:daemon
host_lookup = *
rfc1413_hosts = *
rfc1413_query_timeout = 0s
ignore_bounce_errors_after = 30m
timeout_frozen_after = 2d
freeze_tell = postmaster
auto_thaw = 1h
message_size_limit = 2M
smtp_accept_max = 50
smtp_accept_max_per_connection = 50
smtp_connect_backlog = 50
smtp_accept_max_per_host = 25
split_spool_directory = true
remote_max_parallel = 15
trusted_users = uucp:mail
smtp_banner = "Welcome on our mail server!\n\
Have a nice day!\n\n${primary_hostname} ESMTP"
######################################################################
# ACL CONFIGURATION #
# Specifies access control lists for incoming SMTP mail #
######################################################################
begin acl
acl_check_rcpt:
accept hosts = :
deny local_parts = ^.*[@%!/|] : ^\\.
deny message = HELO/EHLO required by SMTP RFC
condition = ${if eq{$sender_helo_name}{}{yes}{no}}
accept local_parts = postmaster
domains = +local_domains
require verify = sender
# deny message = host is listed in $dnslist_domain
# dnslists = sbl.spamhaus.org : \
# relays.ordb.org : \
# opm.blitzed.org
accept domains = +relay_to_domains
accept hosts = +relay_from_hosts
accept domains = +local_domains
authenticated = *
endpass
message = User known but not equivalent to sender
verify = recipient
condition = ${if match {$sender_address}{$authenticated_id@my\.host}{yes}{no}}
accept domains = +local_domains
endpass
verify = recipient
condition = ${if !match {$sender_address_domain}{my\.host}{yes}{no}}
accept domains = *
authenticated = *
endpass
message = User known but not equivalent to sender
verify = recipient
condition = ${if match {$sender_address}{$authenticated_id@my\.host}{yes}{no}}
deny message = relay not permitted
acl_check_data:
# deny message = This message contains a MIME error ($demime_reason)
# demime = *
# condition = ${if >{$demime_errorlevel}{2}{1}{0}}
# deny message = This message contains an unwanted file extension ($found_exten
# demime = scr:vbs
deny message = This message contains malware ($malware_name)
demime = *
malware = *
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
dnslookup:
driver = dnslookup
domains = ! +local_domains
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more
dbmail_user:
driver = accept
condition = ${lookup mysql{SELECT alias_idnr FROM aliases WHERE \
alias='${quote_mysql:$local_part@$domain}' OR \
alias='${quote_mysql:$domain}'}{yes}{no}}
transport = dbmail_delivery
######################################################################
# TRANSPORTS CONFIGURATION #
######################################################################
# ORDER DOES NOT MATTER #
# Only one appropriate transport is called for each delivery. #
######################################################################
begin transports
remote_smtp:
driver = smtp
dbmail_delivery:
driver = pipe
check_string =
user = USER
group = MAIL
command = /usr/local/sbin/dbmail-smtp -d ${pipe_addresses}
current_directory = "/var/spool/dbmail"
escape_string =
message_prefix =
message_suffix =
path = "/bin:/sbin:/usr/local/bin:/usr/local/sbin"
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
# Domain Error Retries
# ------ ----- -------
* * F,2h,15m; G,16h,1h,1.5; F,4d,6h
######################################################################
# REWRITE CONFIGURATION #
######################################################################
begin rewrite
######################################################################
# AUTHENTICATION CONFIGURATION #
######################################################################
# There are no authenticator specifications in this default configuration file.
begin authenticators
# AUTH PLAIN authentication method with MySQL used by Netscape Messenger.
auth_plain:
driver = plaintext
public_name = PLAIN
server_condition = "${if crypteq{$2}{${extract{1}{:}{${lookup mysql{SELECT \
passwd FROM users WHERE userid = '${quote_mysql:$2}'}}}}}{1}{0}}"
server_set_id = $2
# AUTH LOGIN authentication method with MySQL support used by Outlook Express.
auth_login:
driver = plaintext
public_name = LOGIN
server_condition = "${if crypteq{$2}{${extract{1}{:}{${lookup mysql{SELECT \
passwd FROM users WHERE userid = '${quote_mysql:$1}'}}}}}{1}{0}}"
server_prompts = "Username:: : Password::"
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