function __RP_Callback_Helper(str, strCallbackEvent, splitSize, func){var event = null;if (strCallbackEvent){event = document.createEvent('Events');event.initEvent(strCallbackEvent, true, true);}if (str && str.length > 0){var splitList = str.split('|');var strCompare = str;if (splitList.length == splitSize)strCompare = splitList[splitSize-1];var pluginList = document.plugins;for (var count = 0; count = sSrc.length){if (strCompare.indexOf(sSrc) != -1){func(str, count, pluginList, splitList);break;}}}}if (strCallbackEvent)document.body.dispatchEvent(event);}function __RP_Coord_Callback(str){var func = function(str, index, pluginList, splitList){pluginList[index].__RP_Coord_Callback = str;pluginList[index].__RP_Coord_Callback_Left = splitList[0];pluginList[index].__RP_Coord_Callback_Top = splitList[1];pluginList[index].__RP_Coord_Callback_Right = splitList[2];pluginList[index].__RP_Coord_Callback_Bottom = splitList[3];};__RP_Callback_Helper(str, 'rp-js-coord-callback', 5, func);}function __RP_Url_Callback(str){var func = function(str, index, pluginList, splitList){pluginList[index].__RP_Url_Callback = str;pluginList[index].__RP_Url_Callback_Vid = splitList[0];pluginList[index].__RP_Url_Callback_Parent = splitList[1];};__RP_Callback_Helper(str, 'rp-js-url-callback', 3, func);}function __RP_TotalBytes_Callback(str){var func = function(str, index, pluginList, splitList){pluginList[index].__RP_TotalBytes_Callback = str;pluginList[index].__RP_TotalBytes_Callback_Bytes = splitList[0];};__RP_Callback_Helper(str, null, 2, func);}function __RP_Connection_Callback(str){var func = function(str, index, pluginList, splitList){pluginList[index].__RP_Connection_Callback = str;pluginList[index].__RP_Connection_Callback_Url = splitList[0];};__RP_Callback_Helper(str, null, 2, func);}
Jul 7 02:14:00 solaris sendmail[454]: [ID 702911 mail.crit] My unqualified host name (solaris) unknown; sleeping for retry Jul 7 02:14:01 solaris sendmail[456]: [ID 702911 mail.crit] My unqualified host name (solaris) unknown; sleeping for retry Jul 7 02:15:01 solaris sendmail[454]: [ID 702911 mail.alert] unable to qualify my own domain name (solaris) -- using short name Jul 7 02:15:01 solaris sendmail[456]: [ID 702911 mail.alert] unable to qualify my own domain name (solaris) -- using short name |
上面是syslog中的sendmail的错误信息,从log中可以看出错误的原因是hostname和domainname的问题。由于sendmail 默认先查找fully qualified hostname,从而得到domainname。但我设置hostname为solaris,sendmail没法得到完整主机名,只能使用 solaris这个短主机名。这就是上面日志的出错信息的含义。
知道出错的原因,就知道如何解决问题的方法。在solaris中,我们只需修改/etc/hosts文件,加上完整主机名就可以了。例如,我原来的/etc/hosts文件内容如下:
::1 localhost 127.0.0.1 localhost 192.168.11.11 solaris loghost |
修改成:
::1 localhost 127.0.0.1 localhost 192.168.11.11 solaris solaris.localhost.localdomain loghost |
这样,solaris中的sendmail就不会出现上述错误。我们可以用sendmail命令查看是否成功:
% /usr/lib/sendmail -d0.1 -bt < /dev/null |
-d0.1是debug的等级,-bt是地址测试,</dev/null是输入重定向。
修改前:
Version 8.14.1+Sun Compiled with: DNSMAP LDAPMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NDBM NETINET NETINET6 NETUNIX NEWDB NIS NISPLUS PIPELINING SCANF STARTTLS TCPWRAPPERS USERDB USE_LDAP_INIT XDEBUG ============ SYSTEM IDENTITY (after readcf) ============ (short domain name) $w = solaris (canonical domain name) $j = solaris (subdomain name) $m = <null> (node name) $k = solaris ======================================================== WARNING: local host name (solaris) is not qualified; see cf/README: WHO AM I? ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> Jul 7 03:59:54 solaris sendmail[1268]: [ID 702911 mail.crit] My unqualified host name (solaris) unknown; sleeping for retry Jul 7 04:00:54 solaris sendmail[1268]: [ID 702911 mail.alert] unable to qualify my own domain name (solaris) -- using short name |
修改后:
Version 8.14.1+Sun Compiled with: DNSMAP LDAPMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NDBM NETINET NETINET6 NETUNIX NEWDB NIS NISPLUS PIPELINING SCANF STARTTLS TCPWRAPPERS USERDB USE_LDAP_INIT XDEBUG ============ SYSTEM IDENTITY (after readcf) ============ (short domain name) $w = solaris (canonical domain name) $j = solaris.localhost.localdomain (subdomain name) $m = localhost.localdomain (node name) $k = solaris ======================================================== ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> > |
另外,我们还可以用以下的脚本进行测试:
/usr/lib/mail/sh/check-hostname |
修改前:
Hostname solaris could not be fully qualified. We recommend changing the /etc/hosts entry: 192.168.11.11 solaris loghost to: 192.168.180.10 solaris solaris.localhost.localdomain loghost |
修改后:
Hostname solaris OK: fully qualified as solaris.localhost.localdomain |
参考:
http://www.unix.com/unix-for-dummies-question-and-answers/8657-dmesg-on-a-sun-unqualified-host.html
很详细,谢谢!