PFsense postfix疑难解答 – SMTP头

我试图设置谷歌作为邮件中继,但遇到一些麻烦。

我得到一个错误

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说的是[email protected],而不是我尝试sendmail的东西,就像[email protected]

这是我的postconf -nlogin服务器时:

 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 

您正在重写local_recipient_maps并取消设置:

 local_recipient_maps = 

默认值是:

 local_recipient_maps = proxy:unix:passwd.byname $alias_maps 

第一部分pipe理本地用户,请参阅:

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

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