我成功设置了 SMTP 专用导游由 DigitalOcean 提供。但是,这次我想将其设置在子域中。考虑一下我拥有的这个域:`http://v1.product.staging.veil-soft.com。
使用我曾经使用的相同指南,但我无法使电子邮件正常工作。
这是我的配置:
main.cfg
文件:
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = veil-soft.com
smtp_generic_maps = hash:/etc/postfix/generic
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = veil-soft.com, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all
/etc/aliases
文件:
# See man 5 aliases for format
postmaster: root
root: [email protected]
/etc/postfix/generic
文件:
[email protected] [email protected]
/etc/mailname
文件:
veil-soft.com
尝试使用以下mail
命令发送:
echo "This is the body of the email" | mail -s "Testing" [email protected]
并mail.log
产生这个:
Aug 11 19:57:54 hostname postfix/pickup[8245]: AA598101F08: uid=0 from=<[email protected]>
Aug 11 19:57:54 hostname postfix/cleanup[8548]: AA598101F08: message-id=<[email protected]>
Aug 11 19:57:54 hostname postfix/qmgr[30043]: AA598101F08: from=<[email protected]>, size=358, nrcpt=1 (queue active)
Aug 11 19:57:54 hostname postfix/local[8553]: AA598101F08: to=<[email protected]>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Aug 11 19:57:54 hostname postfix/qmgr[30043]: AA598101F08: removed
Aug 11 20:00:01 hostname postfix/local[8596]: 7B19E101F15: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=5.1.1, status=bounced (unknown user: "eng")
Aug 11 20:00:01 hostname postfix/qmgr[30043]: 7B19E101F15: removed
Aug 11 20:00:01 hostname postfix/local[8597]: 7C8F7101F08: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=5.1.1, status=bounced (unknown user: "eng")
Aug 11 20:00:01 hostname postfix/qmgr[30043]: 7C8F7101F08: removed
答案1
除非您使用某种 imap 服务器或其他东西,否则我认为您需要创建一个名为 engineering 的本地用户才能使其正常工作。如果我错了,请纠正我。
这条线有效:
Aug 11 19:57:54 hostname postfix/local[8553]: AA598101F08: to=<[email protected]>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox).`
是name
本地用户吗?设置engineering
方法相同。
- 更新至原始答案
根据 OP 的修改编辑和下面的评论,需要对 postfix 配置进行以下更改
问题似乎是,该服务器原本打算将邮件中继到 vielsoft.com 域的另一个 SMTP 服务器,但由于配置错误而尝试本地传送。
/etc/postfix/main.cf
mydestination = v1.product.staging.vielsoft.com
myhostname = v1.product.staging.vielsoft.com
/etc/邮件名称
v1.product.staging.vielsoft.com