我的 postfix 服务无法启动。这是消息:
Job for postfix.service failed. See 'systemctl status postfix.service' and 'journalctl -xn' for details.
这是服务状态:
postfix.service - Postfix Mail Transport Agent
Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled)
Active: failed (Result: timeout) since Wed 2015-11-18 16:58:32 ICT; 6min ago
Process: 40961 ExecStart=/usr/sbin/postfix start (code=killed, signal=TERM)
Process: 40957 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=0/SUCCESS)
Process: 40953 ExecStartPre=/usr/libexec/postfix/aliasesdb (code=exited, status=0/SUCCESS)
Nov 18 16:58:32 cpanel.redsand.vn systemd[1]: postfix.service operation timed out. Terminating.
Nov 18 16:58:32 cpanel.redsand.vn systemd[1]: Failed to start Postfix Mail Transport Agent.
Nov 18 16:58:32 cpanel.redsand.vn systemd[1]: Unit postfix.service entered failed state.
这是我的配置:
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
data_directory = /var/lib/postfix
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
delay_warning_time = 4
disable_vrfy_command = yes
dovecot_destination_recipient_limit = 1
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 20480000
mydestination = localhost.$mydomain, localhost, $mydomain
mydomain = cpanel.redsand.vn
myhostname = cpanel.redsand.vn
mynetworks = 127.0.0.1, 113.160.170.38
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/sentora/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_banner = $myhostname ESMTP
smtpd_client_restrictions =
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_helo_required = yes
smtpd_helo_restrictions =
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_non_fqdn_sender, reject_non_fqdn_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
unknown_local_recipient_reject_code = 550
virtual_alias_maps = proxy:mysql:/etc/sentora/configs/postfix/mysql-virtual_alias_maps.cf, regexp:/etc/sentora/configs/postfix/virtual_regexp
virtual_gid_maps = static:12
virtual_mailbox_base = /var/sentora/vmail
virtual_mailbox_domains = proxy:mysql:/etc/sentora/configs/postfix/mysql-virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/sentora/configs/postfix/mysql-virtual_mailbox_maps.cf
virtual_minimum_uid = 991
virtual_transport = dovecot
virtual_uid_maps = static:991
请帮我解决这个问题,我不知道如何解决。非常感谢。
答案1
我遇到了同样的问题,使用从以前的机器导入的配置。
这是我解决这个问题的方法:
$ sudo rm -v /var/lib/postfix/master.lock
$ sudo systemctl start postfix
就我而言,之前的尝试中还存在后缀进程留下的问题,解决方案如下:
-- 检查 postfix 是否未运行:
$ ps faxu | grep -i [p]ostfix
root 12854 0.0 0.2 92004 2236 ? Ss 07:23 0:00 /usr/libexec/postfix/master -w
postfix 12855 0.0 0.4 98320 4088 ? S 07:23 0:00 \_ pickup -l -t fifo -u
postfix 12856 0.0 0.4 98388 4128 ? S 07:23 0:00 \_ qmgr -l -t fifo -u
postfix 12872 0.0 0.4 98332 4672 ? S 07:29 0:00 \_ tlsmgr -l -t unix -u
-- 如果您有 postfix 进程正在运行,请将它们全部杀死:
$ sudo kill -9 12854 12855 12856 12872
-- 杀死所有进程后,删除 master.lock 文件并使用 systemctl 启动 postfix (见上文)。
最后,不要忘记queue_directory应该指向/var/spool/postfix ...