AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[opensmtpd](server)

Martin Hope
user227963
Asked: 2021-11-16 09:16:55 +0800 CST

将 dkimproxy 添加到 OpenSMTPD ... 发送到我自己的域时的邮件循环

  • 1

我有一个运行良好的 OpenSMTPD 配置,并在其中添加了 dkimproxy。

一切运行良好,邮件测试器等都报告说我有正确的 DKIM 签名,我的电子邮件分数是 10/10 等。

问题是 ...

如果我尝试从 [email protected] 向 [email protected] 发送电子邮件,则邮件服务器进入循环并且邮件永远不会发送。我看到这个maillog:

Nov 15 08:34:13 mail dkimproxy.out[38686]: DKIM signing - signed; message-id=<[email protected]>, signer=<[email protected]>, from=<[email protected]>
Nov 15 08:34:13 mail smtpd[33463]: 4dea90938ef29e98 smtp message msgid=0b62ff80 size=104666 nrcpt=1 proto=ESMTP
Nov 15 08:34:13 mail smtpd[33463]: 4dea90938ef29e98 smtp envelope evpid=0b62ff80eb408785 from=<> to=<[email protected]>                                                               
Nov 15 08:34:13 mail smtpd[33463]: 4dea9092f4274d88 mta delivery evpid=6fe8c750a74f16ac from=<> to=<[email protected]> rcpt=<-> source="200.100.240.135" relay="200.100.240.135 (mail.mydomain.com)" delay=1s result="Ok" stat="250 2.0.0 0b62ff80 Message accepted for delivery"

...并且它可能会一遍又一遍地循环 50 次 - 最终它放弃了这个错误:

Nov 15 08:34:18 mail smtpd[33463]: warn: loop detected                                                                                                                                            
Nov 15 08:34:18 mail smtpd[33463]: 4dea9097226c93aa smtp failed-command command="DATA" result="500 5.4.6 Routing loop detected: Loop detected"                                                    
Nov 15 08:34:18 mail smtpd[33463]: 4dea90969c6cf495 mta delivery evpid=49514d020281ac48 from=<> to=<[email protected]> rcpt=<-> source="200.100.240.135" relay="200.100.240.135 (mail.mydomain.com)" delay=1s result="PermFail" stat="500 5.4.6 Routing loop detected: Loop detected"

我不知道问题是什么。仅当我向自己或在此邮件服务器上托管的具有此域的其他用户发送电子邮件时,才会发生这种情况。

# cat dkimproxy_in.conf

# specify what address/port DKIMproxy should listen on
listen    200.100.240.135:10025

# specify what address/port DKIMproxy forwards mail to
relay     200.100.240.135:10026


# cat dkimproxy_out.conf 

# specify what address/port DKIMproxy should listen on
listen    200.100.240.135:10027

# specify what address/port DKIMproxy forwards mail to
relay     200.100.240.135:10028

# specify what domains DKIMproxy can sign for (comma-separated, no spaces)
domain    mydomain.com

# specify what signatures to add
signature dkim(c=relaxed)
signature domainkeys(c=nofws)

# specify location of the private key
keyfile   /root/dkim.private.key

# specify the selector (i.e. the name of the key record put in DNS)
selector  selector1

# control how many processes DKIMproxy uses
#  - more information on these options (and others) can be found by
#    running `perldoc Net::Server::PreFork'.
#min_servers 5
#min_spare_servers 2

......这就是一切......谢谢。

编辑 - 这是 opensmtpd.conf:

table aliases file:/usr/local/etc/mail/aliases

filter check_dyndns phase connect match rdns regex \
    { '.*\.dyn\..*', '.*\.dsl\..*' } \
    disconnect "550 no residential connections"

filter check_rdns phase connect match !rdns \
    disconnect "550 no rDNS"

filter check_fcrdns phase connect match !fcrdns \
    disconnect "550 no FCrDNS"

listen on 200.100.240.135 filter { check_dyndns, check_rdns, check_fcrdns }

listen on 200.100.240.135 port 10028 tag DKIM

listen on 200.100.240.135 port submission

action "local_mail" mbox alias <aliases>
action "relay_dkim" relay host smtp://200.100.240.135:10027
action "outbound" relay helo mail.mydomain.com
    
match from any mail-from "[email protected]" action "local_mail"

match tag DKIM for any action "outbound"
match for any action "relay_dkim"

match from any for domain "mydomain.com" action "local_mail"
match for local action "local_mail"

match from any auth for any action "outbound"
match for any action "outbound"
email freebsd email-server dkim opensmtpd
  • 1 个回答
  • 287 Views
Martin Hope
azmeuk
Asked: 2020-07-17 06:29:12 +0800 CST

使用 OpenSMTPD 的 LDAP+SSL 配置

  • 1

根据这篇博文,我有一个使用 OpenSMTPD 6.6.4(托管在 debian 10 上)的工作设置,该设置插入到 OpenLDAP 2.4.50 服务器(托管在 Alpine 3.8 上)上。它适用于普通 LDAP 连接,但适用于 LDAPS。

/etc/smtpd.conf

pki mail.mydomain.tld cert "/path/to/fullchain.pem"
pki mail.mydomain.tld key "/path/to/privkey.pem"
pki mail.mydomain.tld dhe auto

public_addr = "xxx.xxx.xxx.xxx"
listen on $public_addr port 465 smtps pki mail.mydomain.tld auth
listen on $public_addr port 587 tls-require pki mail.mydomain.tld auth

table ldap ldap:/etc/mail/ldap.conf

action dovecot lmtp "/var/run/dovecot/lmtp" userbase <ldap>
action "relay" relay

match from any for domain "mydomain.tld" action "dovecot"
match from any action "relay"

/etc/mail/ldap.conf

url                     ldap://ldap.mydomain.tld
username                cn=admin,dc=mydomain,dc=tld
password                xxxxxxxx
basedn                  ou=Users,dc=mydomain,dc=tld

...

切换到ldaps://ldap.mydomain.tldin/etc/mail/ldap.conf会使 OpenSMTPD 无法启动:

Jul 16 16:26:55 mail.mydomain.tld systemd[1]: Starting OpenSMTPD SMTP server...
Jul 16 16:26:55 mail.mydomain.tld smtpd[5073]: info: OpenSMTPD 6.6.4p1 starting
Jul 16 16:26:55 mail.mydomain.tld systemd[1]: Started OpenSMTPD SMTP server.
Jul 16 16:26:55 mail.mydomain.tld smtpd[5077]: warn: table-proc: imsg_read: Connection reset by peer
Jul 16 16:26:55 mail.mydomain.tld smtpd[5077]: lookup: table-proc: exiting
Jul 16 16:26:55 mail.mydomain.tld smtpd[5074]: warn: parent -> lka: imsg_read: Connection reset by peer
Jul 16 16:26:55 mail.mydomain.tld smtpd[5074]: smtpd: exiting: Connection reset by peer

如何修复此配置以启用ldaps与 OpenSMTPD 的连接?

ldap openssl opensmtpd
  • 1 个回答
  • 501 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve