我在 VPS 上使用 CentOS 7,LAMP 使用 Postfix,Dovecot 和 Spamassassin,并使用 Rainloop 作为电子邮件客户端。当我使用以下方式启动 Postfix 时:
systemctl enable postfix
systemctl restart postfix
而 Dovecot 则为:
systemctl restart dovecot
systemctl enable dovecot
之后我的 CPU 使用率超过 90-99%,磁盘使用率也开始意外填满,而且我只能发送电子邮件而不能接收电子邮件。以下是我运行此命令时的一些输出:
[root@server ~]# postconf -nf
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_sender_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_client_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_helo_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_sender_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_client_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_helo_restrictions
postconf: warning: /etc/postfix/main.cf: undefined parameter: virtual_mailbox_limit_maps
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
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 ddd
$daemon_directory/$process_name $process_id & sleep 5
dovecot_destination_recipient_limit = 1
header_checks = regexp:/etc/postfix/header_checks
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 30720000
meta_directory = /etc/postfix
milter_default_action = accept
mydestination = localhost, localhost.localdomain
myhostname = mail.myhostname.com
mynetworks = 127.0.0.0/8
newaliases_path = /usr/bin/newaliases.postfix
non_smtpd_milters = $smtpd_milters
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps
$virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains
$relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps
$recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
$virtual_mailbox_limit_maps
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix3-3.5.8/README_FILES
sample_directory = /usr/share/doc/postfix3-3.5.8/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
shlib_directory = /usr/lib/postfix
smtp_tls_security_level = may
smtpd_data_restrictions = check_policy_service unix:/var/log/policyServerSocket
smtpd_milters = inet:127.0.0.1:8891
smtpd_policy_service_default_action = DUNNO
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated,
reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/pki/dovecot/certs/dovecot.pem
smtpd_tls_key_file = /etc/pki/dovecot/private/dovecot.pem
smtpd_use_tls = yes
tls_server_sni_maps = hash:/etc/postfix/vmail_ssl.map
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf,
mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_transport = dovecot
virtual_uid_maps = static:5000
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
以及运行时:
[root@server ~]# postconf -Mf
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_sender_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_client_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_helo_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_sender_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_client_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_helo_restrictions
postconf: warning: /etc/postfix/main.cf: undefined parameter: virtual_mailbox_limit_maps
smtp inet n - n - - smtpd
-o content_filter=spamassassin
submission inet n - n - - smtpd
-o syslog_name=postfix/submission
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_reject_unlisted_recipient=no
-o smtpd_client_restrictions=$mua_client_restrictions
-o smtpd_helo_restrictions=$mua_helo_restrictions
-o smtpd_sender_restrictions=$mua_sender_restrictions
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
-o milter_macro_daemon_name=ORIGINATING
smtps inet n - n - - smtpd
-o syslog_name=postfix/smtps
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_reject_unlisted_recipient=no
-o smtpd_client_restrictions=$mua_client_restrictions
-o smtpd_helo_restrictions=$mua_helo_restrictions
-o smtpd_sender_restrictions=$mua_sender_restrictions
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
-o milter_macro_daemon_name=ORIGINATING
pickup unix n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr unix n - n 300 1 qmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - n - - smtp
relay unix - - n - - smtp
showq unix n - n - - showq
error unix - - n - - error
retry unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
dovecot unix - n n - - pipe flags=DRhu
user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d
${recipient}
spamassassin unix - n n - - pipe flags=DROhu
user=vmail:vmail argv=/usr/bin/spamc -f -e /usr/libexec/dovecot/deliver -f
${sender} -d ${user}@${nexthop}
spamassassin unix - n n - - pipe flags=R
user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender}
${recipient}
最后,当我停止 Postfix 和 Dovecot 时,我的磁盘使用率停止增长,但当我再次启动 Postfix 和 Dovecot 时,磁盘使用率又开始增长。
如果您能帮助我解决这个问题,我将不胜感激;如果需要更多内容来分析这个问题,我可以在这里展示。
谢谢
答案1
postconf:警告:/etc/postfix/master.cf:未定义参数:
postfix 警告您,您在一个文件(在 master.cf 中)中使用了一些未定义(在 main.cf 中)的参数。
首先弄清楚事情发生的原因,然后解决它,最后处理剩余的问题。
发生这种情况的一种情况是,您无意中截断了文件,这就是您缺少部分配置的原因,包括现在触发警告的参数。
答案2
以下是 master.cf 的内容
[root@server ~]# cd /etc/postfix/
[root@server postfix]# cat master.cf
Postfix 主进程配置文件。有关格式的详细信息
该文件的详细信息,请参阅 master(5) 手册页(命令:“man 5 master”)。
编辑此文件后,请不要忘记执行“postfix reload”。
==========================================================================
服务类型 private unpriv chroot wakeup maxproc 命令 + 参数
(是) (是) (是) (从不) (100)
==========================================================================
smtp inet n - n - - smtpd -o content_filter=spamassassin #smtp inet n - n - 1 postscreen #smtpd pass - - n - - smtpd #dnsblog unix - - n - 0 dnsblog #tlsproxy unix - - n - 0 tlsproxy submission inet n - n - - smtpd -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_reject_unlisted_recipient=no -o smtpd_client_restrictions=$mua_client_restrictions -o smtpd_helo_restrictions=$mua_helo_restrictions -o smtpd_sender_restrictions=$mua_sender_restrictions -o smtpd_recipient_restrictions=permit_sasl_authenticated,拒绝-o milter_macro_daemon_name=ORIGINATING smtps inet n - n - - smtpd -o syslog_name=postfix/smtps -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes -o smtpd_reject_unlisted_recipient=no -o smtpd_client_restrictions=$mua_client_restrictions -o smtpd_helo_restrictions=$mua_helo_restrictions -o smtpd_sender_restrictions=$mua_sender_restrictions -o smtpd_recipient_restrictions=permit_sasl_authenticated,拒绝-o milter_macro_daemon_name=ORIGINATING #628 inet n - n - - qmqpd 拾取 unix n - n 60 1 拾取清理 unix n - n - 0 清理 qmgr unix n - n 300 1 qmgr #qmgr unix n - n 300 1 oqmgr tlsmgr unix - - n 1000? 1 tlsmgr 重写 unix - - n - - 简单重写 弹跳 unix - - n - 0 弹跳延迟 unix - - n - 0 弹跳跟踪 unix - - n - 0 弹跳验证 unix - - n - 1 验证刷新 unix n - n 1000? 0 刷新代理映射 unix - - n - - 代理映射代理写入 unix - - n - 1 代理映射 smtp unix - - n - - smtp 中继 unix - - n - - smtp
-o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq 错误 unix - - n - - 错误重试 unix - - n - - 错误丢弃 unix - - n - - 丢弃 本地 unix - nn - - 本地 虚拟 unix - nn - - 虚拟 lmtp unix - - n - - lmtp anvil unix - - n - 1 anvil scache unix - - n - 1 scache
====================================================================
与非 Postfix 软件的接口。请务必查看手册
非 Postfix 软件的页面来了解它需要什么选项。
以下许多服务都使用 Postfix 管道 (8) 传递
代理。有关 ${recipient} 的信息,请参阅 pipe(8) 手册页
以及其他消息信封选项。
====================================================================
maildrop。有关详细信息,请参阅 Postfix MAILDROP_README 文件。
另外在main.cf中指定:maildrop_destination_recipient_limit=1
#maildrop unix - nn - - 管道
标志=DRhu 用户=vmail argv=/usr/local/bin/maildrop -d ${recipient}
====================================================================
最近的 Cyrus 版本可以使用现有的“lmtp”master.cf 条目。
在cyrus.conf中指定:
lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
在 main.cf 中指定下列一项或多项:
邮箱传输 = lmtp:inet:localhost
虚拟传输 = lmtp:inet:localhost
====================================================================
赛勒斯 2.1.5(Amos Gouaux)
还在 main.cf 中指定:cyrus_destination_recipient_limit=1
#cyrus unix - nn - - 管道
用户 = cyrus argv = /usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}
====================================================================
通过 Cyrus 进行交付的旧示例。
#old-cyrus unix - nn - - 管道
标志=R 用户=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
====================================================================
有关配置详细信息,请参阅 Postfix UUCP_README 文件。
#uucp unix-nn--管道
标志=Fqhu 用户=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
====================================================================
其他外部交付方法。
#ifmail unix - nn - - 管道
标志 = F 用户 = ftn argv = / usr / lib / ifmail / ifmail -r $ nexthop($ recipient)
#bsmtp unix-nn--管道
标志=Fq。用户=bsmtp argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
#scalemail-backend unix - nn - 2 管道
标志=R 用户=scalemail argv=/usr/lib/scalemail/bin/scalemail-store
${nexthop} ${用户} ${扩展名}
#mailman unix - nn - - 管道
标志=FR 用户=列表 argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${用户}
dovecot unix - nn - - 管道标志=DRhu 用户=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient} spamassassin unix - nn - - 管道标志=DROhu 用户=vmail:vmail argv=/usr/bin/spamc -f -e /usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop} spamassassin unix - nn - - 管道标志=R 用户=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
以下是 main.cf 的内容
[root@server postfix]# cat main.cf
全局 Postfix 配置文件。此文件仅列出子集
所有参数的语法和完整参数
列表,请参阅 postconf(5) 手册页(命令:“man 5 postconf”)。
常见配置示例请参见BASIC_CONFIGURATION_README
和 STANDARD_CONFIGURATION_README。要查找这些文档,请使用
命令“postconf html_directory readme_directory”,或者转到
http://www.postfix.org/。
为了获得最佳效果,每次更改的参数不要超过 2-3 个,
并测试每次更改后 Postfix 是否仍然有效。
队列目录 = /var/spool/postfix 命令目录 = /usr/sbin 守护进程目录 = /usr/libexec/postfix 数据目录 = /var/lib/postfix 邮件所有者 = postfix inet_protocols = all mydestination = localhost, localhost.localdomain 未知本地接收者拒绝代码 = 550 别名映射 = hash:/etc/aliases 别名数据库 = hash:/etc/aliases debug_peer_level = 2 调试器命令 = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $守护进程目录/$进程名称 $进程ID & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix newaliases_path = /usr/bin/newaliases.postfix mailq_path = /usr/bin/mailq.postfix setgid_group = postdrop html_directory = no manpage_directory = /usr/share/man sample_directory = /usr/share/doc/postfix3-3.5.8/samples readme_directory = /usr/share/doc/postfix3-3.5.8/README_FILES
myhostname = mail.myhostname.com mynetworks = 127.0.0.0/8 message_size_limit = 30720000 virtual_alias_domains = virtual_alias_maps = 代理:mysql:/etc/postfix/mysql-virtual_forwardings.cf,mysql:/etc/postfix/mysql-virtual_email2email.cf virtual_mailbox_domains = 代理:mysql:/etc/postfix/mysql-virtual_domains.cf virtual_mailbox_maps = 代理:mysql:/etc/postfix/mysql-virtual_mailboxes.cf virtual_mailbox_base = /home/vmail virtual_uid_maps = 静态:5000 virtual_gid_maps = 静态:5000 smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes broken_sasl_auth_clients =是 smtpd_sasl_authenticated_header = 是 smtpd_recipient_restrictions = permit_mynetworks、permit_sasl_authenticated、reject_unauth_destination smtpd_use_tls = 是 smtpd_tls_cert_file = /etc/pki/dovecot/certs/dovecot.pem smtpd_tls_key_file = /etc/pki/dovecot/private/dovecot.pem virtual_create_maildirsize = 是 virtual_maildir_extended = 是 proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps virtual_transport = dovecot dovecot_destination_recipient_limit = 1 inet_interfaces = 全部 smtp_tls_security_level = 可能
smtpd_milters = inet:127.0.0.1:8891 non_smtpd_milters = $smtpd_milters milter_default_action = 接受 meta_directory = /etc/postfix shlib_directory = /usr/lib/postfix header_checks = regexp:/etc/postfix/header_checks smtpd_data_restrictions = check_policy_service unix:/var/log/policyServerSocket smtpd_policy_service_default_action = 不知道
tls_server_sni_maps = 哈希:/etc/postfix/vmail_ssl.map
[root@server postfix]# cd
请检查一下,让我确定我哪里犯了错误,并帮助我解决这个问题。我很感激你帮助我解决这个问题。
谢谢