我正在使用 Debian Jessie 服务器并且有设置 出口4向我发送电子邮件而不是 postfix 或 sendmail。
就在那时,我开始收到大量电子邮件,如下所示:
第一的:
标题:* vultr.guest 的安全信息 *
正文:vultr.guest:12 月 7 日 12:13:29:root:无法解析主机 vultr.guest
第二:
标题: Cron 测试 -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp
身体:
This is an automatically generated Delivery Status Notification THIS IS A WARNING MESSAGE ONLY. YOU DO NOT NEED TO RESEND YOUR MESSAGE. Delivery to the following recipient has been delayed: [email protected] Message will be retried for 2 more day(s) Technical details of temporary failure: The recipient server did not accept our requests to connect. Learn more at https://support.google.com/mail/answer/7720 [(10) example.com. [xxx.xxx.xxx.90]:25: socket error] ----- Original message ----- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:mime-version:content-type:content-transfer-encoding :message-id:date; bh=k/8GlT8DBvBIJzBOOfw8qR0kGPzj7m9ZR/aj+JOKBhg=; b=eA6kpVtS0eNBO0CFBfLzlnaYwZ9/GubMaWTGUkG4MaxbNy55YxY2jZAuh3RHI2mo8Q qp5OmKihchYTgCxcAx0xvJaXuuxDhoT9dCJ6YEIzqjmypWjpUEqoXkNu7uKU4Cd1vTfS 5/dSvE7zVE6TYe4L18vrOiYBEUNrJQ3lTdv//RrlHZs/f62GorIyMHgVL4XvkVNLWF/K lK9SSybf9ee3KTKUxurBm1Tyah62Gk4/869Hynr1QEAjSAzM8sSKDyKH/KOZ06sDWtPQ jE0Agxffk8RkhsFkEtIbpZBfS/zagGZ8+CXsGqR9541ylMAHGOGeYtRp4oiB8tVP2Sbv h4Rw== X-Received: by 10.129.114.10 with SMTP id n10mr3081975ywc.0.1449600002717; Tue, 08 Dec 2015 10:40:02 -0800 (PST) Return-Path: <[email protected]> Received: from vultr.guest ([104.156.246.90]) by smtp.gmail.com with ESMTPSA id f203sm2998216ywf.45.2015.12.08.10.40.02 for <[email protected]> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2015 10:40:02 -0800 (PST) From: Cron Daemon <[email protected]> X-Google-Original-From: [email protected] (Cron Daemon) Received: from smmsp by vultr.guest with local (Exim 4.84) (envelope-from <[email protected]>) id 1a6NBB-0007Vu-Os for [email protected]; Tue, 08 Dec 2015 13:40:01 -0500 To: [email protected] Subject: Cron <smmsp@vultr> test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Cron-Env: <MAILTO=root> X-Cron-Env: <SHELL=/bin/sh> X-Cron-Env: <HOME=/var/lib/sendmail> X-Cron-Env: <PATH=/usr/bin:/bin> X-Cron-Env: <LOGNAME=smmsp> Message-Id: <[email protected]> Date: Tue, 08 Dec 2015 13:40:01 -0500
我编辑并首先尝试将线路/etc/cron.d/sendmail
更改为我的 Gmail 地址。但这没有帮助。所以我评论了该行,然后MAILTO=
root
*/20 * * * * smmsp test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp
这使得它不再每 20 分钟向我发送垃圾邮件一次。但我仍然经常收到很多电子邮件
主题:* vultr.guest 的安全信息 * 身体:
This is an automatically generated Delivery Status Notification
THIS IS A WARNING MESSAGE ONLY.
YOU DO NOT NEED TO RESEND YOUR MESSAGE.
Delivery to the following recipient has been delayed:
[email protected]
Message will be retried for 1 more day(s)
Technical details of temporary failure:
The recipient server did not accept our requests to connect. Learn more at https://support.google.com/mail/answer/7720
[(10) example.com. [xxx.xxx.xxx.90]:25: socket error]
我确实修改/etc/hostname
并删除了vultr.guest
它并用example.com
.我/etc/hosts
只有:
127.0.0.1 localhost
127.0.1.1 install.install install
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
我配置错了什么?我该如何解决它?
更新:/etc/exim4/update-exim4.conf.conf
内容是:
dc_eximconfig_configtype='satellite'
dc_other_hostnames=''
dc_local_interfaces='127.0.0.1 ; ::1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.gmail.com::587'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='true'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
答案1
我觉得VULTR的教程不正确。当您通过 来配置 exim4 时dpkg-reconfigure exim4-config
,它们会告诉您选择mail sent by smarthost; no local mail
,并按如下方式配置:
System mail name: YOUR_HOSTNAME
IP-addresses to listen on for incoming SMTP connections: 127.0.0.1 ; ::1
Other destinations for which mail is accepted: <BLANK>
Visible domain name for local users: <BLANK>
IP address or host name of the outgoing smarthost: smtp.gmail.com::587
Keep number of DNS-queries minimal (Dial-on-Demand)? No
Split configuration into small files? No
Root and postmaster mail recipient: <BLANK>
但我怀疑应该Other destinations for which mail is accepted:
是这样BLANK
。如果您配置它,请添加您的电子邮件地址或您的example.com
域/电子邮件。
否则,请尝试编辑以下位置:
root: [email protected]
mailer-daemon: [email protected]
postmaster: [email protected]
nobody: [email protected]
hostmaster: [email protected]
usenet: [email protected]
news: [email protected]
webmaster: [email protected]
www: [email protected]
www-data: [email protected]
ftp: [email protected]
abuse: [email protected]
noc: [email protected]
security: [email protected]
*: [email protected]
并编辑/etc/email-addresses
以包含用户:电子邮件组合:
root: [email protected]
mail: [email protected]
*: [email protected]
然后重新启动
service sendmail restart
并service exim4 restart