发新话题
打印

[转载]solaris安装SMTP Server

[转载]solaris安装SMTP Server

  信息来源:邪恶八进制信息安全团队

从软件磁带中,得到sendmail-8.8.8-for-solaris2.5.1.tar.Z软件包,放到/tmp下。

#zcat sendmail-8.8.8-for-solaris2.5.1.tar.Z | tar xvf -
#cd sendmail-8.8.8 ; ./install
#rm /tmp/sendmail-8.8.8-for-solaris2.5.1.tar.Z

注:有时根据情况,需要修改/etc/mail/sendmail.cf文件内容。在配置更改后,必须杀死系统中所有的sendmail进程,重新启动sendmail。

# ps -ef | grep sendmail | awk ‘{print $2}’ | xargs -l kill -9
# /usr/lib/sendmail -q1h -bd

测试sendmail

#telnet 0 25 (server正常可以看到sendmail的信息)
#mailx -v root@localhost < /etc/hosts (root应收到内容为hosts文件的mail)

附:限制接收MAIL的几种方式

1、对主机进行限制:使用TCP_WRAPPER对指定主机的MAIL进行限制,同时SENDMAIL进程必须由INETD来控制,加入一行

smtp stream tcp nowait root /usr/local/security/tcp_wrapper/bin/tcpd
/usr/lib/sendmail -bs

同时,单独启动下面进程:

# /usr/lib/sendmail -q1h

修改/etc/rc2.d/S88sendmail文件禁止主机启动时以后台方式启动sendmail进程,将其改为/usr/lib/sendmail -q1h

对SUBJECT或FROM进行限制:A、修改sendmail原程序,在sendmail进程会话期间,根据SUBJECT内容来决定是否收MAIL;B、通个在后台运行SHELL程序,对用户的MAIL BOX进行分析,删除不需要的邮件。

3、通过TIS来实现对MAIL的限制:首先修改/etc/inetd.conf文件,增加一行:

smtp stream tcp nowait root /usr/local/tis/etc/netacl smap

然后在/etc/rc3.d/S99local文件中加入

#cd /var/spool/mqueue; rm -f nf* lf*
#/usr/local/tis/etc/smapd &
#/usr/local/tis/etc/mqueue &
#/usr/local/tis/etc/smap -daemon &(在Standalone方式时使用这一条命令)

在/var/spool目录下创建目录smap,权限由配置文件/usr/local/tis/etc/netperm-table来决定,修改/etc/rc2.d/S88sendmail文件禁止主机启动时启动sendmail进程。
qq310926是我唯一用号,除此之外有其他号码号自称邪八冰血封情,则非本人。

TOP

发新话题