如何在 Centos 中禁用本地邮件传递?

如何在 Centos 中禁用本地邮件传递?

我想在我的 Centos VPS 上禁用本地邮件,因为我有一个 Web 表单(在由 VPS 托管的网站上),它将邮件发送到本地邮箱,而不是查看 MX 记录将其发送到 Exchange 服务器。

我已经查看了这个问题中的一些说明Postifx 禁用本地传送

如果我使用 ZPanel,该如何实现?ZPanel 的处理方式是否不同?

有人可以提供解决此问题的指导吗?

仅供参考,正在使用 Postfix(这是由 ZPanel 自动设置的)。

以下是“postconf -n”的输出

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
delay_warning_time = 4
disable_vrfy_command = yes
header_checks = regexp:/etc/postfix/header_checks
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = localhost.$mydomain, localhost
mydomain = gunston.gwsadmin.info
myhostname = gunston.gwsadmin.info
mynetworks = all
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.2.2/README_FILES
recipient_delimiter = +
relay_domains = proxy:mysql:/etc/zpanel/configs/postfix/mysql-relay_domains_maps.cf
sample_directory = /usr/share/doc/postfix-2.2.2/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_use_tls = no
smtpd_client_restrictions =
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_helo_required = yes
smtpd_helo_restrictions =
smtpd_recipient_restrictions = permit_sasl_authenticated,        permit_mynetwor                                                                                                                               qdn_recipient,        reject_unknown_recipient_domain
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions =
smtpd_use_tls = no
soft_bounce = yes
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_maps = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_alias
virtual_gid_maps = static:12
virtual_mailbox_base = /var/zpanel/vmail
virtual_mailbox_domains = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_
virtual_mailbox_maps = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_mai
virtual_minimum_uid = 101
virtual_transport = dovecot
virtual_uid_maps = static:101

答案1

使用 postfix,这很简单。只需从 mysql 表中删除 example.com 即可。有关此表的更多信息,请参阅参数

virtual_mailbox_domains = proxy:mysql:/etc/zpanel/configs/postfix/mysql-virtual_

免责声明:

  • 这个改变可能会导致zpanel爆炸停止工作,因为你敢于改变zpanel系统的低水平。
  • 由于 zpanel 不支持此更改,zpanel 系统可能会失控并覆盖您的更改。因此您必须重新应用它。
  • 转帖EEAA 的评论无论如何,说真的。摆脱 Zpanel。它只会让你的生活更加困难

相关内容