В EXIM не отправляются письма локальным юзерам

EXIM, sendmail, postfix, Dovecot и прочие. Решение проблем связанных с работой электронной почты

Модератор: xM

Правила форума
Убедительная просьба юзать теги [code] при оформлении листингов.
Сообщения не оформленные должным образом имеют все шансы быть незамеченными.
Tottoro
рядовой
Сообщения: 14
Зарегистрирован: 2010-06-15 10:48:52
Откуда: Воронеж
Контактная информация:

В EXIM не отправляются письма локальным юзерам

Непрочитанное сообщение Tottoro » 2010-08-03 9:55:25

Доброго всем времени суток!
Друзья, помогите решить проблему с EXIM'ом. Заключается она в следующем:
когда отправляю письмо в свой же домен, оно не отправляется:

Код: Выделить всё

# exim -d -bhc 127.0.0.1
Exim version 4.72 (FreeBSD 7.3) uid=0 gid=0 pid=33660 D=fbb95cfd
Berkeley DB: Sleepycat Software: Berkeley DB 4.0.14: (November 18, 2001)
Support for: crypteq iconv() use_setclassresources PAM Perl Expand_dlfunc OpenSSL Content_Scanning DKIM 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
OpenSSL compile-time version: OpenSSL 0.9.8e 23 Feb 2007
OpenSSL runtime version: OpenSSL 0.9.8e 23 Feb 2007
changed uid/gid: forcing real = effective
  uid=0 gid=0 pid=33660
  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 = 0000cefe 00233821
trusted user
admin user
changed uid/gid: privilege not needed
  uid=26 gid=6 pid=33660
  auxiliary group list: 6 6
originator: uid=0 gid=0 login=root name=Charlie Root
sender address = root@mydomain.ru
sender_fullhost = [127.0.0.1]
sender_rcvhost = [127.0.0.1]

**** SMTP testing session as if from host 127.0.0.1
**** but without any ident (RFC 1413) callback.
**** This is not for real!

host in hosts_connection_nolog? no (option unset)
LOG: smtp_connection MAIN
  SMTP connection from [127.0.0.1]
host in host_lookup? no (option unset)
set_process_info: 33660 handling incoming connection from [127.0.0.1]
host in host_reject_connection? no (option unset)
host in sender_unqualified_hosts? no (option unset)
host in recipient_unqualified_hosts? no (option unset)
host in helo_verify_hosts? no (option unset)
host in helo_try_verify_hosts? no (option unset)
host in helo_accept_junk_hosts? no (end of list)
SMTP>> 220 mail.mydomain.ru, ESMTP EXIM 4.72
220 mail.mydomain.ru, ESMTP EXIM 4.72
smtp_setup_msg entered
HELO mail.mydomain.ru
SMTP<< HELO mail.mydomain.ru
mail.mydomain.ru in helo_lookup_domains? yes (matched "@")
looking up host name for 127.0.0.1
DNS lookup of 1.0.0.127.in-addr.arpa (PTR) gave HOST_NOT_FOUND
returning DNS_NOMATCH
IP address lookup using gethostbyaddr()
IP address lookup yielded localhost
  alias ns.mydomain.ru
gethostbyname looked up these IP addresses:
  name=localhost address=127.0.0.1
checking addresses for localhost
  127.0.0.1 OK
gethostbyname looked up these IP addresses:
  name=localhost address=127.0.0.1
checking addresses for ns.mydomain.ru
  127.0.0.1 OK
sender_fullhost = localhost (mail.mydomain.ru) [127.0.0.1]
sender_rcvhost = localhost ([127.0.0.1] helo=mail.mydomain.ru)
set_process_info: 33660 handling incoming connection from localhost (mail.mydomain.ru) [127.0.0.1]
250 mail.mydomain.ru Hello localhost [127.0.0.1]
SMTP>> 250 mail.mydomain.ru Hello localhost [127.0.0.1]
mail from: root@mydomain.ru
SMTP<< mail from: root@mydomain.ru
SMTP>> 250 OK
250 OK
RCPT TO: test@mydomain.ru
SMTP<< RCPT TO: test@mydomain.ru
using ACL "acl_check_rcpt"
processing "accept"
check hosts = :
host in ":"? no (end of list)
accept: condition test failed
processing "deny"
check domains = +local_domains
mydomain.ru in "{lookup mysql{SELECT `domain` FROM `domain` WHERE `domain`='mydomain.ru' AND `active`='1'}}"? no (end of list)
mydomain.ru in "+local_domains"? no (end of list)
deny: condition test failed
processing "deny"
check domains = !+local_domains
mydomain.ru in "{lookup mysql{SELECT `domain` FROM `domain` WHERE `domain`='mydomain.ru' AND `active`='1'}}"? no (end of list)
mydomain.ru in "!+local_domains"? yes (end of list)
check local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
test in "^[./|] : ^.*[@%!] : ^.*/\.\./"? no (end of list)
deny: condition test failed
processing "deny"
check condition = ${if eq{$sender_helo_name}{}{yes}{no}}
                = no
deny: condition test failed
processing "accept"
check authenticated = *
accept: condition test failed
processing "deny"
check hosts = *:!+relay_from_hosts
host in "*:!+relay_from_hosts"? yes (matched "*")
check condition = ${if eq{$sender_helo_name}{$sender_host_address}{true}{false}}
                = false
deny: condition test failed
processing "deny"
check condition = ${if eq{$sender_helo_name}{$interface_address}{yes}{no}}
                = no
deny: condition test failed
processing "deny"
check condition = ${if match{$sender_helo_name}{\N^\d+$\N}{yes}{no}}
                = no
deny: condition test failed
processing "deny"
check condition = ${if match{$sender_host_name} {adsl|dialup|pool|peer|dhcp} {yes}{no}}
                = no
deny: condition test failed
processing "deny"
check dnslists = opm.blitzed.org : proxies.blackholes.easynet.nl : cbl.abuseat.org : bl.spamcop.net : bl.csma.biz : dynablock.njabl.org
DNS list check: opm.blitzed.org
new DNS lookup for 1.0.0.127.opm.blitzed.org
DNS lookup of 1.0.0.127.opm.blitzed.org (A) gave HOST_NOT_FOUND
returning DNS_NOMATCH
DNS lookup for 1.0.0.127.opm.blitzed.org failed
=> that means 127.0.0.1 is not listed at opm.blitzed.org
DNS list check: proxies.blackholes.easynet.nl
new DNS lookup for 1.0.0.127.proxies.blackholes.easynet.nl
DNS lookup of 1.0.0.127.proxies.blackholes.easynet.nl (A) gave HOST_NOT_FOUND
returning DNS_NOMATCH
DNS lookup for 1.0.0.127.proxies.blackholes.easynet.nl failed
=> that means 127.0.0.1 is not listed at proxies.blackholes.easynet.nl
DNS list check: cbl.abuseat.org
new DNS lookup for 1.0.0.127.cbl.abuseat.org
DNS lookup of 1.0.0.127.cbl.abuseat.org (A) gave HOST_NOT_FOUND
returning DNS_NOMATCH
DNS lookup for 1.0.0.127.cbl.abuseat.org failed
=> that means 127.0.0.1 is not listed at cbl.abuseat.org
DNS list check: bl.spamcop.net
new DNS lookup for 1.0.0.127.bl.spamcop.net
DNS lookup of 1.0.0.127.bl.spamcop.net (A) gave HOST_NOT_FOUND
returning DNS_NOMATCH
DNS lookup for 1.0.0.127.bl.spamcop.net failed
=> that means 127.0.0.1 is not listed at bl.spamcop.net
DNS list check: bl.csma.biz
new DNS lookup for 1.0.0.127.bl.csma.biz
DNS lookup of 1.0.0.127.bl.csma.biz (A) gave HOST_NOT_FOUND
returning DNS_NOMATCH
DNS lookup for 1.0.0.127.bl.csma.biz failed
=> that means 127.0.0.1 is not listed at bl.csma.biz
DNS list check: dynablock.njabl.org
new DNS lookup for 1.0.0.127.dynablock.njabl.org
DNS lookup of 1.0.0.127.dynablock.njabl.org (A) gave TRY_AGAIN
1.0.0.127.dynablock.njabl.org in dns_again_means_nonexist? no (option unset)
returning DNS_AGAIN
LOG: dnslist_defer MAIN
  DNS list lookup defer (probably timeout) for 1.0.0.127.dynablock.njabl.org: assumed not in list
deny: condition test failed
processing "warn"
check set acl_m0 = 20s
warn: condition test succeeded
processing "warn"
check hosts = +relay_from_hosts
gethostbyname looked up these IP addresses:
  name=localhost address=127.0.0.1
host in "localhost : 127.0.0.0/8 : 192.168.0.0/16"? yes (matched "localhost")
host in "+relay_from_hosts"? yes (matched "+relay_from_hosts")
check set acl_m0 = 0s
warn: condition test succeeded
processing "accept"
check domains = +local_domains
mydomain.ru in "{lookup mysql{SELECT `domain` FROM `domain` WHERE `domain`='mydomain.ru' AND `active`='1'}}"? no (end of list)
mydomain.ru in "+local_domains"? no (end of list)
accept: condition test failed
processing "accept"
check domains = +relay_to_domains
search_open: mysql "NULL"
search_find: file="NULL"
  key="SELECT `domain` FROM `domain` WHERE `domain`='mydomain.ru' AND `active`='1'" partial=-1 affix=NULL starflags=0
LRU list:
internal_search_find: file="NULL"
  type=mysql key="SELECT `domain` FROM `domain` WHERE `domain`='mydomain.ru' AND `active`='1'"
database lookup required for SELECT `domain` FROM `domain` WHERE `domain`='mydomain.ru' AND `active`='1'
MySQL query: SELECT `domain` FROM `domain` WHERE `domain`='mydomain.ru' AND `active`='1'
MYSQL new connection: host=localhost port=0 socket=NULL database=exim user=exim
lookup yielded: mydomain.ru
makcimir.ru in "mydomain.ru"? yes (matched "makcimir.ru")
makcimir.ru in "+relay_to_domains"? yes (matched "+relay_to_domains")
check verify = recipient
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Verifying test@mydomain.ru
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Considering test@mydomain.ru
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
routing test@mydomain.ru
--------> dnslookup router <--------
local_part=test domain=mydomain.ru
checking domains
mydomain.ru in "{lookup mysql{SELECT `domain` FROM `domain` WHERE `domain`='mydomain.ru' AND `active`='1'}}"? no (end of list)
mydomain.ru in "! +local_domains"? yes (end of list)
calling dnslookup router
dnslookup router called for test@mydomain.ru
  domain = mydomain.ru
DNS lookup of mydomain.ru (MX) succeeded
DNS lookup of mail.mydomain.ru (A) succeeded
AAA.BBB.CCC.DDD in "0.0.0.0 : 127.0.0.0/8"? no (end of list)
local host has lowest MX
fully qualified name = mydomain.ru
host_find_bydns yield = HOST_FOUND_LOCAL (3); returned hosts:
  mail.mydomain.ru AAA.BBB.CCC.DDD MX=10
LOG: MAIN
  lowest numbered MX record points to local host: mydomain.ru (while verifying <test@mydomain.ru> from host localhost (mail.mydomain.ru) [127.0.0.1])
dnslookup router: defer for test@mydomain.ru
  message: lowest numbered MX record points to local host
----------- end verify ------------
accept: condition test deferred
SMTP>> 451 Temporary local problem - please try later
451 Temporary local problem - please try later
LOG: MAIN REJECT
  H=localhost (mail.mydomain.ru) [127.0.0.1] F=<root@mydomain.ru> temporarily rejected RCPT test@mydomain.ru: lowest numbered MX record points to local host
Смущают конечно записи:

Код: Выделить всё

[b]mydomain.ru in "{lookup mysql{SELECT `domain` FROM `domain` WHERE `domain`='mydomain.ru' AND `active`='1'}}"? no (end of list)[/b]
хотя при всем при этом:

Код: Выделить всё

# mysql -u exim -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12957
Server version: 5.1.48 FreeBSD port: mysql-server-5.1.48

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use exim;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> SELECT `domain` FROM `domain` WHERE `domain`='mydomain.ru' AND `active`='1';
+-------------+
| domain      |
+-------------+
| mydomain.ru |
+-------------+
1 row in set (0.00 sec)
Что то сам я ни как не соображу в чем тупанул. Помогите пожалуйста разобраться.

Хостинговая компания Host-Food.ru
Хостинг HostFood.ru
 

Услуги хостинговой компании Host-Food.ru

Хостинг HostFood.ru

Тарифы на хостинг в России, от 12 рублей: https://www.host-food.ru/tariffs/hosting/
Тарифы на виртуальные сервера (VPS/VDS/KVM) в РФ, от 189 руб.: https://www.host-food.ru/tariffs/virtualny-server-vps/
Выделенные сервера, Россия, Москва, от 2000 рублей (HP Proliant G5, Intel Xeon E5430 (2.66GHz, Quad-Core, 12Mb), 8Gb RAM, 2x300Gb SAS HDD, P400i, 512Mb, BBU):
https://www.host-food.ru/tariffs/vydelennyi-server-ds/
Недорогие домены в популярных зонах: https://www.host-food.ru/domains/

Аватара пользователя
schizoid
подполковник
Сообщения: 3228
Зарегистрирован: 2007-03-03 17:32:31
Откуда: Украина, Чернигов
Контактная информация:

Re: В EXIM не отправляются письма локальным юзерам

Непрочитанное сообщение schizoid » 2010-08-03 10:10:24

проверьте строку

Код: Выделить всё

hostlist   relay_from_hosts
в конфиге.
ядерный взрыв...смертельно красиво...жаль, что не вечно...

Гость
проходил мимо

Re: В EXIM не отправляются письма локальным юзерам

Непрочитанное сообщение Гость » 2010-08-03 10:47:18

Вроде всё верно. Вот конфиг мой:

Код: Выделить всё

# $Cambridge: exim/exim-src/src/configure.default,v 1.14 2009/10/16 07:46:13 tom Exp $

primary_hostname = mail.mydomain.ru
hide mysql_servers = localhost/exim/exim/exim

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.0.0/16

acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_data

av_scanner = clamd:/var/run/clamav/clamd

#spamd_address = 127.0.0.1 783

qualify_domain = makcimir.ru
qualify_recipient = makcimir.ru

allow_domain_literals = false

exim_user = mailnull
exim_group = mail
never_users = root

rfc1413_query_timeout = 0s

ignore_bounce_errors_after = 45m

timeout_frozen_after = 3d

freeze_tell = root@mydomain.ru

helo_accept_junk_hosts = 192.168.0.0/16

auto_thaw = 1h

smtp_banner = "$primary_hostname, ESMTP EXIM $version_number"

smtp_accept_max = 50

smtp_accept_max_per_connection = 10

smtp_connect_backlog = 30

smtp_accept_max_per_host = 20

split_spool_directory = true

remote_max_parallel = 15

# Максимальный размер сообщения
message_size_limit = 24M

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

syslog_timestamp = no


begin acl
acl_check_rcpt:
  accept  hosts = :
#          control = dkim_disable_verify

  deny    message       = Недопустимые символы в адресе
          domains       = +local_domains
          local_parts   = ^[.] : ^.*[@%!/|]

  deny    message       = Недопустимые символы в адресе
          domains       = !+local_domains
          local_parts   = ^[./|] : ^.*[@%!] : ^.*/\\.\\./

  deny    message       = "HELO/EHLO обязано быть по SMTP RFC"
          condition     = ${if eq{$sender_helo_name}{}{yes}{no}}

  accept  authenticated = *

  deny    message       = "IP <> HELO!"
          hosts         =  *:!+relay_from_hosts
          condition     = ${if eq{$sender_helo_name}\
                          {$sender_host_address}{true}{false}}

  deny    condition     = ${if eq{$sender_helo_name}\
                          {$interface_address}{yes}{no}}
 message       = "Это мой IP-адрес"

  deny    condition     = ${if match{$sender_helo_name}\
                          {\N^\d+$\N}{yes}{no}}
          hosts         = !127.0.0.1:!localhost:*
          message       = "В HELO не могут быть только цифры!"

  deny    message       = "Не нравится мне Ваш хост..."
          condition     = ${if match{$sender_host_name} \
                               {adsl|dialup|pool|peer|dhcp} \
                               {yes}{no}}
 
  deny    message       = "host in blacklist - $dnslist_domain \n $dnslist_text"
          dnslists      = opm.blitzed.org : \
                          proxies.blackholes.easynet.nl : \
                          cbl.abuseat.org : \
                          bl.spamcop.net : \
                          bl.csma.biz : \
                          dynablock.njabl.org

  warn
        # ставим дефолтовую задержку в 20 секунд
        set acl_m0 = 20s
  warn
        # ставим задержку в 0 секунд своим хостам
        hosts = +relay_from_hosts
        set acl_m0 = 0s

  accept  domains       = +local_domains
          endpass
          message       = "В этом домене нет такого пользователя"
          verify        = recipient

  accept  domains       = +relay_to_domains
          endpass
          message       = "Моя сервера не знать маршрут на этот хост..."
          verify        = recipient


  accept  hosts         = +relay_from_hosts
#          control       = submission
#          control       = dkim_disable_verify

  deny    message       = "Свободен. Это тебе не ОпенРелей."

acl_check_data:

# Проверяем письмо на вирусы
  deny malware = *
  message = "In e-mail found VIRUS - $malware_name"

  accept


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

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}'}}

mysqluser:
  driver = accept
  condition = ${if eq{}{${lookup mysql{SELECT `maildir` FROM `mailbox` \
              WHERE `username`='${quote_mysql:$local_part@$domain}'}}}{no}{yes}}
  transport = mysql_delivery


begin transports
remote_smtp:
  driver = smtp

mysql_delivery:
    driver = appendfile
    check_string = ""
    create_directory
    delivery_date_add
    directory = ${lookup mysql{SELECT CONCAT('/var/mail/exim/', `maildir`) \
                FROM `mailbox` WHERE `username`='${local_part}@${domain}'}}
    directory_mode = 770
    envelope_to_add
    group = mail
    maildir_format
    maildir_tag = ,S=$message_size
    message_prefix = ""
    message_suffix = ""
    mode = 0600
address_file:
    driver = appendfile
    delivery_date_add
    envelope_to_add
    return_path_add

# Имя программы
address_pipe:
  driver = pipe
  return_output

# Транспорт для автоответов
address_reply:
  driver = autoreply
...
...
...
...

Аватара пользователя
schizoid
подполковник
Сообщения: 3228
Зарегистрирован: 2007-03-03 17:32:31
Откуда: Украина, Чернигов
Контактная информация:

Re: В EXIM не отправляются письма локальным юзерам

Непрочитанное сообщение schizoid » 2010-08-03 10:57:49

может ексим без поддержки Мускуля собрался?
ядерный взрыв...смертельно красиво...жаль, что не вечно...

Tottoro
рядовой
Сообщения: 14
Зарегистрирован: 2010-06-15 10:48:52
Откуда: Воронеж
Контактная информация:

Re: В EXIM не отправляются письма локальным юзерам

Непрочитанное сообщение Tottoro » 2010-08-03 11:12:29

Хм.. Вроде работает...

Код: Выделить всё

 H=localhost (makcimir.ru) [127.0.0.1] F=<root@makcimir.ru> temporarily rejected RCPT test@makcimir.ru: lowest numbered MX record points to local host
quit
SMTP<< quit
SMTP>> 221 mail.mydomain.ru closing connection
221 mail.mydomain.ru closing connection
LOG: smtp_connection MAIN
  SMTP connection from localhost (mydomain.ru) [127.0.0.1] closed by QUIT
search_tidyup called
close MYSQL connection: localhost/exim/exim
>>>>>>>>>>>>>>>> Exim pid=34334 terminating with rc=0 >>>>>>>>>>>>>>>>

Tottoro
рядовой
Сообщения: 14
Зарегистрирован: 2010-06-15 10:48:52
Откуда: Воронеж
Контактная информация:

Re: В EXIM не отправляются письма локальным юзерам

Непрочитанное сообщение Tottoro » 2010-08-03 18:04:27

Решил проблему заменив

Код: Выделить всё

domainlist local_domains = {lookup mysql{SELECT `domain` \
                            FROM `domain` WHERE \
                           `domain`='${domain}' AND \
                           `active`='1'}}
на

Код: Выделить всё

domainlist local_domains = mydomain.ru
Ну да не беда. Все равно больше 2х доменов не будет.
Завтра буду RoundCube мучать...