postfix是Wietse Venema在IBM的GPL协议之下开发的MTA(邮件传输代理)软件。postfix是Wietse Venema想要为使用最广泛的sendmail提供替代品的

个尝试。在Internet世界中,大部分的电子邮件都是通过sendmail来投递的,大约有100万用户使用sendmail,每天投递上亿封邮件。这真是一个让人吃惊

数字。Postfix试图更快、更容易管理、更安全,同时还与sendmail保持足够的兼容性。

上篇笔者只做的postfix配置的简单介绍,下篇中笔者将使用web方式实现对postfix邮件接收发送的管理

一:修改主机名:

[root@mail ~]# vim /etc/sysconfig/network

postfix基础篇_替代品 

[root@mail ~]# vim /etc/hosts

postfix基础篇_postfix_02

二:搭建本地yum:

[root@mail ~]# vim /etc/yum.repos.d/rhel-debuginfo.repo

postfix基础篇_postfix_03

三:搭建dns服务器:

[root@mail ~]# mkdir /mnt/cdrom

[root@mail ~]# mount /dev/cdrom /mnt/cdrom/

[root@mail ~]# cd /mnt/cdrom/Server/

[root@mail Server]# yum install bind  -y       #安装dns主程序

[root@mail Server]# yum install bind-chroot –y      #安装与安全有关的软件包

[root@mail Server]# yum install caching-nameserver –y      #安装与缓存有关的软件包

[root@mail Server]# cd /var/named/chroot/etc/

[root@mail etc]# cp -p named.caching-nameserver.conf named.conf

[root@mail etc]# vim named.conf         #编辑主配置文件

postfix基础篇_替代品_04 

postfix基础篇_替代品_05

postfix基础篇_替代品_06

[root@mail etc]# vim named.rfc1912.zones        #编辑区域声明文件

postfix基础篇_替代品_07

[root@mail etc]# cd ../var/named/

[root@mail named]# cp -p localhost.zone sina.com.db     

[root@mail named]# vim sina.com.db        #编辑数据库文件

postfix基础篇_postfix_08

[root@mail named]# vim /etc/resolv.conf       #编辑本地dns指向

postfix基础篇_开发_09

[root@mail named]# service named start

[root@mail named]# chkconfig named on       #开机自动启动

四:搭建postfix邮件发送服务器

[root@mail named]# cd /mnt/cdrom/Server/

[root@mail Server]# yum install postfix –y        #使用yum安装postfix

postfix基础篇_postfix_10

postfix基础篇_开发_11

postfix基础篇_postfix_12

postfix基础篇_替代品_13

postfix基础篇_开发_14

postfix基础篇_替代品_15

[root@mail Server]# service postfix start        #开启postfix

五:搭建dovecot邮件接收服务器:

[root@mail Server]# yum install dovecot –y       #安装dovecot主软件包

[root@mail Server]# rpm -ql dovecot |less      #查看dovecot安装的位置

postfix基础篇_替代品_16 

[root@mail Server]# vim /etc/dovecot.conf       #编辑dovecot的主配置文件

postfix基础篇_postfix_17

[root@mail Server]# service dovecot start       #启动dovecot

[root@mail Server]# chkconfig dovecot on       #设置为开机自动启动

六:创建用户:

[root@mail Server]# useradd user1

[root@mail Server]# passwd user1

[root@mail Server]# useradd user2

[root@mail Server]# passwd user2

测试:在本地服务器上进行测试:

user1向user2发送邮件:

[root@mail Server]# telnet 127.0.0.1 25      #登录本地邮件服务器

postfix基础篇_postfix_18

[root@mail Server]# su – user2        #切换到user2用户

[user2@mail ~]$ mail     #查看邮件

postfix基础篇_替代品_19

user2向user1发送邮件:

[root@mail Server]# telnet 127.0.0.1 25

postfix基础篇_替代品_20

[root@mail Server]# su – user1      #切换到用户user1

[user1@mail ~]$ mail    #查看邮件

postfix基础篇_替代品_21

测试:使用windows  server  2003自带的outlook  express工具进行测试:

点击:开始——》程序——》outlook express

postfix基础篇_替代品_22

postfix基础篇_开发_23

postfix基础篇_postfix_24

postfix基础篇_替代品_25

postfix基础篇_postfix_26

postfix基础篇_postfix_27

postfix基础篇_开发_28

postfix基础篇_替代品_29

依照以上方法创建user2即可,这里不再赘述!!!

user1向user2发送邮件:

postfix基础篇_替代品_30

postfix基础篇_替代品_31

postfix基础篇_postfix_32

user2向user1发送邮件:

postfix基础篇_postfix_33

postfix基础篇_postfix_34

postfix基础篇_开发_35