Linux下架构安全邮件服务器之Sendmail(5)

二、sina.com配置:

把163.com主机配置,克隆一份,进行相应修改即可!

注意:克隆前必须把电源关掉

如果sendmail启动比较慢,可以在1级别进行修改!( 出现红色界面:按b  e   末尾输入1)

1.手动配置ip

[root@mail ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
[root@mail ~]# cat  /etc/sysconfig/network-scripts/ifcfg-eth0
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
HWADDR=00:0c:29:5b:98:33
NETMASK=255.255.255.0
IPADDR=192.168.10.9
TYPE=Ethernet

2.修改dns 配置

[root@mail etc]# vim named.conf     //5个any
[root@mail etc]# vim named.rfc1912.zones

[root@mail named]# pwd
/var/named/chroot/var/named
[root@mail named]# cp -p 163.com.zone sina.com.zone
[root@mail named]# vim sina.com.zone

dns指向
[root@mail ~]# vim /etc/resolv.conf
[root@mail ~]# cat /etc/resolv.conf
search domain.org
nameserver 192.168.10.9

3.修改主机名
[root@mail ~]# vim /etc/sysconfig/network
[root@mail ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=mail.sina.com

[root@mail ~]# hostname
mail.163.com        //发现名字并没有改变过来

需要重启,如果不想重启,只需重命名后,重新登录即可!
[root@mail ~]# hostname mail.sina.com    //重命名

4.修改sendmail配置

[root@mail mail]# vim sendmail.mc  

116 行,任意地址都可以telnet上该主机的25端口
[root@mail mail]# vim access


 

sendmail服务重启
[root@mail ~]# service sendmail status
sendmail is stopped
[root@mail ~]# service sendmail restart
Shutting down sendmail:                                    [FAILED]
Starting sendmail:                                         [  OK  ]
Starting sm-client:                                        [  OK  ]
5.查看接收服务器端口:
[root@mail ~]# netstat -tupln |grep dovecot
tcp        0      0 :::993                      :::*                        LISTEN      3166/dovecot       
tcp        0      0 :::995                      :::*                        LISTEN      3166/dovecot       
tcp        0      0 :::110                      :::*                        LISTEN      3166/dovecot       
tcp        0      0 :::143                      :::*                        LISTEN      3166/dovecot       
You have mail in /var/spool/mail/root

6.查看账号:

[root@mail ~]# tail /etc/passwd
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
gdm:x:42:42::/var/gdm:/sbin/nologin
avahi-autoipd:x:100:103:avahi-autoipd:/var/lib/avahi-autoipd:/sbin/nologin
sabayon:x:86:86:Sabayon user:/home/sabayon:/sbin/nologin
named:x:25:25:Named:/var/named:/sbin/nologin
user1:x:500:500::/home/user1:/bin/bash
user2:x:501:501::/home/user2:/bin/bash
dovecot:x:97:97:dovecot:/usr/libexec/dovecot:/sbin/nologin

彻底删除这两个帐号!
[root@mail ~]# userdel -r user1
[root@mail ~]# userdel -r user2

创建新账号:
[root@mail ~]# useradd user3
[root@mail ~]# passwd        设置密码
Changing password for user root.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@mail ~]# useradd user4
[root@mail ~]# passwd
Changing password for user root.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

7.所有服务重启

8.查看dns解析


 

9. 测试:

9.1windows 下telnet 上写信

 

windows 下收信:

查看后退出时输入X 信件还保留在邮箱中,输入q时,信件保留在家目录下的mbox里!

9.2 windows 下使用客户端软件测试收发情况:

创建了两个账号:user3 、user4

点击“发送”

解析下mx:

linux

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/9074ad4036b47627976038a97730a694.html