我对 Linux 还比较陌生,不知道如何设置服务器,尤其是处理与邮件相关的事务。我买了一个新域名,租了一个 VPS,现在用它来托管我的网站。我需要一个更开放的环境来运行我的网络项目,包括自动生成电子邮件地址并读取其收件箱。这就是我不能使用普通网络托管包的原因。
长话短说,我是个新手,在设置 postfix 时遇到了一个问题,我在网上找不到任何解决方案。我找到了一个方法,即 Web 服务器使用有效证书和与我的 Web 服务器相同的域名运行。这意味着,请求和向contact@example.com发送消息都可以。
到目前为止听起来不错。我的问题是,发送到任何收件箱的任何邮件都会自动重定向到我的私人邮箱。
这意味着,假设有人向contact@mydomain.com发送了一封电子邮件。我无法使用 查看这封邮件s-nail
,而是将其转发到我的私人地址。
someone@mail.com -> contact@mydomain.com -> ??? -> myprivatemail@proton.me
我在设置 postfix 时可能犯了一个错误。我认为我可能为“Root 和 postmaster 邮件收件人”设置了错误的值。
因此,我尝试使用 重新配置 postfix sudo dpkg-reconfigure postfix
,然后使用 重新启动服务sudo systemctl restart postfix
。但这并没有改变任何东西。
日志:
Jun 28 13:40:44 srv552577 postfix/postfix-script[61682]: waiting for the Postfix mail system to terminate
Jun 28 13:40:45 srv552577 postfix/postfix-script[61994]: starting the Postfix mail system
Jun 28 13:40:45 srv552577 postfix/master[61996]: daemon started -- version 3.8.6, configuration /etc/postfix
Jun 28 13:42:16 srv552577 postfix/smtpd[62024]: warning: database /etc/postfix/virtual.db is older than source file /etc/postfix/virtual
Jun 28 13:42:16 srv552577 postfix/smtpd[62024]: connect from mail-yb1-f179.google.com[209.85.219.179]
Jun 28 13:42:17 srv552577 postfix/trivial-rewrite[62028]: warning: database /etc/postfix/virtual.db is older than source file /etc/postfix/virtual
Jun 28 13:42:17 srv552577 postfix/cleanup[62029]: warning: database /etc/postfix/virtual.db is older than source file /etc/postfix/virtual
Jun 28 13:42:17 srv552577 postfix/smtpd[62024]: 56BFF40D79: client=mail-yb1-f179.google.com[209.85.219.179]
Jun 28 13:42:17 srv552577 postfix/cleanup[62029]: 56BFF40D79: message-id=<CAF41jLugJXH2jx6K8X+wh01Fb7-ru_mTO_Nyqf8ALEwg_y1vQA@mail.gmail.com>
Jun 28 13:42:17 srv552577 postfix/qmgr[61998]: 56BFF40D79: from=<myclearname@gmail.com>, size=2827, nrcpt=1 (queue active)
Jun 28 13:42:17 srv552577 postfix/cleanup[62029]: 5A00740D7B: message-id=<CAF41jLugJXH2jx6K8X+wh01Fb7-ru_mTO_Nyqf8ALEwg_y1vQA@mail.gmail.com>
Jun 28 13:42:17 srv552577 postfix/local[62030]: 56BFF40D79: to=<root@unlockedmail.de>, orig_to=<admin@unlockedmail.de>, relay=local, delay=0.03, delays=0.01/0.01/0/0, dsn=2.0.0, status=sent (forwarded as 5A00740D7B)
Jun 28 13:42:17 srv552577 postfix/qmgr[61998]: 5A00740D7B: from=<myclearname@gmail.com>, size=2964, nrcpt=1 (queue active)
Jun 28 13:42:17 srv552577 postfix/qmgr[61998]: 56BFF40D79: removed
Jun 28 13:42:17 srv552577 postfix/smtpd[62024]: disconnect from mail-yb1-f179.google.com[209.85.219.179] ehlo=2 starttls=1 mail=1 rcpt=1 bdat=1 quit=1 commands=7
Jun 28 13:42:24 srv552577 postfix/smtp[62031]: 5A00740D7B: to=<brentspine@proton.me>, orig_to=<admin@unlockedmail.de>, relay=mail.protonmail.ch[176.119.200.128]:25, delay=6.9, delays=0/0.02/5.9/1, dsn=2.0.0, status=sent (250 2.0.0 Ok: q>
Jun 28 13:42:24 srv552577 postfix/qmgr[61998]: 5A00740D7B: removed
Jun 28 13:45:37 srv552577 postfix/anvil[62027]: statistics: max connection rate 1/60s for (smtp:209.85.219.179) at Jun 28 13:42:16
Jun 28 13:45:37 srv552577 postfix/anvil[62027]: statistics: max connection count 1 for (smtp:209.85.219.179) at Jun 28 13:42:16
Jun 28 13:45:37 srv552577 postfix/anvil[62027]: statistics: max cache size 1 at Jun 28 13:42:16
/etc/postfix/virtual
:
contact@mydomain.com brent
admin@mydomain.com brent
/etc/postfix/main.cf
:
GNU nano 7.2 main.cf *
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 3.6 on
# fresh installs.
compatibility_level = 3.6
# 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_tls_security_level=may
smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level=may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = srv552577.hstgr.cloud
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = srv552577.hstgr.cloud, IREPLACEDTHISDOMAIN.de, srv552577.hstgr.cloud, localhost.hstgr.cloud, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/
virtual_alias_maps = hash:/etc/postfix/virtual
/etc/postfix/master.cf
:
#
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master" or
# on-line: http://www.postfix.org/master.5.html).
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (no) (never) (100)
# ==========================================================================
smtp inet n - y - - smtpd
#smtp inet n - y - 1 postscreen
#smtpd pass - - y - - smtpd
#dnsblog unix - - y - 0 dnsblog
#tlsproxy unix - - y - 0 tlsproxy
# Choose one: enable submission for loopback clients only, or for any client.
#127.0.0.1:submission inet n - y - - smtpd
#submission inet n - y - - smtpd
# -o syslog_name=postfix/submission
# -o smtpd_tls_security_level=encrypt
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_tls_auth_only=yes
# -o local_header_rewrite_clients=static:all
# -o smtpd_reject_unlisted_recipient=no
# Instead of specifying complex smtpd_<xxx>_restrictions here,
# specify "smtpd_<xxx>_restrictions=$mua_<xxx>_restrictions"
# here, and specify mua_<xxx>_restrictions in main.cf (where
# "<xxx>" is "client", "helo", "sender", "relay", or "recipient").
# -o smtpd_client_restrictions=
# -o smtpd_helo_restrictions=
# -o smtpd_sender_restrictions=
# -o smtpd_relay_restrictions=
# -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
# Choose one: enable submissions for loopback clients only, or for any client.
#127.0.0.1:submissions inet n - y - - smtpd
#submissions inet n - y - - smtpd
# -o syslog_name=postfix/submissions
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o local_header_rewrite_clients=static:all
# -o smtpd_reject_unlisted_recipient=no
# Instead of specifying complex smtpd_<xxx>_restrictions here,
# specify "smtpd_<xxx>_restrictions=$mua_<xxx>_restrictions"
# here, and specify mua_<xxx>_restrictions in main.cf (where
# "<xxx>" is "client", "helo", "sender", "relay", or "recipient").
# -o smtpd_client_restrictions=
# -o smtpd_helo_restrictions=
# -o smtpd_sender_restrictions=
# -o smtpd_relay_restrictions=
# -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#628 inet n - y - - qmqpd
pickup unix n - y 60 1 pickup
cleanup unix n - y - 0 cleanup
qmgr unix n - n 300 1 qmgr
#qmgr unix n - n 300 1 oqmgr
tlsmgr unix - - y 1000? 1 tlsmgr
我的 TXT 和 MX DNS 记录:
请告诉我如何修复此问题或是否需要向您提供任何其他信息。
提前致谢
8
–
–
–
–
–
|