Код: Выделить всё
# cat /usr/local/etc/exim/configure
#!/bin/sh
primary_hostname = mail.tiptop-ad.ru
hide mysql_servers = localhost/exim/exim/exim
#daemon_smtp_ports = 25 : 1025
local_interfaces = 127.0.0.1.25 : 127.0.0.1.1025 : 192.168.1.102.25
domainlist local_domains = ${lookup mysql{SELECT `domain` \
FROM `domain` WHERE \
`domain`='${domain}' AND \
`active`='1'}}
domainlist relay_to_domains = ${lookup mysql{SELECT `domain` \
FROM `domain` WHERE \
`domain`='${domain}' AND \
`active`='1'}}
hostlist relay_from_hosts = localhost:127.0.0.0/8:192.168.1.0/24
acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_data
av_scanner = clamd:/var/run/clamav/clamd.sock
qualify_domain = mail.tiptop-ad.ru
qualify_recipient = mail.tiptop-ad.ru
allow_domain_literals = false
exim_user = mailnull
exim_group = mail
never_users = root
rfc1413_query_timeout = 0s
sender_unqualified_hosts = +relay_from_hosts
recipient_unqualified_hosts = +relay_from_hosts
ignore_bounce_errors_after = 45m
timeout_frozen_after = 15d
helo_accept_junk_hosts = 192.168.1.0/24
auto_thaw = 1h
smtp_banner = "$primary_hostname, ESMTP EXIM $version_number"
smtp_accept_max = 100
smtp_accept_max_per_connection = 25
smtp_connect_backlog = 30
smtp_accept_max_per_host = 20
split_spool_directory = true
remote_max_parallel = 15
message_size_limit = 10M
helo_allow_chars = _
smtp_enforce_sync = true
log_selector = \
+all_parents \
+connection_reject \
+incoming_interface \
+lost_incoming_connection \
+received_sender \
+received_recipients \
+smtp_confirmation \
+smtp_syntax_error \
+smtp_protocol_error \
-queue_run
#log_file_path = syslog
#syslog_timestamp = yes
syslog_timestamp = no
begin acl
acl_check_rcpt:
# accept hosts = localhost:127.0.0.1
accept hosts = :
deny message = "incorrect symbol in address"
domains = +local_domains
local_parts = ^[.] : ^.*[@%!/|]
deny message = "incorrect symbol in address"
domains = !+local_domains
local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
# accept local_parts = postmaster
# domains = +local_domains
deny message = "HELO/EHLO require by SMTP RFC"
condition = ${if eq{$sender_helo_name}{}{yes}{no}}
accept authenticated = *
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}}
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!"
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 = "your hostname is bad (adsl, poll, ppp & etc)."
condition = ${if match{$sender_host_name} \
{adsl|dialup|pool|peer|dhcp} \
{yes}{no}}
# deny message = "you in blacklist - $dnslist_domain \n $dnslist_text"
# dnslists = opm.blitzed.org : \
# cbl.abuseat.org : \
# bl.csma.biz : \
# dynablock.njabl.org
warn
set acl_m0 = 20s
warn
hosts = +relay_from_hosts:192.168.1.0/24
set acl_m0 = 0s
warn
logwrite = Delay $acl_m0 for $sender_host_name \
[$sender_host_address] with HELO=$sender_helo_name. Mail \
from $sender_address to $local_part@$domain.
delay = $acl_m0
accept domains = +local_domains
endpass
message = "In my mailserver not stored this user"
verify = recipient
accept domains = +relay_to_domains
endpass
message = "main server not know how relay to this address"
verify = recipient
accept hosts = +relay_from_hosts
deny message = "Homo hominus lupus est"
acl_check_data:
deny malware = *
message = "In e-mail found VIRUS - $malware_name"
accept
begin routers
spam_yandex_route:
driver = manualroute
transport = spamoborona
domains = +local_domains
## no_verify
condition = ${if eq {$interface_port}{25}{yes}{no}}
#condition=${if !eq {$received_protocol}{local}}"
## address_test = false
route_data = localhost
self = send
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 `goto` FROM `alias` WHERE \
`address`='${quote_mysql:$local_part@$domain}' OR \
`address`='${quote_mysql:@$domain}'}}
dovecot_user:
driver = accept
condition = ${lookup mysql{SELECT `goto` FROM \
`alias` WHERE\
`address`='${quote_mysql:$local_part@$domain}' OR \
`address`='${quote_mysql:@$domain}'}{yes}{no}}new/
transport = dovecot_delivery
begin transports
remote_smtp:
driver = smtp
spamoborona:
driver = smtp
allow_localhost = true
port = 1125
dovecot_delivery:
driver = pipe
command = /usr/local/libexec/dovecot/deliver -d $local_part@$domain
message_prefix =
message_suffix =
delivery_date_add
envelope_to_add
return_path_add
log_output
user = mailnull
address_pipe:
driver = pipe
return_output
address_reply:
driver = autoreply
begin retry
# Address or Domain Error Retries
# ----------------- ----- -------
* * F,2h,15m; G,16h,1h,1.5; F,4d,6h
begin rewrite
begin authenticators
auth_plain:
driver = plaintext
public_name = PLAIN
server_condition = ${lookup mysql{SELECT `username` FROM \
`mailbox` WHERE `username` = \
'${quote_mysql:$auth2}' AND `password` = \
'${quote_mysql:$auth3}'}{yes}{no}}
server_prompts = :
server_set_id = $auth2
auth_login:
driver = plaintext
public_name = LOGIN
server_condition = ${lookup mysql{SELECT `username` FROM \
`mailbox` WHERE `username` = \
'${quote_mysql:$auth1}' AND `password` = \
'${quote_mysql:$auth2}'}{yes}{no}}
server_prompts = Username:: : Password::
server_set_id = $auth1
auth_cram_md5:
driver = cram_md5
public_name = CRAM-MD5
server_secret = ${lookup mysql{SELECT `password` FROM \
`mailbox` WHERE `username` \
= '${quote_mysql:$auth1}'}{$value}fail}
server_set_id = $auth2
Например:
Код: Выделить всё
0m 4.9K 1LuNKC-000BbD-3f <> *** frozen ***
faca@westtelecom.ru
Код: Выделить всё
cat /var/log/maillog | grep faca@westtelecom.ru
Apr 16 12:51:38 mail exim[44568]: Delay 20s for [123.23.83.234] with HELO=[123.23.83.234]. Mail from faca@westtelecom.ru to sveta@tiptop-ad.ru.
Apr 16 12:51:59 mail exim[44568]: 1LuNKA-000Baq-S6 <= faca@westtelecom.ru H=([123.23.83.234]) [123.23.83.234] I=[192.168.1.102]:25 P=esmtp S=3794 id=0911819100.64627782730648@westtelecom.ru from <faca@westtelecom.ru> for sveta@tiptop-ad.ru
Apr 16 12:51:59 mail exim[44586]: Delay 0s for [127.0.0.1] with HELO=mail.tiptop-ad.ru. Mail from faca@westtelecom.ru to sveta@tiptop-ad.ru.
Apr 16 12:52:00 mail exim[44586]: 1LuNKB-000Bb8-Uf <= faca@westtelecom.ru H=(mail.tiptop-ad.ru) [127.0.0.1] I=[127.0.0.1]:1025 P=esmtp S=4216 id=0911819100.64627782730648@westtelecom.ru from <faca@westtelecom.ru> for sveta@tiptop-ad.ru
Apr 16 12:52:00 mail sp-proxy-agent[48292]: For message from 127.0.0.1 will return ACCEPT, SKIP mailfrom: faca@westtelecom.ru, rcpto: sveta@tiptop-ad.ru
Apr 16 12:52:00 mail exim[44591]: 1LuNKC-000BbD-3f <= <> R=1LuNKB-000Bb8-Uf U=mailnull P=local S=5041 from <> for faca@westtelecom.ru
Apr 16 12:52:00 mail exim[44592]: 1LuNKC-000BbD-3f ** faca@westtelecom.ru R=dnslookup T=remote_smtp: SMTP error from remote mail server after RCPT TO:<faca@westtelecom.ru>: host mxs.majordomo.ru [78.108.81.249]: 550 No thank you rejected: Account Unavailable: Possible Forgery