RHEL6.0-32bit-single+dovecot+postfix
======================================================================================
1. # mount -o loop /dev/cdrom /mnt
# yum install postfix dovecot
2. # vi /etc/dovecot/dovecot.conf
protocols = pop3
3. # vi /etc/postfix/main.cf //参考下面的postconf -n的配置
# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
//以下是要注意的部分
inet_interfaces = all //默认值是localhost
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = xie.nina
myhostname = RHEL6-64bit-single.xie.nina
mynetworks = 10.254.0.0/16, 127.0.0.0/8, $myhostname
mynetworks_style = subnet
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
relay_domains = $mydestination
//
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
4.主机名
# vi /etc/sysconfig/network
HOSTNAME=RHEL6-64bit-single.xie.nina
5.开机启动服务,关闭防火墙
# chkconfig dovecot --level 3 on
# service iptables stop
# chkconfig iptables --level 234 off
6.重启服务生效
# service postfix restart
# service dovecot restart
查看端口是否都开了
# lsof -i:25
# lsof -i:110
======================================================================================
RHEL6+dovecot+exim
1. wincp copy exim-4.72-1.el6.x86_64.rpm to OS
# rpm -ivh exim-4.72-1.el6.x86_64.rpm
# yum install dovecot
2. #vi /etc/exim/exim.conf
primary_hostname = RHEL6-64bit-single.xie.nina
domainlist local_domains = @ : xie.nina : localhost : localhost.localdomain
domainlist relay_to_domains = sohu.com
hostlist relay_from_hosts = 127.0.0.1 : 10.254.0.0/16
qualify_domain = xie.nina
3.yum remove postfix
4.# vi /etc/dovecot/dovecot.conf
protocols = pop3
disable_plaintext_auth = no
可选的修改项,可能有的版本的dovecot放在另外的地方/etc/dovecot/conf.d/10-auth.conf
mail_location = mbox:~/mail:INBOX=/var/mail/%u
可选的修改项,可能有的版本的dovecot放在另外的地方/etc/dovecot/conf.d/10-mail.conf
ssl = no
可选的修改项,可能有的版本的dovecot放在另外的地方/etc/dovecot/conf.d/10-ssl.conf
# doveconf -n查看dovecot配置
5.遇到问题可查看/var/log/maillog;/var/log/exim/main.log
6. 添加测试用户
# adduser test1
# passwd test1
7.重启服务生效,关闭防火墙,添加开机启动
# service exim restart
# service dovecot restart
======================================================================================
RHEL6+dovecot+Qmail
# yum remove postfix
# chkconfig --level 2345 iptables off
# service iptables stop
# mkdir /downloads (一定要建这个文件夹,和安装脚本有关)
# cd /downloads
# tar zxvf qmailrocks.tar.gz (copy源码包到此目录下)
安装编译Qmail
# /downloads/qmailrocks/scripts/install/qmr_install_linux-s1.script
# /downloads/qmailrocks/scripts/util/qmail_patches.script
# cd /usr/src/qmail/qmail-1.03
# make man && make setup check
出现问题
./compile qmail.c
./load auto-str substdio.a error.a str.a
/usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference in substdio.a(substdo.o)
/lib64/libc.so.6: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [auto-str] Error 1
是因为gcc版本高了以后对extern int errno这种写法不自动修正了。解决办法:自带补丁包/downloads/qmailrocks/patches/qmail-1.03.errno.patch
# patch </downloads/qmailrocks/patches/qmail-1.03.errno.patch
# make setup check 重新做一次就好了
# hostname -f
RHEL6-64bit-single.xie.nina
# ./config-fast RHEL6-64bit-single.xie.nina
编译ucspi-tcp
#cd /usr/src/qmail/ucspi-tcp-0.88/
#make
#make setup check
出现问题
# patch < /downloads/qmailrocks/patches/ucspi-tcp-0.88.errno.patch
File to patch: /usr/src/qmail/ucspi-tcp-0.88/error.h
编译daemontools....
# cd /package/admin/daemontools-0.76
# package/install
出现问题
/usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference in envdir.o
/lib64/libc.so.6: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [envdir] Error 1
# cd /downloads/qmailrocks/patches/;patch -p1 <daemontools-0.76.errno.patch
File to patch: /package/admin/daemontools-0.76/src/error.h
编译Ezmlm
# cd /downloads/qmailrocks/
# tar zxvf ezmlm-0.53-idx-0.41.tar.gz
# cd ezmlm-0.53-idx-0.41
# make && make setup
编译Vpopmail
# cd /downloads/qmailrocks
# tar zxvf vpopmail-5.4.13.tar.gz
# cd vpopmail-5.4.13
# ./configure --enable-logging=p
# make && make install-strip
编译Maildrop (需要有perl)
# cd /downloads/qmailrocks
# tar zxvf maildrop-1.6.3.tar.gz
# cd maildrop-1.6.3
# ./configure --prefix=/usr/local --exec-prefix=/usr/local --enable-maildrop-uid=root --enable-maildrop-gid=vchkpw --enable-maildirquota
# make && make install-strip && make install-man
定制Qmail
# /downloads/qmailrocks/scripts/finalize/linux/finalize_linux.script
# vi /var/qmail/supervise/qmail-pop3d/run
修改mail.example.com--》RHEL6-64bit-single.xie.nina
# vi /var/qmail/supervise/qmail-smtpd/run
修改mail.example.com--》RHEL6-64bit-single.xie.nina 还要改大些一个softlimit值3000000为500000
# qmailctl stop
//
# echo '127.:allow,RELAYCLIENT=""' >> /etc/tcp.smtp
# qmailctl cdb
# echo test1@xie.nina > /var/qmail/alias/.qmail-root ("some_address" is the system user or email address you want these addresses aliased
to.)
# echo test1@xie.nina > /var/qmail/alias/.qmail-postmaster (并无影响,随便写什么,但一定要生成这个文件)
# echo test1@xie.nina > /var/qmail/alias/.qmail-mailer-daemon
# ln -s /var/qmail/alias/.qmail-root /var/qmail/alias/.qmail-anonymous
# chmod 644 /var/qmail/alias/.qmail*
# vi /etc/rc.conf
Change sendmail_enable="YES" to sendmail_enable="NONE"
Change sendmail_submit_enable="YES” to sendmail_submit_enable="NO"
Change sendmail_outbound_enable="YES“ to sendmail_outbound_enable="NO"
Change sendmail_msp_queue_enable="YES” to sendmail_msp_queue_enable="NO"
# ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
# ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
启动 Qmail
# /downloads/qmailrocks/scripts/util/qmr_inst_check
# qmailctl stop
# qmailctl start
# qmailctl stat (You can find out how things are running by this command)
注意!!!!
Qmail有自己的邮件域名和账户设置,不是主机上的用户和域。
# cd /home/vpopmail/bin
# ./vadddomain xnn.com 123456 (virtual_domain ,[postmaster password])
# ./vadduser test@xnn.com 123456 (email_address ,[passwd])
测试
# telnet localhost 110
Trying 192.168.1.10...
Connected to 192.168.1.10.
Escape character is '^]'.
+OK <16658.1054485137@yourserver.comt>
user postmaster@xnn.com
+OK
pass 123456
+OK
list
+OK
1 323 (there's your message!)
.
quit
+OK
Connection closed by foreign host.
======================================================================================
1. # mount -o loop /dev/cdrom /mnt
# yum install postfix dovecot
2. # vi /etc/dovecot/dovecot.conf
protocols = pop3
3. # vi /etc/postfix/main.cf //参考下面的postconf -n的配置
# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
//以下是要注意的部分
inet_interfaces = all //默认值是localhost
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = xie.nina
myhostname = RHEL6-64bit-single.xie.nina
mynetworks = 10.254.0.0/16, 127.0.0.0/8, $myhostname
mynetworks_style = subnet
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
relay_domains = $mydestination
//
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
4.主机名
# vi /etc/sysconfig/network
HOSTNAME=RHEL6-64bit-single.xie.nina
5.开机启动服务,关闭防火墙
# chkconfig dovecot --level 3 on
# service iptables stop
# chkconfig iptables --level 234 off
6.重启服务生效
# service postfix restart
# service dovecot restart
查看端口是否都开了
# lsof -i:25
# lsof -i:110
======================================================================================
RHEL6+dovecot+exim
1. wincp copy exim-4.72-1.el6.x86_64.rpm to OS
# rpm -ivh exim-4.72-1.el6.x86_64.rpm
# yum install dovecot
2. #vi /etc/exim/exim.conf
primary_hostname = RHEL6-64bit-single.xie.nina
domainlist local_domains = @ : xie.nina : localhost : localhost.localdomain
domainlist relay_to_domains = sohu.com
hostlist relay_from_hosts = 127.0.0.1 : 10.254.0.0/16
qualify_domain = xie.nina
3.yum remove postfix
4.# vi /etc/dovecot/dovecot.conf
protocols = pop3
disable_plaintext_auth = no
可选的修改项,可能有的版本的dovecot放在另外的地方/etc/dovecot/conf.d/10-auth.conf
mail_location = mbox:~/mail:INBOX=/var/mail/%u
可选的修改项,可能有的版本的dovecot放在另外的地方/etc/dovecot/conf.d/10-mail.conf
ssl = no
可选的修改项,可能有的版本的dovecot放在另外的地方/etc/dovecot/conf.d/10-ssl.conf
# doveconf -n查看dovecot配置
5.遇到问题可查看/var/log/maillog;/var/log/exim/main.log
6. 添加测试用户
# adduser test1
# passwd test1
7.重启服务生效,关闭防火墙,添加开机启动
# service exim restart
# service dovecot restart
======================================================================================
RHEL6+dovecot+Qmail
# yum remove postfix
# chkconfig --level 2345 iptables off
# service iptables stop
# mkdir /downloads (一定要建这个文件夹,和安装脚本有关)
# cd /downloads
# tar zxvf qmailrocks.tar.gz (copy源码包到此目录下)
安装编译Qmail
# /downloads/qmailrocks/scripts/install/qmr_install_linux-s1.script
# /downloads/qmailrocks/scripts/util/qmail_patches.script
# cd /usr/src/qmail/qmail-1.03
# make man && make setup check
出现问题
./compile qmail.c
./load auto-str substdio.a error.a str.a
/usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference in substdio.a(substdo.o)
/lib64/libc.so.6: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [auto-str] Error 1
是因为gcc版本高了以后对extern int errno这种写法不自动修正了。解决办法:自带补丁包/downloads/qmailrocks/patches/qmail-1.03.errno.patch
# patch </downloads/qmailrocks/patches/qmail-1.03.errno.patch
# make setup check 重新做一次就好了
# hostname -f
RHEL6-64bit-single.xie.nina
# ./config-fast RHEL6-64bit-single.xie.nina
编译ucspi-tcp
#cd /usr/src/qmail/ucspi-tcp-0.88/
#make
#make setup check
出现问题
# patch < /downloads/qmailrocks/patches/ucspi-tcp-0.88.errno.patch
File to patch: /usr/src/qmail/ucspi-tcp-0.88/error.h
编译daemontools....
# cd /package/admin/daemontools-0.76
# package/install
出现问题
/usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference in envdir.o
/lib64/libc.so.6: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [envdir] Error 1
# cd /downloads/qmailrocks/patches/;patch -p1 <daemontools-0.76.errno.patch
File to patch: /package/admin/daemontools-0.76/src/error.h
编译Ezmlm
# cd /downloads/qmailrocks/
# tar zxvf ezmlm-0.53-idx-0.41.tar.gz
# cd ezmlm-0.53-idx-0.41
# make && make setup
编译Vpopmail
# cd /downloads/qmailrocks
# tar zxvf vpopmail-5.4.13.tar.gz
# cd vpopmail-5.4.13
# ./configure --enable-logging=p
# make && make install-strip
编译Maildrop (需要有perl)
# cd /downloads/qmailrocks
# tar zxvf maildrop-1.6.3.tar.gz
# cd maildrop-1.6.3
# ./configure --prefix=/usr/local --exec-prefix=/usr/local --enable-maildrop-uid=root --enable-maildrop-gid=vchkpw --enable-maildirquota
# make && make install-strip && make install-man
定制Qmail
# /downloads/qmailrocks/scripts/finalize/linux/finalize_linux.script
# vi /var/qmail/supervise/qmail-pop3d/run
修改mail.example.com--》RHEL6-64bit-single.xie.nina
# vi /var/qmail/supervise/qmail-smtpd/run
修改mail.example.com--》RHEL6-64bit-single.xie.nina 还要改大些一个softlimit值3000000为500000
# qmailctl stop
//
# echo '127.:allow,RELAYCLIENT=""' >> /etc/tcp.smtp
# qmailctl cdb
# echo test1@xie.nina > /var/qmail/alias/.qmail-root ("some_address" is the system user or email address you want these addresses aliased
to.)
# echo test1@xie.nina > /var/qmail/alias/.qmail-postmaster (并无影响,随便写什么,但一定要生成这个文件)
# echo test1@xie.nina > /var/qmail/alias/.qmail-mailer-daemon
# ln -s /var/qmail/alias/.qmail-root /var/qmail/alias/.qmail-anonymous
# chmod 644 /var/qmail/alias/.qmail*
# vi /etc/rc.conf
Change sendmail_enable="YES" to sendmail_enable="NONE"
Change sendmail_submit_enable="YES” to sendmail_submit_enable="NO"
Change sendmail_outbound_enable="YES“ to sendmail_outbound_enable="NO"
Change sendmail_msp_queue_enable="YES” to sendmail_msp_queue_enable="NO"
# ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
# ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
启动 Qmail
# /downloads/qmailrocks/scripts/util/qmr_inst_check
# qmailctl stop
# qmailctl start
# qmailctl stat (You can find out how things are running by this command)
注意!!!!
Qmail有自己的邮件域名和账户设置,不是主机上的用户和域。
# cd /home/vpopmail/bin
# ./vadddomain xnn.com 123456 (virtual_domain ,[postmaster password])
# ./vadduser test@xnn.com 123456 (email_address ,[passwd])
测试
# telnet localhost 110
Trying 192.168.1.10...
Connected to 192.168.1.10.
Escape character is '^]'.
+OK <16658.1054485137@yourserver.comt>
user postmaster@xnn.com
+OK
pass 123456
+OK
list
+OK
1 323 (there's your message!)
.
quit
+OK
Connection closed by foreign host.