1. Installation centos4.4, choose to install only a "Development Tools" package, the other did not check, the installation has finished;
2. Yum update database configuration:
[root @ mail] # vi / etc / yum.repos.d / dag.repo
[dag]
name = Dag RPM Repository for Red Hat Enterprise Linux
baseurl = http://apt.sw.be/redhat/el $ releasever / en / $ basearch / dag
http://mirror.be10.com/centos/ $ releasever / os / $ basearch /
http://centos.hostlink.com.hk/ $ releasever / os / $ basearch /
http://ftp.hostrino.com/pub/centos/
gpgcheck = 1
enabled = 1
[root @ mail] # rpm - import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
Another import: (not imported here)
[root @ mail] # rpm - import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4
3. Display garbled putty to connect to solve:
vi / etc/sysconfig/i18n content will be replaced by the following inside;
LANG = "en_US: en"
SUPPORTED = "en_US: en: en_US: zh: en_US.en: en_US: en"
SYSFONT = "latarcyrheb-sun16"
4. Closed cups (print services),
[root @ mail log] # / etc / rc.d / init.d / cups stop
Stopping cups: [OK]
[root @ mail log] # chkconfig cups off
[root @ mail log] #
5. Solve the problem of time synchronization:
[root @ mail ~] # yum install ntp
Dependencies Resolved
================================================== ===========================
Package Arch Version Repository Size
================================================== ===========================
Installing:
ntp i386 4.2.0.a.20040617-6.el4 base 1.2 M
Transaction Summary
================================================== ===========================
Install 1 Package (s)
Update 0 Package (s)
Remove 0 Package (s)
Total download size: 1.2 M
Is this ok [y / N]: y
After installation, you can have a ntpdatae command, you can use the ntpdate command to sync! Otherwise there is no command ntpdate.
[root @ mail /] # vi / etc / crontab
The following:
01 * * * * root run-parts / etc / cron.hourly
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
Amended to read:
# 01 * * * * root run-parts / etc / cron.hourly
# 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
And add the command line: means the clock every three minutes with a time synchronization server 210.72.145.44
* / 3 * * * * root / usr / sbin / ntpdate 210.72.145.44> / dev / null 2> & 1
Changed after you restart the services:
[root @ mail /] # service crond restart
Stopping crond: [OK]
Starting crond: [OK]
[root @ mail /] #
6. To install postfix, dovecot, apache, blue font which is the phase dependent packets, the order for the installation of green;
See domain name MX records
[root @ mail postfix] # host-t mx centos.eb.cn
centos.eb.cn mail is handled by 10 mail.centos.eb.cn.
[root @ mail etc] yum install postfix
[root @ mail etc] yum install dovecot
Dependencies Resolved
================================================== ===========================
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
Transaction Summary
================================================== ===========================
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]
[root @ mail etc] yum install httpd
================================================== ===========================
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
Transaction Summary
================================================== ===========================
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 configuration methods:
[root @ mail /] # cd / etc / postfix
[root @ mail postfix] # cp main.cf main.cf.bak
[root @ mail postfix] # vi main.cf modification as shown in the following: for the question to amend the word pink, green for modified)
# myhostname = host.domain.tld
myhostname = mail.centos.eb.cn
# mydomain = domain.tld
mydomain = centos.eb.cn
# myorigin = $ mydomain
myorigin = $ mydomain
inet_interfaces = localhost
# inet_interfaces = localhost
inet_interfaces = all
mydestination = $ myhostname, localhost. $ mydomain, localhost
# mydestination = $ myhostname, localhost. $ mydomain, localhost, $ mydomain
# mydestination = $ myhostname, localhost. $ mydomain, localhost
mydestination = $ myhostname, localhost. $ mydomain, localhost, $ mydomain
# relay_domains = $ mydestination
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 /
home_mailbox = Maildir /
# smtpd_banner = $ myhostname ESMTP $ mail_name
# smtpd_banner = $ myhostname ESMTP $ mail_name ($ mail_version)
smtpd_banner = $ myhostname ESMTP mailserver maintanace by --- Weihu. Yan ---
(This supplementary document at the end of)
# append smtp auth config
smtpd_sasl_auth_enable = yes
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 (annex table size 20M, 20 * 1024 * 1024)
Configure SMTP authentication:
[root @ mail postfix] # vi / usr/lib/sasl2/smtpd.conf amended to read as follows:
pwcheck_method: saslauthd
# pwcheck_method: saslauthd
pwcheck_method: auxprop (that does not use user authentication)
[root @ mail postfix] # vi / etc / sysconfig / saslauthd
MECH = shadow to find this line, in front of Canada #
# MECH = shadow
FLAGS = find this line, add the equal sign "sasldb"
FLAGS = sasldb for the definition of certification sasldb2
The establishment of user-mail template:
[root @ mail postfix] # mkdir / etc / skel / Maildir
[root @ mail postfix] # chmod 700 / etc / skel / Maildir
If there is such a user, just as the existence of user mailboxes are as follows:
[root @ mail ~] # mkdir / home / leeki.yan / Maildir for the user (in this case as an example to users leeki.yan) Establish-mail directory
[root @ mail ~] # chmod 700 / home / leeki.yan / Maildir mailbox settings in the user directory attributes for the 700
[root @ mail ~] # chown leeki.yan. / home / leeki.yan / Maildir set up the users mail directory for all users
SMTP settings for the user password: (to root account as an example)
[root @ mail postfix] # saslpasswd2-u mail.centos.eb.cn-c root
Password:
Again (for verification):
[root @ mail postfix] #
Changes in the ownership of SASL
[root @ mail postfix] # chgrp postfix / etc/sasldb2
[root @ mail postfix] # chmod 640 / etc/sasldb2
Close sendmail, and the settings are not automatically activated, and modify the default MTA
[root @ mail postfix] # / etc / rc.d / init.d / sendmail stop
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
There are 2 programs which provide 'mta'.
Selection Command
-----------------------------------------------
* + 1 / usr / sbin / sendmail.sendmail
2 / usr / sbin / sendmail.postfix
Enter to keep the current selection [+], or type selection number: 2
[root @ mail postfix] #
SMTP authentication and start the Postfix service and set the appropriate services for the self-starting
[root @ mail postfix] # chkconfig saslauthd on
[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] #
See whether the smtp port open
[root @ mail postfix] # netstat-tl
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] #
8. Dovecot configuration
[root @ mail etc] # vi / etc / dovecot.conf (modified as indicated below: pink words to be modified for the revised green)
# protocols = imap imaps
protocols = imap imaps pop3 pop3s
# default_mail_env =
default_mail_env = maildir: ~ / Maildir (definition-mail directory)
[root @ mail etc] # vi / etc / sysconfig / iptables
Add the following components:
-A RH-Firewall-1-INPUT-m state - state NEW-m tcp-p tcp - dport 110-j ACCEPT for pop3
-A RH-Firewall-1-INPUT-m state - state NEW-m tcp-p tcp - dport 143-j ACCEPT for imap
[root @ mail etc] # / etc / rc.d / init.d / iptables restart
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] #
This transceiver can be tested, the basic functions of mail server has been
achieved!
[root @ mail etc] # useradd leeki.yan-s / sbin / nologin
[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.
Add user testing to see it!
0 评论:
发表评论