Код: Выделить всё
router2# telnet localhost 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mail.router2.tld ESMTP Exim 4.69 Mon, 07 Sep 2009 11:18:15 +0000
ehlo domain.ru
250-mail.router2.tld Hello domain.ru [10.0.3.132]
250-SIZE 52428800
250-PIPELINING
250-AUTH PLAIN LOGIN CRAM-MD5
250 HELP
mail from:user@domain.ru
250 OK
rctp to:admin@router2.tld
500 unrecognized command
tcpt to:admin@router2.tld
500 unrecognized command
rcpt to:admin@router2.tld
550-Verification failed for <user@domain.ru>
550-Unrouteable address
550 Sender verify failed
Код: Выделить всё
Sep 7 10:39:12 router2 exim[68336]: [68336] cwd=/usr/local/etc 3 args: send-mail -i user@domain.ru
Sep 7 10:39:12 router2 exim[68336]: [68336] 1Mkbcu-000HmC-Sw <= root@router2.tld U=root P=local S=355 T="test" from <root@router2.tld> for user@domain.ru
Sep 7 10:39:12 router2 exim[68337]: [68337] cwd=/var/spool/exim 3 args: /usr/local/sbin/exim -Mc 1Mkbcu-000HmC-Sw
Sep 7 10:39:12 router2 exim[68337]: [68337] 1Mkbcu-000HmC-Sw ** user@domain.ru F=<root@router2.tld>: Unrouteable address
Sep 7 10:39:12 router2 exim[68338]: [68338] cwd=/var/spool/exim 7 args: /usr/local/sbin/exim -t -oem -oi -f <> -E1Mkbcu-000HmC-Sw
Sep 7 10:39:12 router2 exim[68338]: [68338] 1Mkbcu-000HmE-V9 <= <> R=1Mkbcu-000HmC-Sw U=mailnull P=local S=1159 T="Mail delivery failed: returning message to sender" from <> for root@router2.tld
Код: Выделить всё
router2# exim -d+route -bt user@domain.ru
Exim version 4.69 (FreeBSD 7.2) uid=0 gid=0 pid=69203 D=fbb95cfd
Probably Berkeley DB version 1.8x (native mode)
Support for: crypteq iconv() IPv6 use_setclassresources PAM Perl Expand_dlfunc OpenSSL Content_Scanning Old_Demime
Lookups: lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmnz dnsdb dsearch mysql nis nis0 passwd
Authenticators: cram_md5 dovecot plaintext spa
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore/mbx autoreply lmtp pipe smtp
Fixed never_users: 0
Size of off_t: 8
changed uid/gid: forcing real = effective
uid=0 gid=0 pid=69203
auxiliary group list: 0
seeking password data for user "mailnull": using cached result
getpwnam() succeeded uid=26 gid=26
seeking password data for user "root": cache not available
getpwnam() succeeded uid=0 gid=0
configuration file is /usr/local/etc/exim/configure
log selectors = ffffffff 7fffffff
trusted user
admin user
seeking password data for user "mailnull": cache not available
getpwnam() succeeded uid=26 gid=26
seeking password data for user "mailnull": using cached result
getpwnam() succeeded uid=26 gid=26
originator: uid=0 gid=0 login=root name=Charlie Root
sender address = root@mail.router2.tld
Address testing: uid=0 gid=6 euid=0 egid=6
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Testing user@domain.ru
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Considering user@domain.ru
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
routing user@domain.ru
--------> dnslookup router <--------
local_part=user domain=domain.ru
checking domains
search_open: mysql "NULL"
search_find: file="NULL"
key="SELECT `domain` FROM `transport` WHERE `domain`='domain.ru' " partial=-1 affix=NULL starflags=0
LRU list:
internal_search_find: file="NULL"
type=mysql key="SELECT `domain` FROM `transport` WHERE `domain`='domain.ru' "
database lookup required for SELECT `domain` FROM `transport` WHERE `domain`='domain.ru'
MySQL query: SELECT `domain` FROM `transport` WHERE `domain`='domain.ru'
MYSQL new connection: host=localhost port=0 socket=NULL database=maildb user=dovecot
lookup yielded: domain.ru
domain.ru in "domain.ru"? yes (matched "domain.ru")
domain.ru in "! +local_domains"? no (matched "! +local_domains")
dnslookup router skipped: domains mismatch
--------> system_aliases router <--------
local_part=user domain=domain.ru
calling system_aliases router
rda_interpret (string): ${lookup{$local_part}lsearch{/etc/aliases}}
search_open: lsearch "/etc/aliases"
search_find: file="/etc/aliases"
key="user" partial=-1 affix=NULL starflags=0
LRU list:
;/etc/aliases
End
internal_search_find: file="/etc/aliases"
type=lsearch key="user"
file lookup required for user
in /etc/aliases
lookup failed
expanded:
file is not a filter file
parse_forward_list:
system_aliases router declined for user@domain.ru
--------> userforward router <--------
local_part=user domain=domain.ru
checking for local user
seeking password data for user "user": cache not available
getpwnam() returned NULL (user not found)
userforward router skipped: user is not a local user
--------> dovecot_user router <--------
local_part=user domain=domain.ru
checking "condition"
search_open: mysql "NULL"
cached open
search_find: file="NULL"
key="SELECT `destination` FROM `virtual` WHERE `address`='user@domain.ru' OR `address`='@domain.ru'" partial=-1 affix=NULL starflags=0
LRU list:
;/etc/aliases
End
internal_search_find: file="NULL"
type=mysql key="SELECT `destination` FROM `virtual` WHERE `address`='user@domain.ru' OR `address`='@domain.ru'"
database lookup required for SELECT `destination` FROM `virtual` WHERE `address`='user@domain.ru' OR `address`='@domain.ru'
MySQL query: SELECT `destination` FROM `virtual` WHERE `address`='user@domain.ru' OR `address`='@domain.ru'
MYSQL using cached connection for localhost/maildb/dovecot
MYSQL: no data found
lookup failed
dovecot_user router skipped: condition failure
no more routers
user@domain.ru is undeliverable: Unrouteable address
search_tidyup called
close MYSQL connection: localhost/maildb/dovecot
>>>>>>>>>>>>>>>> Exim pid=69203 terminating with rc=2 >>>>>>>>>>>>>>>>
Код: Выделить всё
primary_hostname = mail.router2.tld
hide mysql_servers = localhost/maildb/dovecot/dovecot
domainlist local_domains = ${lookup mysql{SELECT `domain` \
FROM `transport` WHERE \
`domain`='${domain}' }}
domainlist relay_to_domains = ${lookup mysql{SELECT `domain` \
FROM `domain` WHERE \
`domain`='${domain}' }}
hostlist relay_from_hosts = localhost:127.0.0.0/8:192.168.0.0/16
acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_data
daemon_smtp_ports = 25
qualify_domain = mail.router2.tld
qualify_recipient = mail.router2.tld
exim_user = mailnull
exim_group = mail
never_users = root
rfc1413_query_timeout = 5s
sender_unqualified_hosts = +relay_from_hosts
recipient_unqualified_hosts = +relay_from_hosts
host_lookup = *
ignore_bounce_errors_after = 2d
timeout_frozen_after = 7d
log_selector = +all \
syslog_timestamp = no
begin acl
acl_check_rcpt:
accept 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_domain
require verify = sender
accept hosts = +local_domains : +relay_from_hosts
control = submission
accept authenticated = *
control = submission
require message = relay not permitted
domains = +local_domains : +relay_to_domain
require verify = recipient
accept
acl_check_data:
accept
begin routers
dnslookup:
driver = dnslookup
domains = ! +local_domains
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 10.0.3.132/32
no_more
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
file = $home/.forward
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} }
dovecot_user:
driver = accept
condition = ${lookup mysql{SELECT `destination` FROM \
`virtual` WHERE \
`address`='${quote_mysql:$local_part@$domain}' OR \
`address`='${quote_mysql:@$domain}'}{yes}{no}}
transport = dovecot_delivery
begin transports
remote_smtp:
driver = smtp
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_file:
driver = appendfile
delivery_date_add
envelope_to_add
return_path_add
address_reply:
driver = autoreply
begin retry
* * F,2h,15m; G,16h,1h,1.5; F,4d,6h
begin rewrite
begin authenticators
auth_plain:
driver = dovecot
public_name = PLAIN
server_socket = /var/run/dovecot/auth-client
server_set_id = $auth1
auth_login:
driver = dovecot
public_name = LOGIN
server_socket = /var/run/dovecot/auth-client
server_set_id = $auth1
auth_cram_md5:
driver = dovecot
public_name = CRAM-MD5
server_socket = /var/run/dovecot/auth-client
server_set_id = $auth1
Код: Выделить всё
router2# mysql maildb -e "select * from transport;"
+----+------------------+-------------+
| id | domain | destination |
+----+------------------+-------------+
| 1 | router2.tld | virtual: |
| 2 | mail.router2.tld | local: |
| 3 | domain.ru | virtual: |
+----+------------------+-------------+
router2#
Где накосячил, а то уже 3-ий день бьюсь, не могу понять в чём проблема.