有人正在使用我的服务器(可能来自不安全的forms)发送大量的垃圾邮件。
我看了一下mailq但似乎无法find解决这个问题的地方。
有没有办法来追查这些垃圾邮件来自哪里?
我正在使用CentOS和Postfix
这是我的main.cf文件的一部分:
sendmail_path = /usr/sbin/sendmail.postfix # newaliases_path: The full pathname of the Postfix newaliases command. # This is the Sendmail-compatible command to build alias databases. # newaliases_path = /usr/bin/newaliases.postfix # mailq_path: The full pathname of the Postfix mailq command. This # is the Sendmail-compatible mail queue listing command. # mailq_path = /usr/bin/mailq.postfix # setgid_group: The group for mail submission and queue management # commands. This must be a group name with a numerical group ID that # is not shared with other accounts, not even with the Postfix account. # setgid_group = postdrop # html_directory: The location of the Postfix HTML documentation. # html_directory = no # manpage_directory: The location of the Postfix on-line manual pages. # manpage_directory = /usr/share/man # sample_directory: The location of the Postfix sample configuration files. # This parameter is obsolete as of Postfix 2.1. # sample_directory = /usr/share/doc/postfix-2.3.3/samples # readme_directory: The location of the Postfix README files. # readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES virtual_mailbox_domains = $virtual_mailbox_maps, hash:/var/spool/postfix/plesk/virtual_domains virtual_alias_maps = $virtual_maps, hash:/var/spool/postfix/plesk/virtual virtual_mailbox_maps = hash:/var/spool/postfix/plesk/vmailbox transport_maps = hash:/var/spool/postfix/plesk/transport smtpd_tls_cert_file = /etc/postfix/postfix_default.pem smtpd_tls_key_file = $smtpd_tls_cert_file smtpd_tls_security_level = may smtpd_use_tls = yes smtp_tls_security_level = may smtp_use_tls = no mynetworks = 127.0.0.0/8, 10.1.11.34/32 smtpd_sender_restrictions = check_sender_access hash:/var/spool/postfix/plesk/blacklists, permit_sasl_authenticated, check_client_access pcre:/var/spool/postfix/plesk/non_auth.re smtp_send_xforward_command = yes smtpd_authorized_xforward_hosts = 127.0.0.0/8 smtpd_sasl_auth_enable = yes smtpd_recipient_restrictions = permit_mynetworks, check_client_access pcre:/var/spool/postfix/plesk/no_relay.re, reject_unauth_destination virtual_mailbox_base = /var/qmail/mailnames virtual_uid_maps = static:110 virtual_gid_maps = static:31 virtual_transport = plesk_virtual plesk_virtual_destination_recipient_limit = 1
在这种情况下,最好在/var/log/mail.log中查找答案。 一旦你有邮件的邮件标识,所有相应的条目的grepping可以给你大部分你可能需要寻找。
> grep F0CDD146E5B mail.log
而且,对于这个服务器来说,查看更多的消息与上面显示的拒绝文本是很重要的。 如果你得到这些很多,你的服务器的IP地址可能会在黑名单上。
您可以通过input您的服务器在互联网上的其他服务器上显示的IP地址来检查MX工具箱中的黑名单。 请记住,可以使用防火墙将地址映射到其他地方,以确保您知道您的公共IP地址。
对于日志logging,postfix通常被configuration为使用syslog 。 运行> postconf | grep log postconf | grep log来查看你的syslog_facilityvariables以及它是如何configuration的。 在Ubuntu系统上,这将被设置为“邮件”。
为了pipe理一个你真正不想传送的电子邮件的队列,你可以使用postsuper删除这些消息并清理你的队列。 如果消息本身不重要,则可以快速清空队列。 删除一条消息的典型语法是> postsuper -d [mail id] 。 这里有一篇关于使用postsuper的文章,它也展示了如何删除所有内容或使用针对mailq输出的模式。
我得到了黑名单,因为与我的邮件服务器共享同一个NAT地址的其他系统正在发送垃圾邮件。 如果您有任何边界控制设备(IPS,防火墙等),请检查其他系统是否将stream量发送到端口25出站。 拒绝出站SMTP是最好的做法,除非它来自您的邮件服务器。