/ 中存储网

在Aix系统配置sendmail邮件服务器步骤及常见问题

2014-07-21 12:03:17 来源:中存储网

  当你的AIX操作系统安装完毕后,通常我们只需按照缺省配置启动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)

  --------------------------------------------