使用 postfix + dovecot 无法连接 MUA 和接收邮件

发布于 2022-09-06 09:09:39 字数 5915 浏览 24 评论 0

我在我的 vps 上安装了 postfix 和 dovecot,
配置方法参照此文:https://www.jianshu.com/p/610...
当我用我的 gmail 发送邮件以及使用邮件客户端连接的时候 postfix 显示以下日志:

    Dec 23 04:22:55 mail postfix/smtpd[21018]: connect from mail-it0-f50.google.com[209.85.214.50]
    Dec 23 04:22:56 mail postfix/smtpd[21018]: 115283F3C0: client=mail-it0-f50.google.com[209.85.214.50]
    Dec 23 04:22:56 mail postfix/cleanup[21028]: 115283F3C0: message-id=<CACRj=7md8ZVR54Y3b4OgmYTtHLd6wAHejexZPY_=+UjSDKui6A@mail.gmail.com>
    Dec 23 04:22:56 mail postfix/qmgr[14528]: 115283F3C0: from=<mygmail@gmail.com>, size=2554, nrcpt=1 (queue active)
    Dec 23 04:22:56 mail postfix/smtpd[21018]: disconnect from mail-it0-f50.google.com[209.85.214.50]
    Dec 23 04:22:56 mail postfix/pipe[21031]: 115283F3C0: to=<i@myhost.com>, relay=dovecot, delay=0.15, delays=0.1/0.01/0/0.04, dsn=5.1.1, status=bounced (user unknown)
    Dec 23 04:22:56 mail postfix/cleanup[21028]: 32EF83F5C7: message-id=<20171223042256.32EF83F5C7@mail.myhost.com>
    Dec 23 04:22:56 mail postfix/qmgr[14528]: 32EF83F5C7: from=<>, size=4295, nrcpt=1 (queue active)
    Dec 23 04:22:56 mail postfix/bounce[21034]: 115283F3C0: sender non-delivery notification: 32EF83F5C7
    Dec 23 04:22:56 mail postfix/qmgr[14528]: 115283F3C0: removed
    Dec 23 04:23:26 mail postfix/smtp[21035]: connect to gmail-smtp-in.l.google.com[173.194.206.26]:25: Connection timed out
    Dec 23 04:23:26 mail postfix/smtp[21035]: connect to gmail-smtp-in.l.google.com[2607:f8b0:400d:c08::1b]:25: Network is unreachable
    Dec 23 04:23:26 mail postfix/smtp[21035]: connect to alt1.gmail-smtp-in.l.google.com[2800:3f0:4003:c00::1b]:25: Network is unreachable
    Dec 23 04:23:56 mail postfix/smtp[21035]: connect to alt1.gmail-smtp-in.l.google.com[64.233.186.26]:25: Connection timed out
    Dec 23 04:23:56 mail postfix/smtp[21035]: connect to alt2.gmail-smtp-in.l.google.com[2a00:1450:400b:c00::1b]:25: Network is unreachable
    Dec 23 04:23:56 mail postfix/smtp[21035]: 32EF83F5C7: to=<mygmail@gmail.com>, relay=none, delay=60, delays=0/0.01/60/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[2a00:1450:400b:c00::1b]:25: Network is unreachable)
    Dec 23 04:26:16 mail postfix/anvil[21020]: statistics: max connection rate 1/60s for (smtp:209.85.214.50) at Dec 23 04:22:55
    Dec 23 04:26:16 mail postfix/anvil[21020]: statistics: max connection count 1 for (smtp:209.85.214.50) at Dec 23 04:22:55
    Dec 23 04:26:16 mail postfix/anvil[21020]: statistics: max cache size 1 at Dec 23 04:22:55
    Dec 23 04:26:33 mail postfix/smtpd[21045]: connect from unknown[117.181.50.20]
    Dec 23 04:26:43 mail postfix/smtpd[21045]: warning: unknown[117.181.50.20]: SASL PLAIN authentication failed:
    Dec 23 04:26:51 mail postfix/smtpd[21045]: warning: unknown[117.181.50.20]: SASL PLAIN authentication failed:
    Dec 23 04:27:00 mail postfix/smtpd[21045]: warning: unknown[117.181.50.20]: SASL PLAIN authentication failed:
    Dec 23 04:27:08 mail postfix/smtpd[21045]: warning: unknown[117.181.50.20]: SASL PLAIN authentication failed:
    Dec 23 04:27:08 mail postfix/smtpd[21045]: disconnect from unknown[117.181.50.20]
    Dec 23 04:27:09 mail dovecot: imap-login: Aborted login (auth failed, 6 attempts in 40 secs): user=<i>, method=PLAIN, rip=117.181.50.20, lip=45.77.77.104, TLS, session=<yB1OVvpgOAB1tTIU>

main.cf 文件:


    myhostname = mail.myhost.com
    mynetworks = 127.0.0.0/8
    message_size_limit = 30720000
    virtual_alias_domains =
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_mailbox_base = /home/vmail
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    smtpd_sasl_type = dovecot
    smtpd_sasl_path = private/auth
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    smtpd_use_tls = yes
    smtpd_tls_cert_file = /root/key/mail.myhost.com.crt
    smtpd_tls_key_file = /root/key/mail.myhost.com.key
    virtual_create_maildirsize = yes
    virtual_maildir_extended = yes
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
    virtual_transport = dovecot
    dovecot_destination_recipient_limit = 1

dovecot.conf 文件:

    protocols = imap pop3
    log_timestamp = "%Y-%m-%d %H:%M:%S "
    mail_home = /var/vmail/%d/%n
    mail_location = maildir:~/Maildir
    
    ssl_cert = </root/key/mail.myhost.com.crt
    ssl_key = </root/key/mail.myhost.com.key
    
    namespace {
        type = private
        separator = .
        prefix = INBOX.
        inbox = yes
    }
    
    service auth {
        unix_listener auth-master {
            mode = 0600
            user = vmail
        }
    
        unix_listener /var/spool/postfix/private/auth {
            mode = 0666
            user = postfix
            group = postfix
        }
    
        user = root
    }
    auth_mechanisms = plain login
    
    service auth-worker {
        user = root
    }
    
    protocol lda {
        log_path = /home/vmail/dovecot-deliver.log
        auth_socket_path = /var/run/dovecot/auth-master
        postmaster_address = postmaster@myhost.com
    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

世界如花海般美丽 2022-09-13 09:09:39

你连不上Google的SMTP服务器

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文