PFsense postfix 故障排除 - SMTP 标头

PFsense postfix 故障排除 - SMTP 标头

我正在尝试将 Google 设置为邮件中继,但遇到了一些麻烦。

我收到一个错误

550-5.1.1 The email account that you tried to reach does not exist

我在 pfSense 中的自定义主页如下所示:

relayhost = [smtp-relay.gmail.com]:587

#Defining domain and hostname- Test
myhostname = vpn.example.com
mydomain = example.com
myorigin = example.com

# Add TLS
#
# SMTPD
#
smtpd_tls_cert_file = /etc/postfix/cert.crt
smtpd_tls_key_file = /etc/postfix/cert.key
smtpd_tls_CAfile = /etc/ssl/cert.pem
smtpd_tls_security_level = may
# SMTP Client
smtp_tls_security_level = may
smtp_tls_CAfile = /etc/ssl/cert.pem
# SSL-Certificate - Generate logfile entries
#
smtpd_tls_received_header = yes
smtp_tls_loglevel = 1
smtpd_tls_loglevel = 1

当我尝试从 pfSense 服务器发送邮件时,我的日志文件显示以下内容:

Aug 11 14:59:07 <host> postfix/smtp[49764]: > smtp-relay.gmail.com[173.194.220.28]:587: MAIL FROM:<> SIZE=3532
Aug 11 14:59:07 <host> postfix/smtp[49764]: > smtp-relay.gmail.com[173.194.220.28]:587: RCPT TO:<[email protected]>
Aug 11 14:59:07 <host> postfix/smtp[49764]: < smtp-relay.gmail.com[173.194.220.28]:587: 250 2.1.0 OK h7sm42095laf.0 - gsmtp
Aug 11 14:59:07 <host> postfix/smtp[49764]: smtp_stream_setup: maxtime=300 enable_deadline=0
Aug 11 14:59:07 <host> postfix/smtp[49764]: vstream_buf_get_ready: fd 14 got 274
Aug 11 14:59:07 <host> postfix/smtp[49764]: < smtp-relay.gmail.com[173.194.220.28]:587: 550-5.1.1 The email account that you tried to reach does not exist. Please try

我不明白为什么 smtp 标头 MAIL FROM: <> 为空,以及为什么 RCPT 说[电子邮件保护]而不是我尝试发送邮件的那个,就像[电子邮件保护]

这是我登录服务器时的 postconf -n:

access_map_defer_code = 451
access_map_reject_code = 554
config_directory = /usr/pbi/postfix-amd64/etc/postfix
debug_peer_level = 6
debug_peer_list = gmail.com
default_process_limit = 100
inet_interfaces = 10.1.2.254
inet_protocols = ipv4
local_recipient_maps =
message_size_limit = 10240000
mydestination =
mydomain = example.com
myhostname = vpn.example.com
mynetworks = /usr/pbi/postfix-amd64/etc/postfix/mynetwork_table
mynetworks_style = host
myorigin = example.com
relay_domains =
relayhost = [smtp-relay.gmail.com]:587
smtp_tls_CAfile = /etc/ssl/cert.pem
smtp_tls_loglevel = 1
smtp_tls_security_level = may
smtpd_client_restrictions = permit_mynetworks, reject_unauth_destination, check_sender_access hash:/usr/pbi/postfix-amd64/etc/postfix/sender_access, check_client_access pcre:/usr/pbi/postfix-amd64/etc/postfix/cal_pcre, check_client_access cidr:/usr/pbi/postfix-amd64/etc/postfix/cal_cidr permit
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination, check_sender_access hash:/usr/pbi/postfix-amd64/etc/postfix/sender_access, check_client_access pcre:/usr/pbi/postfix-amd64/etc/postfix/cal_pcre, check_client_access cidr:/usr/pbi/postfix-amd64/etc/postfix/cal_cidr, , permit
smtpd_sender_restrictions = reject_unknown_sender_domain, permit
smtpd_tls_CAfile = /etc/ssl/cert.pem
smtpd_tls_cert_file = /etc/postfix/cert.crt
smtpd_tls_key_file = /etc/postfix/cert.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
transport_maps = hash:/usr/pbi/postfix-amd64/etc/postfix/transport
unknown_client_reject_code = 550
unknown_hostname_reject_code = 550
unverified_recipient_reject_code = 550

答案1

您正在覆盖local_recipient_maps并取消设置它:

local_recipient_maps =

默认值为:

local_recipient_maps = proxy:unix:passwd.byname $alias_maps

第一部分管理本地用户,见:

$ sudo postmap -q root proxy:unix:passwd.byname
root:x:0:0:root:/root:/bin/bash

删除上面引用的行以允许 root 本地用户接收者或将 root 添加到虚拟用户(包括虚拟域等)

相关内容