Назад | Перейти на главную страницу

Exim не может получать электронные письма, но отправляет их на Amazon EC2

У меня установлен Cenos 6 на инстансе Amazon EC2. Также я устанавливаю exim + dovecot для отправки и получения писем. У меня есть два домена и два сетевых интерфейса с подключенными эластичными IP-адресами. В примере внутренние IP-адреса:

172.31.108.135
172.31.110.53

и два домена:

domain1.com
domain2.com

Я настраиваю exim с помощью руководств и примеров (+ DKIM, PTR и т. Д.). И отправка работает нормально. Но я не могу получать электронные письма на свои почтовые ящики.

Мои файлы / etc / exim / folder:

псевдонимы пустой файл

черный список пустой файл

днсблисты пустой файл

domainips

domain1.com:172.31.108.135
domain2.com:172.31.110.53

домены

domain1.com:domain1.com::no
domain2.com:domain2.com::no

пароль

noreply@domain1.com:93:93:100:/var/mailboxes/domain1.com/noreply:no:
info@domain2.com:93:93:100:/var/mailboxes/domain2.com/info:no:

белый список пустой файл

псевдонимы каналов пустой файл

Основной конфиг: exim.conf

log_selector =  \
        +all_parents \
        +lost_incoming_connection \
        +received_sender \
        +received_recipients \
        +tls_cipher +tls_peerdn \
        +smtp_confirmation \
        +smtp_syntax_error \
        +smtp_protocol_error

trusted_users = apache

domainlist local_domains = lsearch;/etc/exim/domains
domainlist dummy_domains =
hostlist relay_from_hosts = 127.0.0.1

domainlist relay_to_domains = lsearch;/etc/exim/domains
exim_user = exim
exim_group = exim

never_users = root
host_lookup = *
rfc1413_hosts = *
rfc1413_query_timeout = 0s
ignore_bounce_errors_after = 2d
timeout_frozen_after = 7d
acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_data
tls_advertise_hosts = 
disable_ipv6 = true

begin acl
    acl_check_rcpt:
        accept  hosts = net-lsearch;/etc/exim/whitelist

        deny    hosts = net-lsearch;/etc/exim/blacklist
                message = $host_data                        

        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
                verify        = recipient
                domains       = +local_domains

        require verify        = sender

        accept  hosts         = +relay_from_hosts
                control       = submission

        accept  authenticated = *
                condition     = ${if eq{${extract{5}{:}{${lookup{$authenticated_id}lsearch{/etc/exim/passwd}}}}}{no} {yes}{no}}
                condition     = ${if eq{${extract{3}{:}{${lookup{${domain:$authenticated_id}}lsearch{/etc/exim/domains}}}}}{no} {yes}{no}}
                control       = submission/domain=

        deny    message       = rejected because $sender_host_address is in a black list at $dnslist_domain\\n$dnslist_text
                dnslists      = ${readfile {/etc/exim/dnsblists}{:}} 

        require message       = relay not permitted
                domains       = +local_domains : +relay_to_domains

        require verify        = recipient

        accept

    acl_check_data:
        accept

begin routers
    dnslookup:
        driver = dnslookup
        domains = !+dummy_domains
        transport = remote_smtp
        ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
        self = pass
        no_more

    disabled_domains:
        driver = redirect
        condition = ${extract{3}{:}{${lookup{$domain}lsearch{/etc/exim/domains}}}}
        allow_fail = yes
        data = :fail: Domain disabled
        no_more

    disabled_users:
        driver = redirect
        condition = ${extract{5}{:}{${lookup{$local_part@$domain}lsearch{/etc/exim/passwd}}}}
        allow_fail = yes
        data = :fail: User disabled
        no_more

    local_domains:
        driver = redirect
        data = ${quote_local_part:$local_part}@${extract{1}{:}{${lookup{$domain}lsearch{/etc/exim/domains}}}}
        cannot_route_message = Unknown user
        no_more

    group_aliases:
        driver = redirect
        data = ${extract{1}{:}{${lookup{$local_part@$domain}lsearch{/etc/exim/aliases}}}}
        condition = ${if and{\
                        {exists{/etc/exim/aliases}}\
                        {eq {${extract{2}{:}{${lookup{$local_part@$domain}lsearch{/etc/exim/aliases}}}}} {group} }\
                    } {yes} {no} }
        redirect_router = a_dnslookup

    aliases:
        driver = redirect
        data = ${extract{1}{:}{${lookup{$local_part@$domain}lsearch{/etc/exim/aliases}}}}
        condition = ${if exists{/etc/exim/aliases} {yes} {no} }

    aliases_pipe:
                driver = redirect
        pipe_transport = address_pipe
        data = ${lookup {$local_part@$domain} lsearch{/etc/exim/pipe-aliases}}
                condition =${lookup {$local_part@$domain} lsearch{/etc/exim/pipe-aliases} {yes} {no} }


    local_users:
        driver = redirect
        condition = ${lookup {$local_part@$domain} lsearch {/etc/exim/passwd} {yes} {no} }
        data = $local_part@$domain
        redirect_router = autoreplay

    catchall_for_domains:
        driver = redirect
        headers_add = X-redirected: yes
        data = ${extract{2}{:}{${lookup{$domain}lsearch{/etc/exim/domains}}}}
        file_transport = local_delivery

    unknown_users:
        driver = redirect
        allow_fail = yes
        data = :fail: Unknown user
        no_more

    autoreplay:
        driver = accept
        condition = ${if exists{${extract{4}{:}{${lookup{$local_part@$domain}lsearch{/etc/exim/passwd}}}}/message.txt} {yes} {no}}
        retry_use_local_part
        transport = address_reply
        unseen

    localuser:
        driver = accept
        transport = local_delivery


# Same routers without autoreplay

    a_dnslookup:
        driver = dnslookup
        domains = !+dummy_domains
        transport = remote_smtp
        ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
        self = pass
        no_more

    a_disabled_domains:
        driver = redirect
        condition = ${extract{3}{:}{${lookup{$domain}lsearch{/etc/exim/domains}}}}
        allow_fail = yes
        data = :fail: Domain disabled
        no_more

    a_disabled_users:
        driver = redirect
        condition = ${extract{5}{:}{${lookup{$local_part@$domain}lsearch{/etc/exim/passwd}}}}
        allow_fail = yes
        data = :fail: User disabled
        no_more

    a_local_domains:
        driver = redirect
        data = ${quote_local_part:$local_part}@${extract{1}{:}{${lookup{$domain}lsearch{/etc/exim/domains}}}}
        cannot_route_message = Unknown user
        redirect_router = a_dnslookup
        no_more

    a_aliases:
        driver = redirect
        data = ${extract{1}{:}{${lookup{$local_part@$domain}lsearch{/etc/exim/aliases}}}}
        condition = ${if exists{/etc/exim/aliases} {yes} {no} }
        redirect_router = a_dnslookup

    a_aliases_pipe:
        driver = accept
        transport = aliases_pipe
        condition = ${lookup {$local_part@$domain} lsearch {/etc/exim/pipe-aliases} {yes} {no} }

    a_local_users:
        driver = accept
        transport = local_delivery
        condition = ${lookup {$local_part@$domain} lsearch {/etc/exim/passwd} {yes} {no} }

    a_catchall_for_domains:
        driver = redirect
        headers_add = X-redirected: yes
        data = ${extract{2}{:}{${lookup{$domain}lsearch{/etc/exim/domains}}}}
        file_transport = local_delivery
        redirect_router = a_dnslookup

begin transports

    DKIM_DOMAIN = ${lc:${domain:$h_from:}}
    DKIM_FILE = /etc/exim/${lc:${domain:$h_from:}}.key
    DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}}

    remote_smtp:
        driver = smtp
        dkim_domain = DKIM_DOMAIN
        dkim_selector = mail
        dkim_private_key = DKIM_PRIVATE_KEY
        interface = ${extract{1}{:}{${lookup{$sender_address_domain}lsearch{/etc/exim/domainips}}}}
        helo_data = $sender_address_domain

    local_delivery:
        driver = appendfile
        file = ${extract{4}{:}{${lookup{$local_part@$domain}lsearch{/etc/exim/passwd}}}}/inbox
        delivery_date_add
        envelope_to_add
        return_path_add
        mode = 0660
        quota = ${extract{3}{:}{${lookup{$local_part@$domain}lsearch{/etc/exim/passwd}}}}M
        quota_warn_threshold = 75%
        use_lockfile = no
        no_mode_fail_narrower
        user = ${extract{1}{:}{${lookup{$local_part@$domain}lsearch{/etc/exim/passwd}}}}
        group = ${extract{2}{:}{${lookup{$local_part@$domain}lsearch{/etc/exim/passwd}}}}

    address_pipe:
        driver = pipe
        return_output

    aliases_pipe:
        driver = pipe
        command = ${extract{1}{:}{${lookup{$local_part@$domain}lsearch{/etc/exim/pipe-aliases}}}}
        use_shell

    address_reply:
        driver = autoreply
        headers = ${readfile{${extract{4}{:}{${lookup{$local_part@$domain}lsearch{/etc/exim/passwd}}}}/message.txt}}
        to = $sender_address

begin retry
*       *       F,2h,15m; G,16h,1h,1.5; F,4d,6h

begin rewrite

begin authenticators

login:
    driver = dovecot
    public_name = LOGIN
    server_socket = /var/run/dovecot/auth-client
    server_set_id = $1

plain:
    driver = dovecot
    public_name = PLAIN
    server_socket = /var/run/dovecot/auth-client
    server_set_id = $1

Отправка работает нормально. Но если я отправляю почту на любой почтовый ящик, я получаю эту ошибку в журналах: (много строк) test@test.com это тестовый почтовый ящик

2018-01-10 19:25:20 1eZM00-0007qZ-FJ DKIM: d=test.com s=mail2 c=relaxed/relaxed a=rsa-sha256 b=1024 [verification succeeded]
2018-01-10 19:25:20 1eZM00-0007qZ-FJ <= test@test.com H=smtp32.i.test.com [94.100.177.92] P=esmtp S=1801 id=b7000510-ce7f-f0e9-c368-825c48d31ebb@test.com from <test@test.com> for noreply@domain1.com
2018-01-10 19:25:21 1eZM01-0007qc-9j DKIM: d=test.com s=mail2 c=relaxed/relaxed a=rsa-sha256 b=1024 [verification succeeded]
2018-01-10 19:25:21 1eZM01-0007qc-9j <= test@test.com H=mail.domain1.com (test.com) [52.88.16.47] P=esmtp K S=2045 id=b7000510-ce7f-f0e9-c368-825c48d31ebb@test.com from <test@test.com> for noreply@domain1.com
2018-01-10 19:25:21 1eZM00-0007qZ-FJ => noreply@domain1.com R=dnslookup T=remote_smtp H=domain1.com [52.88.16.47] K C="250- 1831 byte chunk, total 1831\\n250 OK id=1eZM01-0007qc-9j"
2018-01-10 19:25:21 1eZM00-0007qZ-FJ Completed

И почтовый ящик пуст.

Помогите пожалуйста решить эту проблему. Если вам понадобятся дополнительные журналы, сообщите мне.

Я не эксперт по Exim, но ваш транспорт local_delivery извлекает 4-е поле из файла паролей, и похоже, что имя файла - это 5-е поле.