name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
[url]http://centos.hostlink.com.hk/$releasever/os/$basearch/[/url]
[url]http://ftp.hostrino.com/pub/centos/[/url]
gpgcheck=1
enabled=1
rpm --import [url]http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt[/url]
SUPPORTED="en_US:en:en_US:zh:en_US.en:en_US:en"
SYSFONT="latarcyrheb-sun16"
Stopping cups: [ OK ]
[root@mail log]# chkconfig cups off
[root@mail log]#
Package Arch Version Repository Size
=============================================================================
Installing:
ntp i386 4.2.0.a.20040617-6.el4 base 1.2 M
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 1.2 M
Is this ok [y/N]: y
安装完毕后,就可以有ntpdatae命令了,可以使用ntpdate 命令进行同步了!否则没有ntpdate命令。
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
#02 4 * * * root run-parts /etc/cron.daily
#22 4 * * 0 root run-parts /etc/cron.weekly
#42 4 1 * * root run-parts /etc/cron.monthly
并添加命令行:意思是每隔三分钟与时钟服务器210.72.145.44同步一次时间
Stopping crond: [ OK ]
Starting crond: [ OK ]
[root@mail /]#
centos.eb.cn mail is handled by 10 mail.centos.eb.cn.
Package Arch Version Repository Size
=============================================================================
Installing:
dovecot i386 0.99.11-8.EL4 base 614 k
Installing for dependencies:
mysql i386 4.1.20-2.RHEL4.1 base 2.9 M
perl-DBI i386 1.58-2.el4.rf dag 819 k
perl-Net-Daemon noarch 0.43-1.el4.rf dag 44 k
perl-PlRPC noarch 0.2020-1.el4.rf dag 33 k
postgresql-libs i386 7.4.17-1.RHEL4.1 update 147 k
=============================================================================
Install 6 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 4.5 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): postgresql-libs-7. 16% |==== | 24 kB 00:39 ETA
Installing: perl-Net-Daemon ######################### [1/6]
Installing: perl-PlRPC ######################### [2/6]
Installing: perl-DBI ######################### [3/6]
Installing: mysql ######################### [4/6]
Installing: postgresql-libs ######################### [5/6]
Installing: dovecot ######################### [6/6]
Package Arch Version Repository Size
=============================================================================
Installing:
httpd i386 2.0.52-32.3.ent.centos4 update 888 k
Installing for dependencies:
apr i386 0.9.4-24.5.c4.2 base 88 k
apr-util i386 0.9.4-21 base 51 k
httpd-suexec i386 2.0.52-32.3.ent.centos4 update 29 k
Updating for dependencies:
initscripts i386 7.93.29.EL-1.centos4 base 1.1 M
=============================================================================
Install 4 Package(s)
Update 1 Package(s)
Remove 0 Package(s)
Total download size: 2.2 M
Downloading Packages:
(1/5): initscripts-7.93.2 9% |== | 112 kB 03:09 ETA
Running Transaction
Installing: apr ######################### [1/6]
Installing: apr-util ######################### [2/6]
Updating : initscripts ######################### [3/6]
Installing: httpd ######################### [4/6]
Installing: httpd-suexec ######################### [5/6]
Cleanup : initscripts ######################### [6/6]
7。POSTFIX的配置方法:
[root@mail postfix]# cp main.cf main.cf.bak
[root@mail postfix]# vi main.cf修改如下面所示:粉色字为待修改,绿色为修改后)
myhostname = mail.centos.eb.cn
#mydomain = domain.tld
mydomain = centos.eb.cn
myorigin = $mydomain
inet_interfaces = localhost
inet_interfaces = all
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
#mydestination = $myhostname, localhost.$mydomain, localhost
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
#relay_domains = $mydestination
#mynetworks = 168.100.189.0/28, 127.0.0.0/8
mynetworks = 10.0.0.0/8, 127.0.0.0/8
home_mailbox = Maildir/
#smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
smtpd_banner = $myhostname ESMTP mailserver maintanace by ---Weihu.Yan---
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
message_size_limit = 20971520 (表附件大小为20M,20*1024*1024)
#pwcheck_method: saslauthd
pwcheck_method: auxprop (表示不使用系统用户认证)
[root@mail postfix]# vi /etc/sysconfig/saslauthd
[root@mail postfix]# chmod 700 /etc/skel/Maildir
若已有用户,刚为已存在用户建立邮箱的方法如下:
[root@mail ~]# mkdir /home/leeki.yan/Maildir 为用户(这里以leeki.yan用户为例)建立邮箱目录
[root@mail ~]# chmod 700 /home/leeki.yan/Maildir 设置该用户邮箱目录属性为700
[root@mail ~]# chown leeki.yan. /home/leeki.yan/Maildir 设置该用户邮箱目录为该用户所有
Password:
Again (for verification):
[root@mail postfix]#
[root@mail postfix]# chgrp postfix /etc/sasldb2
[root@mail postfix]# chmod 640 /etc/sasldb2
Shutting down sendmail: [ OK ]
Shutting down sm-client: [ OK ]
[root@mail postfix]# chkconfig sendmail off
[root@mail postfix]# chkconfig --list sendmail
sendmail 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@mail postfix]# alternatives --config mta
-----------------------------------------------
*+ 1 /usr/sbin/sendmail.sendmail
2 /usr/sbin/sendmail.postfix
[root@mail postfix]#
[root@mail postfix]# chkconfig --list saslauthd
saslauthd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@mail postfix]# chkconfig postfix on
[root@mail postfix]# chkconfig --list postfix
postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@mail postfix]# /etc/rc.d/init.d/saslauthd start
Starting saslauthd: [ OK ]
[root@mail postfix]# /etc/rc.d/init.d/postfix start
Starting postfix: [ OK ]
[root@mail postfix]#
查看smtp端口是否为打开
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:809 *:* LISTEN
tcp 0 0 *:sunrpc *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 *:smtp *:* LISTEN
[root@mail postfix]#
protocols = imap imaps pop3 pop3s
#default_mail_env =
default_mail_env = maildir:~/Maildir (定义邮箱的目录)
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 143 -j ACCEPT 为imap
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
Applying iptables firewall rules: [ OK ]
[root@mail etc]#
[root@mail etc]# chkconfig dovecot on
[root@mail etc]# chkconfig --list dovecot
dovecot 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@mail etc]# /etc/rc.d/init.d/dovecot start
Starting Dovecot Imap: [ OK ]
[root@mail etc]#
至此可以测试收发,邮箱服务器的基本功能已实现!
[root@mail etc]# passwd leeki.yan
Changing password for user leeki.yan.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
添加用户测试看看吧!