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
    • 最新
    • 标签
主页 / user-582643

Alejandro Vidaurre's questions

Martin Hope
Alejandro Vidaurre
Asked: 2020-07-11 10:22:17 +0800 CST

Postfix Multi Instance - 测试从外部电子邮件 xclient 连接到辅助实例以发送电子邮件

  • 0

问题:我正在尝试通过同一服务器通过域 email.domain1.us 和 email.domain2.net 来实现发送和接收电子邮件,并具有经过身份验证的用户并且也能够接收电子邮件。

我有 domain1.us 和 domain2.net,两者都托管在具有独立公共 IP 100.100.100.1 和 200.200.200.2 的服务器上,IP 100.100.100.1 解析 domain1.us 和 IP 200.200.200.2 通过 DNS 记录解析 domain2.net . 对于电子邮件子域,除了之前所说的,现在 IP 100.100.100.1 还通过 A DNS 记录解析 email.domain1.us 和 IP 200.200.200.2 email.domain2.net,并且还具有 MX DNS 记录。

我正在运行 Ubuntu 16.04.5 LTS,我安装了 postfix 并成功设置 email.domain1.us 以根据我的虚拟哈希文件接收和分发电子邮件,并仅使用标准端口 465 上的 SSL 通过安全连接从经过身份验证的用户发送电子邮件. SPF、DMARC、DKIM 设置并记录所有良好和 PASS 身份验证(根据 GOOGLE 当我将测试发送到我的 GMAIL 帐户时)

我正在运行 Ubuntu 16.04.5 LTS

netstat -ltn节目

Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.1:587           0.0.0.0:*               LISTEN
tcp        0      0 100.100.100.1:587       0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:465           0.0.0.0:*               LISTEN
tcp        0      0 100.100.100.1:465       0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN
tcp        0      0 100.100.100.1:25        0.0.0.0:*               LISTEN

然后我使用 postmulti 设置了一个辅助后缀实例,非常简单:

postmulti -e init
postmulti -I postfix-2 -e create

更改或确保以下内容位于我的主要后缀 main.cf 文件中

nano /etc/postfix/main.cf

inet_interfaces = localhost, 100.100.100.1                       # This was changed from inet_interfaces = all
myhostname = mail.domain1.us                                     # just making sure to have different names on each
multi_instance_wrapper = ${command_directory}/postmulti -p --    # These were added
multi_instance_enable = yes                                      # by the postmulti command init
multi_instance_directories = /etc/postfix-2                      # This one was added by postmulti enable command

然后我备份了辅助后缀实例的 main.cf 和 master.cf 并复制了主后缀实例:

cp /etc/postfix/main.cf etc/postfix-2/main.cf cp /etc/postfix/master.cf etc/postfix-2/master.cf

并编辑参数以使其独立并且存在多实例的必要行

nano etc/postfix-2/main.cf

inet_interfaces = localhost, 200.200.200.2                       # This was changed from inet_interfaces = all
myhostname = mail.domain2.net                                    # Just making sure to have different names on each
virtual_alias_maps = hash:/etc/postfix-2/virtual                 # Want to have different users/inboxes
inet_protocols = ipv4                                            # Some of these were added 
master_service_disable = inet                                    # by the enable and/or init commad
authorized_submit_users =                                        # others were added by me after 
queue_directory = /var/spool/postfix-2                           # reading how to do it better
data_directory = /var/lib/postfix-2
multi_instance_name = postfix-2
multi_instance_enable = yes

然后对辅助 Postfix 实例的 master.cf 进行以下更改以具有分离的端口

nano /etc/postfix-2/master.cf

# smtp  inet  n  -  y  -   -  smtpd -o smtpd_sasl_auth_enable=yes    # Commented this line out
10025   inet  n  -  n  -   -  smtpd -o smtpd_sasl_auth_enable=yes    # Added this line
.
.
.
#smtps  inet  n  -  y  -   -  smtpd                                  # Commented this line out
10465   inet  n  -  y  -   -  smtpd                                  # Added this line

最后为使用 postmap 的辅助 Postfix Instance 创建了虚拟哈希文件并启用了该实例

postmulti -i postfix-2 -e enable

重新启动后缀

service postfix restart

并检查了实例的状态

postmulti -i postfix-2 -p status
postfix-2/postfix-script: the Postfix mail system is running: PID: 28004

到目前为止,我自己查找论坛和问题,但这就是我卡住的地方,我已经广泛研究了如何测试辅助实例,但我找不到如何,当我看不到端口 10025 和 10465尝试netstat -ltn,当然,当我尝试在smtper.net/之类的地方测试 mail.domain2.net 的 SMTP 时,我收到以下错误:

SMTP send error
Failure sending mail.
No connection could be made because the target machine actively refused it. [::ffff:104.168.34.235]:25

即使在所有这些更改和辅助 Postfix Image 设置之后,一切都适用于 email.domain1.us,但无法让它适用于 email.domain2.net。

postfix ubuntu-16.04
  • 2 个回答
  • 761 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