在系统安装完毕后,通常我们只需按照缺省配置启动sendmail邮件服务就可以用mail,outlook,foxmail等常用工具收发邮件了。
简单操作如下:
# startsrc -s sendmail -a “-bd -q30m” (启动邮件服务后台进程)
# vi /etc/inetd.conf, (uncomment the following line)
pop3 --stream --tcp --nowait --root-- /usr/sbin/pop3d pop3d
# refresh -s inetd (刷新超级守护进程,允许pop3客户端连接)
常见问题一、
当我们需要把AIX服务器的root信箱转发到我们的常用个人信箱以保证及时收到系统发出的重要warning或者报错的话,我们就要配置aliases别名。
举例如下(红色为我们需要输入的命令,蓝色为我们需要编辑加入的内容)
# vi /etc/aliases
# Alias for mailer daemon
MAILER-DAEMON:root
# Following alias is required by the new mail protocol, RFC 822
postmaster:root
# Aliases to handle mail to msgs and news
nobody: /dev/null
# Alias to which SSA related warnings are mailed
ssa_adm: root
# Alias for admin issue
root: root,test@cn.sendmail.com
要使改动生效,有两种办法
(1) # sendmail -bi
(2) # newaliases
当执行命令遇到如下信息时,我们需要检查目录的许可权限是否设对。
# newaliases
WARNING: Group writable directory /var/spool
WARNING: Group writable directory /var/spool/mqueue
/etc/mail/aliases: 5 aliases, longest 17 bytes, 78 bytes total
# ls -dl /var/spool
drwxrwxr-x --12 bin --bin -- --512 Dec 19 11:26 /var/spool
# ls -dl /var/spool/mqueue
drwxrwxr-x --2 root --system --512 Mar 17 18:08 /var/spool/mqueue
# chmod 755 /var/spool
# chmod 755 /var/spool/mqueue
# newaliases
/etc/mail/aliases: 5 aliases, longest 17 bytes, 78 bytes total
另一种警告信息的解决
# sendmail -bi
WARNING: World writable directory /etc
dbm map "Alias0": unsafe map file /etc/aliases
WARNING: cannot open alias database /etc/aliases
Cannot create database for alias file /etc/aliases: A system call received a par
ameter that is not valid.
# ls -dl /etc
drwxrwxrwx --30 root --system ----4096 Mar 17 10:35 /etc
# chmod 755 /etc
# sendmail -bi
/etc/aliases: There are 4 aliases. The longest is 9 bytes, with 57 bytes total.
备注:
除此aliases全局设置方法外,我们还可以编辑用户自己属主目录下的$HOME/.forward
add line with the target mail address, for example
test@cn.sendmail.com
存盘退出后,凡是发到用户的信都会同时转发到test@cn.sendmail.com
常见问题二、
当我们的/etc/sendmail.cf被误删除,或者被损坏,或者被改的面目全非时,如何处理?
(1) # cp /usr/lpp/bos.net/inst_root/etc/mail/sendmail.cf
/etc/sendmail.cf
备注:在/usr/lpp/bos.net/inst_root/etc目录下有很多系统文件的重要拷贝,如
inetd.conf/rc.tcpip/syslog.conf 等许多许多。
(2) 重新创建 sendmail.cf(以AIX 4.3.3为例) 步骤如下:
首先我们要确认系统中存在下列文件集: bos.adt.base & bos.net.tcp.adt
AIX 将产生定制sendmail配置文件的工具和宏放在/usr/samples/tcpip/sendmail/cf
具体操作步骤如下:
#cd /usr/samples/tcpip/sendmail/cf
这里有我们需要的文件aix433.mc. 它包含我们需要定制的sendmail特性
#cp aix433.mc mysendmail.mc 创建它的一份拷贝
#vi mysendmail.mc
divert(0)dnl
OSTYPE(aix43)dnl
FEATURE(genericstable)dnl
FEATURE(mailertable)dnl
FEATURE(virtusertable)dnl
FEATURE(domaintable)dnl
FEATURE(allmasquerade)dnl
FEATURE(promiscuous_relay)dnl
FEATURE(accept_unresolvable_domains)dnl
FEATURE(accept_unqualified_senders)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(uucp)
编辑修改后如下:
#more mysendmail.mc
--------------------------------------------
divert(0)dnl
OSTYPE(aix433)dnl
FEATURE(allmasquerade)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(uucp)
--------------------------------------------
注意:在mysendmail.mc中,注释是不起作用的,所以不需要的feature 一定要删除,否则在生成sendmail配置文件时会出错。
下面我们要创建sendmail.cf
# cd /usr/samples/tcpip/sendmail/cf
# m4 ../m4/cf.m4 mysendmail.mc > mysendmail.cf
# mv mysendmail.cf /etc/sendmail.cf
常见问题三、
当我们用mail -v发送邮件时,发现要过很长时间才能发出才回到提示符,该如何处理?
# mail -v ql
Subject: test
Just a test
.
Cc:
WARNING: The local host name (r6f50) does not have a domain; fix $j in config fi
le
ql... Connecting to local...
ql... Sent
这个问题的产生是由于我们在sendmail.cf中并未指定域名,那么sendmail宏在处理$j时不知怎么办,那么会延长daemon的处理时间。解决办法是使用空域名。
# vi /etc/hosts
ipaddress hostname hostname.
主要是在原来的记录上加hostname和一个点”.”然后存盘退出
# mail -v ql
Subject: test
Just a test
.
Cc:
ql... Connecting to local...
ql... Sent
再次发送测试,显示问题已经解决。
注意事项:
上述问题是以AIX 4.3.3为例,如果你的系统是AIX 5L,应灵活应用并注意其区别
例如 5.1 的配置文件是/etc/mail/sendmail.cf & /etc/mail/aliases, 但4.3.3的配置是/etc/sendmail.cf & /etc/aliases.
mhxiaoyi 回复于:2003-05-06 17:07:52 |
请问在此步怎么弄?
#vi/etc/inetd.conf,(uncommentthefollowingline) pop3--stream--tcp--nowait--root--/usr/sbin/pop3dpop3d 在我#vi/etc/inetd.conf之后出现了 ## @(#)62 1.17.1.13 src/tcpip/etc/inetd.conf, tcpip, tcpip43K, 9825A_43K 6/18/98 11:25:54 ## ## COMPONENT_NAME: TCPIP inetd.conf ## ## FUNCTIONS: ## ## ORIGINS: 26 27 ## ## (C) COPYRIGHT International Business Machines Corp. 1993 ## All Rights Reserved ## Licensed Materials - Property of IBM ## ## US Government Users Restricted Rights - Use, duplication or ## disclosure restricted by GSA ADP Schedule Contract with IBM Corp. ## ####################################################################### ## ## Internet server configuration database ## ## Services can be added and deleted by deleting or inserting a ## comment character (ie. #) at the beginning of a line If inetd ## is running under SRC control then the "refresh -s inetd" command "/etc/inetd.conf" [Read only] 88 lines, 4347 characters 我不太明白,谢谢!! ![]() |
老农 回复于:2003-05-06 17:42:42 |
学会基本的vi使用就会了:) |
mhxiaoyi 回复于:2003-05-07 17:08:53 |
# refresh -s inted
0513-085 inted 子系统不在文件上。 这是什么意思? 偶比较愚笨!!!请指教 |
燕狂徒 回复于:2003-05-07 19:44:49 |
[quote:ddad844a7f="mhxiaoyi"]# refresh -s inted
0513-085 inted 子系统不在文件上。 这是什么意思? 偶比较愚笨!!!请指教[/quote:ddad844a7f] 我晕我晕我晕晕晕 是inetd |
june_cai 回复于:2003-05-07 23:55:19 |
我出现了楼上同样的问题,sendmail是下载的sendmail-8.11.6.0.exe文件安装的,安装没有多大的问题,但是我找不到pop3文件/usr/sbin里面根本没有这个东西.还望解释,没装过阿 |
mhxiaoyi 回复于:2003-05-08 09:17:10 |
[quote:d61495e0b2="燕狂徒"]
我晕我晕我晕晕晕 是inetd[/quote:d61495e0b2] 别晕,我知道了, ![]() 不过你的第一篇确实写错了,我这个菜鸟就跟着瞎撞了~~~~~ ![]() |
june_cai 回复于:2003-05-08 09:27:25 |
急啊,哪位老大告诉我,我下载安装以后,在/usr/sbin目录里找不到pop3d的文件啊,编辑inetd.conf文件,里面并没有pop3--stream--tcp--nowait--root--/usr/sbin/pop3dpop3d 这一行,所以只好自己加上去,refresh以后,出现0513-085错误,不明白,用outlook是找不到服务器的。
应该是POP3没有起来,另外SMTP是不是有什么设置的, 不好意思,本人对邮件系统不是很熟,可能问的问题比较幼稚,请大家指点。 最好有人能提供一份安装的文挡,我只是下载了sendmail的软件。里面并没有安装的文挡。 |
zorrozolo 回复于:2003-05-08 15:21:33 |
装个pop3 服务试试 |
june_cai 回复于:2003-05-08 16:48:42 |
系统本身带pop3吗?有的话怎么装啊,没有的话,要去哪里下载啊? |
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/