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

8.安装邮件接收服务器:(MAA)

[root@mail cdrom]# cd /mnt/cdrom/Server
[root@mail Server]# ll dove*
-r--r--r-- 264 root root 1736855 Dec 10  2008 dovecot-1.0.7-7.el5.i386.rpm
[root@mail Server]# rpm -ivh dovecot-1.0.7-7.el5.i386.rpm
warning: dovecot-1.0.7-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
    libmysqlclient.so.15 is needed by dovecot-1.0.7-7.el5.i386
    libmysqlclient.so.15(libmysqlclient_15) is needed by dovecot-1.0.7-7.el5.i386
[root@mail Server]# rpm -ivh mysql-5.0.77-3.el5.i386.rpm
warning: mysql-5.0.77-3.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
    perl(DBI) is needed by mysql-5.0.77-3.el5.i386 
 

[root@mail Server]# rpm -ql dovecot |less

/etc/dovecot.conf      //主配置文件
/etc/pam.d/dovecot   //PAM
/etc/pki/dovecot       //支持证书!
/etc/pki/dovecot/certs

[root@mail Server]# vim /etc/dovecot.conf

该行可有选择地使用!

 

10.启动sendmail服务,查看其端口

[root@mail Server]# netstat -tupln |grep send
tcp        0      0 127.0.0.1:25      0.0.0.0:*         LISTEN      3824/sendmail: acce

注意:127.0.0.0.1只能在本地进行进行中继~

11.创建本地账号:

[root@mail mail]# useradd user1
[root@mail mail]# passwd user1
Changing password for user user1.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@mail mail]# useradd user2
[root@mail mail]# passwd user2

12.本地写封信测试:

普通测试:

[root@mail mail]# mail -s gjp user1
welcome!
.
Cc:
[root@mail mail]# su - user1
[user1@mail ~]$ mail

Mail version 8.1 6/6/93.  Type ? for help.
"/var/spool/mail/user1": 2 messages 2 new
>N  1 root@mail.163.com     Fri Aug  3 16:37  16/569   "gjp"


& 1
Message 1:
From root@mail.163.com  Fri Aug  3 16:37:24 2012
Date: Fri, 3 Aug 2012 15:49:05 +0800
From: root <root@mail.163.com>
To: user1@mail.163.com
Subject: gjp

welcome!

& quit2
Saved 2 messages in mbox
[user1@mail ~]$ ll
total 4
-rw------- 1 user1 user1 1160 Aug  3 16:45 mbox

[user1@mail ~]$ cat mbox   //存放已看过的信件

[user1@mail ~]$ pwd
/home/user1         //看过的信件在家目录下!

telnet 所监听的端口测试:

[root@mail Server]# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.163.com ESMTP Sendmail 8.13.8/8.13.8; Fri, 3 Aug 2012 16:52:39 +0800

helo 127.0.0.1    //问候
250 mail.163.com Hello localhost.localdomain [127.0.0.1], pleased to meet you
mail from :user1@163.com    //发件人
250 2.1.0 user1@163.com... Sender ok
rcpt to :user2@163.com     // 收件人
250 2.1.5 user2@163.com... Recipient ok
data         开始写信息
354 Enter mail, end with "." on a line by itself
subject nice to meet you !     // 标题
 Welcome to here !               //内容
.              // 点号结束
250 2.0.0 q738qdqg003907 Message accepted for delivery

quit     //退出
221 2.0.0 mail.163.com closing connection
Connection closed by foreign host.
You have new mail in /var/spool/mail/root

linux

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

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