【问题标题】:Unable to send out emails using PostFix Mail Server无法使用 PostFix 邮件服务器发送电子邮件
【发布时间】:2018-01-25 03:42:49
【问题描述】:

我无法从我的 Linux 服务器 (3.10.0-514.10.2.el7.x86_64 #1 SMP) 以 root@TechX.com 的身份发送电子邮件,尽管 SMTP 端口 25 处于活动状态且正在侦听。

[root@TechX ~]# hostname
TechX

PostFix 版本是:

postconf -d | grep mail_version
mail_version = 2.10.1
milter_macro_v = $mail_name $mail_version

我检查了邮件日志 ( /var/log/maillog ) 并发现了以下错误。

8 月 16 日 20:50:05 TechX 后缀/拾取 [25136]: AEE222A924: uid=0 从 = 8 月 16 日 20:50:05 TechX 后缀/清理 [17455]:AEE222A924: message-id= 8 月 16 日 20:50:05 TechX 后缀/清理[17455]:警告: proxy:mysql:/etc/postfix/mysql-virtual_vacation.cf 查找错误 “root@email.TechX.com”8 月 16 日 20:50:05 TechX 后缀/清理 [17455]: 警告:AEE222A924:recipient_bcc_maps 查找问题 8 月 16 日 20:50:05 TechX postfix/pickup [25136]:警告:maildrop/44677A9FE:错误 写入 AEE222A924:队列文件写入错误 8 月 16 日 20:50:06 TechX 后缀/拾取 [25136]:警告:AFA982A927:消息已排队 80天

我正在共享错误日志中看到的所有“.cf”文件。

[root@TechX ~]# more /etc/postfix/main.cf
# postfix config file

# uncomment for debugging if needed
soft_bounce=yes

# postfix main
mail_owner = postfix
setgid_group = postdrop
delay_warning_time = 4

# postfix paths
html_directory = no
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
queue_directory = /var/spool/postfix
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man

# network settings
inet_interfaces = all
mydomain = TechX.com
myhostname = email
mynetworks = $config_directory/mynetworks
mydestination = $myhostname, localhost.$mydomain, localhost
relay_domains = proxy:mysql:/etc/postfix/mysql-relay_domains_maps.cf

# mail delivery
recipient_delimiter = +

# mappings
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
transport_maps = hash:/etc/postfix/transport
#local_recipient_maps =

# virtual setup
#virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_alias_maps.cf, 
regexp:/etc/postfix/virtual_regexp
virtual_alias_maps = proxy:regexp:/etc/postfix/virtual_regexp
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-
virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-
virtual_mailbox_maps.cf
virtual_minimum_uid = 101
virtual_uid_maps = static:101
virtual_gid_maps = static:12
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

# debugging
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
                 xxgdb $daemon_directory/$process_name $process_id & sleep 5

# authentication
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth

# tls config
smtp_use_tls = yes
smtpd_use_tls = yes
smtpd_tls_security_level = may
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
smtp_tls_session_cache_database = 
btree:$data_directory/smtp_tls_session_cache
# Change mail.example.com.* to your host name
smtpd_tls_key_file = /etc/pki/tls/private/TechX.key
smtpd_tls_cert_file = /etc/pki/tls/certs/TechX.crt
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
smtpd_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt

# rules restrictions
smtpd_client_restrictions =
smtpd_helo_restrictions =
smtpd_sender_restrictions =
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, 
reject_unauth_destination, reject_non_fqdn_sender, 
reject_non_fqdn_recipient, reject_unknown_rec
ipient_domain
# uncomment for realtime black list checks
# ,reject_rbl_client zen.spamhaus.org
# ,reject_rbl_client bl.spamcop.net
# ,reject_rbl_client dnsbl.sorbs.net
smtpd_helo_required = yes
unknown_local_recipient_reject_code = 550
disable_vrfy_command = yes
smtpd_data_restrictions = reject_unauth_pipelining

# Other options
# email size limit ~20Meg
message_size_limit = 9000000000
mailbox_size_limit = 2048000000

# Vacation Scripts
vacation_destination_recipient_limit = 1
recipient_bcc_maps = proxy:mysql:/etc/postfix/mysql-virtual_vacation.cf

more /etc/postfix/mysql-virtual_alias_maps.cf
hosts = localhost
user = postfix
password = xxxxxxxxxxx
dbname = postfix
query = SELECT goto FROM alias WHERE address='%s' AND (active = '1' OR active = '3')

more /etc/postfix/mysql-virtual_vacation.cf
user = postfix
password = xxxxxxxxxxx
dbname = postfix
table = vacation
select_field = email
where_field = email
additional_conditions = and active = '9'
result_format = %u#%d@autoreply.TechX

以下是我的主机文件条目

more /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 
localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 
localhost6.localdomain6
127.0.0.1 guest
::1       guest
127.0.0.1 TechX
::1       TechX
127.0.0.1 autoreply.TechX
45.86.72.111 TechX.com
45.86.72.111 jira.TechX.com
45.86.72.111 shop.TechX.com

您能否建议我应该如何解决这个问题?如果您需要更多详细信息,请告诉我。

【问题讨论】:

    标签: linux email postfix


    【解决方案1】:

    我遇到了类似的问题,通过取消注释以下行来解决 /etc/postfix/master.cf 文件...

    smtps  inet  n  -  -  -  -  smtpd 
    

    我还尝试整理了在配置了 Gmail 服务器的 RHEL7 上成功设置 postfix 服务器所需的所有步骤。 您可以快速浏览这些步骤并确定您是否错过了任何步骤。

    详文:http://www.cubicrace.com/2017/11/unauthenticated-mail-server.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-05
      • 2015-10-28
      • 1970-01-01
      • 1970-01-01
      • 2014-06-28
      • 2015-08-19
      • 2014-11-14
      • 1970-01-01
      相关资源
      最近更新 更多