Chinaunix首页 | 论坛 | 博客
  • 博客访问: 103188
  • 博文数量: 30
  • 博客积分: 300
  • 博客等级: 二等列兵
  • 技术积分: 253
  • 用 户 组: 普通用户
  • 注册时间: 2011-12-08 00:35
文章分类

全部博文(30)

文章存档

2012年(16)

2011年(14)

我的朋友

分类: 系统运维

2012-05-31 08:54:40

在系统安装完毕后,通常我们只需按照缺省配置启动Sendmail邮件服务就可以用mailOutLookFoxmail等常用工具收发邮件了。

  简单操作如下:

  # 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. 

阅读(2839) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~