Linux系统下sendmail发送邮件失败的问题
问题是:安装完sendmail,启动服务后,发送邮件第一次发送成功,后面再次无论怎么发送都不行,换邮箱也不行。在确认我的邮件发送格式正确无误后,想到查看邮件发送日志:
[root@backup-11 ~]# tail -20 /var/log/maillog
Oct
6 23:26:40 backup-11 sendmail[1307]: t96FQeu7001305:
to=<aqiang831214@163.com>, ctladdr=<zkq@backup-11>
(500/500), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120620,
relay=163mx03.mxmail.netease.com. [220.181.14.158], dsn=5.0.0,
stat=Service unavailable
Oct 6 23:26:40 backup-11 sendmail[1307]: t96FQeu7001305: t96FQeu7001307: DSN: Service unavailable
Oct
6 23:26:40 backup-11 sendmail[1307]: t96FQeu7001307:
to=<zkq@backup-11>, delay=00:00:00, xdelay=00:00:00, mailer=local,
pri=31818, dsn=2.0.0, stat=Sent
Oct 6 23:26:41 backup-11 sendmail[1291]: unable to qualify my own domain name (backup-11) -- using short name
Oct
6 23:26:41 backup-11 sendmail[1311]: t96FQf6u001309:
to=<aqiang831214@163.com>, ctladdr=<zkq@backup-11>
(500/500), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120620,
relay=163mx02.mxmail.netease.com. [220.181.14.147], dsn=5.0.0,
stat=Service unavailable
Oct 6 23:26:41 backup-11 sendmail[1311]: t96FQf6u001309: t96FQf6u001311: DSN: Service unavailable
Oct
6 23:26:41 backup-11 sendmail[1311]: t96FQf6u001311:
to=<zkq@backup-11>, delay=00:00:00, xdelay=00:00:00, mailer=local,
pri=31818, dsn=2.0.0, stat=Sent
Oct 6 23:30:01 backup-11 sendmail[1346]: My unqualified host name (backup-11) unknown; sleeping for retry
Oct 6 23:30:55 backup-11 sendmail[1368]: My unqualified host name (backup-11) unknown; sleeping for retry
Oct 6 23:31:55 backup-11 sm-msp-queue[1377]: My unqualified host name (backup-11) unknown; sleeping for retry
Oct
6 23:31:58 backup-11 sendmail[1372]: t96DlpHC039178:
to=<18919190378@189.cn>, ctladdr=<zkq@backup-11> (500/500),
delay=01:44:06, xdelay=00:00:03, mailer=esmtp, pri=480616,
relay=mta-189.21cn.com. [183.61.185.69], dsn=4.4.2, stat=Deferred
Oct 6 23:32:55 backup-11 sm-msp-queue[1377]: unable to qualify my own domain name (backup-11) -- using short name
通过查看以上日志终于让我找到了蛛丝马迹,呵呵,如下:
DSN: Service unavailable
My unqualified host name (backup-11) unknown; sleeping for retry
unable to qualify my own domain name (backup-11) -- using short name
stat=Deferred
stat=Service unavailable
通过查找资料,解决办法如下:
1.[root@backup-11 ~]# vi /etc/mail/access
# of the format of this file. (search for access_db in that file)
# package.
#
# If you want to use AuthInfo with "M:PLAIN LOGIN", make sure to h
ave the
# cyrus-sasl-plain package installed.
#
# By default we allow relaying from localhost...
Connect:localhost.localdomain RELAY
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
Connect:10.0.0.11 RELAY
Connect:192.168.0.254 RELAY
2.在 /etc/hosts.allow 中加入以下行:
sendmail : backup-11 #主机名
sendmail : 10.0.0.11 #发送邮件服务器IP地址
3.可以用hostanme 命令临时修改主机名,hostname aa.com;
4.[root@backup-11 ~]# vi /etc/mail/sendmail.cf
找到:
# SMTP daemon options
O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA
添加:
# SMTP daemon options
O DaemonPortOptions=Port=smtp,Addr=你的IP, Name=MTA
保存!
切记:修改完hostname以后需要重启sendmail 服务,重启服务后,一切ok.
Linux系统下sendmail发送邮件失败的问题的更多相关文章
- linux系统下sendmail的搭建
学习鸟哥linux私房菜所得 sendmail 可以使用rpm -qa |grep sendmail来查看一下是否已安装sendmail-cf和sendmail 如果没有安装可用yum -y inst ...
- Linux SendMail发送邮件失败诊断案例(四)
最近又碰到一起Linux下SendMail发送邮件失败的案例,邮件发送后,邮箱收不到具体邮件, 查看日志/var/log/maillog 发现有"DSN: User unknown" ...
- Linux SendMail发送邮件失败诊断案例(三)
一Linux服务器突然发送不出邮件,检查了很多地方都没有发现异常,检查/var/log/maillog发现如下具体信息: Apr 12 00:36:04 mylinux sendmail[4685]: ...
- 在Linux系统下mail命令的用法
在Linux系统下mail命令的测试 1. 最简单的一个例子: mail -s test admin@aispider.com 这条命令的结果是发一封标题为test的空信给后面的邮箱,如果你有mta并 ...
- linux系统下邮件的发送
在linux系统下发送邮件一般都要要求本地的机器必须安装和启动Sendmail服务,配置非常麻烦,而且会带来不必要的资源占用. 其实我还可以安装mailx软件,通过修改配置文件可以使用外部SMTP服务 ...
- linux系统下的软连接与硬链接
前几天在linux系统下安装mongoDB,然后运行脚本导入数据的时候遇到了链接库查询不到的情况,如图 1所示.当时是通过创建软连接的方式解决的这个问题.虽然,通过网上的教程解决了这个问题,但是对于软 ...
- linux系统下搭建自己的web服务器
之前在windows 2008 server上搭建了一个用于测试的web服务器,但是在打开网站的时候特别的慢,尤其是图片的加载都会失败,当时以为是路径的问题,但是在服务器上自己打开都特别慢,自己实在找 ...
- Linux系统下权限管理和命令详解
下面对linux系统下的有关权限操作命令进行了梳理总结,并配合简单实例进行说明.linux中除了常见的读(r).写(w).执行(x)权限以外,还有其他的一些特殊或隐藏权限,熟练掌握这些权限知识的使用, ...
- 【转】Linux系统下的ssh使用
Linux系统下的ssh使用(依据个人经验总结) 对于linux运维工作者而言,使用ssh远程远程服务器是再熟悉不过的了!对于ssh的一些严格设置也关系到服务器的安全维护,今天在此,就本人工作中使 ...
随机推荐
- 【Android 界面效果30】Android中ImageSwitcher结合Gallery展示SD卡中的资源图片
本文主要是写关于ImageSwitcher结合Gallery组件如何展示SDCard中的资源图片,相信大家都看过API Demo 中也有关于这个例子的,但API Demo 中的例子是展示工程中Draw ...
- leetcode 题解:Binary Tree Inorder Traversal (二叉树的中序遍历)
题目: Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary ...
- C#生成DBF文件
C# 生成DBF,无需注册Microsoft.Jet.OLEDB. namespace ConsoleApplication { class Program { static void Main(st ...
- 新手教程之使用Xib自定义UITableViewCell
新手教程之使用Xib自定义UITableViewCell 前言 首先:什么是UITableView?看图 其次:什么是cell? 然后:为什么要自定cell,UITableView不是自带的有cell ...
- (转)Git Gui for Windows的建库、克隆(clone)、上传(push)、下载(pull)、合并
原文地址: http://blog.csdn.net/fym0512/article/details/7713006 本教程将讲述:gitk的Git Gui的部分常用功能和使用方法,包括:建库.克隆( ...
- Oracle 11g R2 for Win7旗舰版(64位)的安装步骤
1.下载Oracle 11g R2 for Windows的版本 下载地址:http://www.oracle.com/technetwork/database/enterprise-edition/ ...
- self.view添加UIView时添加动画
CATransition *animation = [CATransition animation]; animation.delegate = self; animation.duration = ...
- 【转载】MQTT学习笔记——MQTT协议体验 Mosquitto安装和使用
http://blog.csdn.net/xukai871105/article/details/39252653 0 前言 MQTT是IBM开发的一个即时通讯协议.MQTT是面向M2M和物联 ...
- AndroidStudio开发工具快捷键
在这里,自己整理了下在使用AndroidStudio开发工具所使用到的一些快捷键提示,也出于在开发过程中节省时间提升效率,然而可能多数开发者之前使用的都是Eclipse开发工具,可能开始都不习惯,但是 ...
- mac下apache的多站点配置
以下操作均建立在 已经配置好了php环境 从网上搜索了下,后来自己配置了下还是比较简单的! 我的环境目录是在/Library/webServer/Documents 测试的时候可以直接在这里建立 ...