- 浏览: 102831 次
- 性别:
- 来自: 武汉
最新评论
-
tron.lu:
php for windows 下载目录以及搬迁到http:/ ...
Window下apache+php配置 -
yangleilt:
能给我说说怎么部署道服务器上吗? 用apache吗?
利用WinMail搭建Mail服务器 -
dackylike:
apache 和PHP是开发工具组合吗
Window下apache+php配置
这个配置,算是所有postfox 里最简单的配置呢。。
应该才配置好,就记录了下来。NND ITEYE太不给力了 ,发布全是乱的,又整理的半天
配置准备
hostname mail.asktun.com vim /etc/sysconfig/network -------------------------------------- HOSTNAME=mail.asktun.com -------------------------------------- echo "mail.asktun.com" > /proc/sys/kernel/hostname
EMOS 1.5 的YUM 源
vim /etc/yum.repos.d/EMOS-Base.repo # EMOS-Base.repo # # Created by ExtMail Dev Team: http://www.extmail.org/ # # $Id$ [EMOS-base] name=EMOS-Base baseurl=http://mirror.extmail.org/yum/emos/1.5/os/$basearch/ gpgcheck=0 priority=0 protect=0 [EMOS-update] name=EMOS-Updates baseurl=http://mirror.extmail.org/yum/emos/1.5/updates/$basearch/ gpgcheck=0 priority=0 protect=0
yum clean all
安装数据库和一些相关的应用
yum install mysql-server httpd php-gd php-mb*
删除原有的sendmail
rpm -e --nodeps sendmail sendmail-cf
配置 Postfix
安装postfix 包
yum install postfix
postconf -n >/etc/postfix/main2.cf
mv /etc/postfix/main.cf /etc/postfix/main.cf.bak
mv /etc/postfix/main2.cf /etc/postfix/main.cf
postconf -n >/etc/postfix/main2.cf
mv /etc/postfix/main.cf /etc/postfix/main.cf.bak
mv /etc/postfix/main2.cf /etc/postfix/main.cf
main.cf的默认配置
alias_database = hash:/etc/postfix/aliases alias_maps = hash:/etc/postfix/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 = /usr/share/doc/postfix-2.6.2-documentation/html mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.6.2-documentation/readme sample_directory = /etc/postfix sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop unknown_local_recipient_reject_code = 550
添加下面配置
# hostname mynetworks = 127.0.0.1 myhostname = mail.asktun.com mydomain = asktun.com mydestination = $mynetworks $myhostname localhost localhost.$mydomain # banner mail_name = Postfix - by asktun.com smtpd_banner = $myhostname ESMTP $mail_name # response immediately smtpd_error_sleep_time = 0s # Message and return code control message_size_limit = 5242880 mailbox_size_limit = 5242880 show_user_unknown_table_name = no # Queue lifetime control bounce_queue_lifetime = 1d maximal_queue_lifetime = 1d
配置courier-authlib
yum install courier-authlib courier-authlib-mysql
修改authlib 配置文件
rm -f /etc/authlib/authmysqlrc
vim /etc/authlib/authmysqlrc
MYSQL_SERVER localhost MYSQL_USERNAME extmail MYSQL_PASSWORD extmail MYSQL_SOCKET /var/lib/mysql/mysql.sock MYSQL_PORT 3306 MYSQL_OPT 0 MYSQL_DATABASE extmail MYSQL_USER_TABLE mailbox MYSQL_CRYPT_PWFIELD password MYSQL_UID_FIELD uidnumber MYSQL_GID_FIELD gidnumber MYSQL_LOGIN_FIELD username MYSQL_HOME_FIELD homedir MYSQL_NAME_FIELD name MYSQL_MAILDIR_FIELD maildir MYSQL_QUOTA_FIELD quota MYSQL_SELECT_CLAUSE SELECT username,password,"",uidnumber,gidnumber,\ CONCAT('/home/domains/',homedir), \ CONCAT('/home/domains/',maildir), \ quota, \ name \ FROM mailbox \ WHERE username = '$(local_part)@$(domain)'
修改authmysqlrc 的权限和拥有者
chown daemon.daemon /etc/authlib/authmysqlrc
chmod 660 /etc/authlib/authmysqlrc
chmod 660 /etc/authlib/authmysqlrc
修改authdaemonrc 以下内容
authmodulelist="authmysql"
authmodulelistorig="authmysql"
authmodulelistorig="authmysql"
启动 # service courier-authlib start
Starting Courier authentication services: authdaemond
# 显示启动成功
# 显示启动成功
修改authdaemon socket 目录权限,否则以下面的测试SMTP认证就不能通过
chmod 755 /var/spool/authdaemon/
配置 maildrop
yum install maildrop
配置master.cf 为了使Postfix支持Maildrop,必须修改/etc/postfix/master.cf文件,注释掉原来的maildrop的配置内容,并改为
vim /etc/postfix/master.cf
maildrop unix - n n - - pipe flags=DRhu user=vuser argv=/usr/bin/maildrop -w 90 -d ${user}@${nexthop} ${recipient} ${user} ${extension} {nexthop}
maildrop不支持一次接收多个收件人,因此必须在/etc/postfix/main.cf里增加如下参数
#maildrop_destination_recipient_limit=1
#这里去掉后 Postfix无法启动 查找原因在
#这里去掉后 Postfix无法启动 查找原因在
测试maildrop对authlib支持
maildrop -v
题外话
maildrop RPM包安装时,会自动创建vuser用户及vgroup用户组,专门用于邮件的存储,vuser:vgroup的uid/gid都是1000
配置 apache
修改apache配置文件
# vim /etc/httpd/conf/httpd.conf
NameVirtualHost *:80
Include conf/vhost_*.confvim /etc/httpd/conf/vhost_extmail.conf
# VirtualHost for ExtMail Solution
<VirtualHost *:80>
ServerName mail.asktun.com
DocumentRoot /var/www/extsuite/extmail/html/
ScriptAlias /extmail/cgi/ /var/www/extsuite/extmail/cgi/
Alias /extmail /var/www/extsuite/extmail/html/
ScriptAlias /extman/cgi/ /var/www/extsuite/extman/cgi/
Alias /extman /var/www/extsuite/extman/html/
# Suexec config
SuexecUserGroup vuser vgroup
</VirtualHost>
<VirtualHost *:80>
ServerName mail.asktun.com
DocumentRoot /var/www/extsuite/extmail/html/
ScriptAlias /extmail/cgi/ /var/www/extsuite/extmail/cgi/
Alias /extmail /var/www/extsuite/extmail/html/
ScriptAlias /extman/cgi/ /var/www/extsuite/extman/cgi/
Alias /extman /var/www/extsuite/extman/html/
# Suexec config
SuexecUserGroup vuser vgroup
</VirtualHost>
chkconfig httpd on
配置 extmail+extman
安装extmail 和extman
yum install extsuite-webmail extsuite-webman
cp /var/www/extsuite/extmail/webmail.cf.default /var/www/extsuite/extmail/webmail.cf
vim /var/www/extsuite/extmail/webmail.cf
SYS_MYSQL_USER = extmail
SYS_MYSQL_PASS = extmail
SYS_MYSQL_PASS = extmail
更新cgi目录权限 由于SuEXEC的需要,必须将cgi目录修改成vuser:vgroup权限
chown -R vuser:vgroup /var/www/extsuite/extmail/cgi/
chown -R vuser:vgroup /var/www/extsuite/extman/cgi/
chown -R vuser:vgroup /var/www/extsuite/extman/cgi/
链接基本库到Extmail
mkdir /tmp/extman
chown -R vuser:vgroup /tmp/extman/
chown -R vuser:vgroup /tmp/extman/
建议修改 /var/www/extsuite/extman/webman.cf
mkdir /var/www/extsuite/extman/tmp
chown -R vuser:vgroup /var/www/extsuite/extman/tmp
sed -i "s#SYS_SESS_DIR = /tmp/extman/#SYS_SESS_DIR = /var/www/extsuite/extman/tmp/#g" /var/www/extsuite/extman/webman.cf
chown -R vuser:vgroup /var/www/extsuite/extman/tmp
sed -i "s#SYS_SESS_DIR = /tmp/extman/#SYS_SESS_DIR = /var/www/extsuite/extman/tmp/#g" /var/www/extsuite/extman/webman.cf
数据库库初始化
# service mysqld start
# chkconfig mysqld on
# chkconfig mysqld on
修改导入数据库的域名
sed -i "s#extmail.org#asktun.com#g" /var/www/extsuite/extman/docs/init.sql
mysql -u root -p < /var/www/extsuite/extman/docs/extmail.sql
mysql -u root -p < /var/www/extsuite/extman/docs/init.sql
mysql -u root -p < /var/www/extsuite/extman/docs/extmail.sql
mysql -u root -p < /var/www/extsuite/extman/docs/init.sql
vim /etc/my.cnf
bind-address = 127.0.0.1
注意
上述导入初始化SQL时,默认的uidnumber/gidnumber都是1000,这和vuser:vgroup 的uid/gid一致,是因为maildrop投递时会从数据库里取uidnumber/gidnumber,而在master.cf里已经定义好了投递时的运行身份(vuser:vgroup),所以这两个字段的内容必须为1000,否则将出现投递错误,例如报0×06等错误。
设置虚拟域和虚拟用户的配置文件
cp /var/www/extsuite/extman/docs/mysql_virtual_alias_maps.cf /etc/postfix/
cp /var/www/extsuite/extman/docs/mysql_virtual_domains_maps.cf /etc/postfix/
cp /var/www/extsuite/extman/docs/mysql_virtual_mailbox_maps.cf /etc/postfix/
cp /var/www/extsuite/extman/docs/mysql_virtual_sender_maps.cf /etc/postfix/
cp /var/www/extsuite/extman/docs/mysql_virtual_domains_maps.cf /etc/postfix/
cp /var/www/extsuite/extman/docs/mysql_virtual_mailbox_maps.cf /etc/postfix/
cp /var/www/extsuite/extman/docs/mysql_virtual_sender_maps.cf /etc/postfix/
添加新的内容 vim /etc/postfix/main.cf 写道
# extmail config here
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_transport = maildrop:
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_transport = maildrop:
重启postfix
service postfix restart
测试authlib
authtest -s login postmaster@asktun.com extmail
-------------------------------------------------------------------
Authentication succeeded.
Authenticated: postmaster@asktun.com (uid 1000, gid 1000)
Home Directory: /home/domains/asktun.com/postmaster
Maildir: /home/domains/asktun.com/postmaster/Maildir/
Quota: 104857600S
Encrypted Password: $1$phz1mRrj$3ok6BjeaoJYWDBsEPZb5C0
Cleartext Password: extmail
Options: (none)
--------------------------------------------------------------------
-------------------------------------------------------------------
Authentication succeeded.
Authenticated: postmaster@asktun.com (uid 1000, gid 1000)
Home Directory: /home/domains/asktun.com/postmaster
Maildir: /home/domains/asktun.com/postmaster/Maildir/
Quota: 104857600S
Encrypted Password: $1$phz1mRrj$3ok6BjeaoJYWDBsEPZb5C0
Cleartext Password: extmail
Options: (none)
--------------------------------------------------------------------
如输出上面结果证明 extman 正确安装,数据库也正确导入, courier-authlib 正确连接 mysql 数据库
配置图形化日志
/usr/local/mailgraph_ext/mailgraph-init start
echo "/usr/local/mailgraph_ext/mailgraph-init start" >> /etc/rc.d/rc.local
echo "/usr/local/mailgraph_ext/mailgraph-init start" >> /etc/rc.d/rc.local
启动cmdserver 在后台显示系统信息
/var/www/extsuite/extman/daemon/cmdserver --daemon
echo "/var/www/extsuite/extman/daemon/cmdserver -v -d" >> /etc/rc.d/rc.local
echo "/var/www/extsuite/extman/daemon/cmdserver -v -d" >> /etc/rc.d/rc.local
登录extmail extman
Extmail url: http://ip/extmail
Extman url: http://ip/extman
login: root@asktun.com
pasword: extmail*123*
Extman url: http://ip/extman
login: root@asktun.com
pasword: extmail*123*
配置 cyrus-sasl
删除系统自带的Cyrus-sasl
rpm -e --nodeps cyrus-sasl
重新安装
yum install cyrus-sasl
添加新的main.cf 配置 vim /etc/postfix/main.cf 写道
# smtpd related config
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_non_fqdn_hostname,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unauth_destination,reject_unauth_pipelining,reject_invalid_hostname,
# SMTP sender login matching config
smtpd_sender_restrictions = permit_mynetworks,reject_sender_login_mismatch,reject_authenticated_sender_login_mismatch,reject_unauthenticated_sender_login_mismatch
smtpd_sender_login_maps = mysql:/etc/postfix/mysql_virtual_sender_maps.cf,mysql:/etc/postfix/mysql_virtual_alias_maps.cf
# SMTP AUTH config here
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_non_fqdn_hostname,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unauth_destination,reject_unauth_pipelining,reject_invalid_hostname,
# SMTP sender login matching config
smtpd_sender_restrictions = permit_mynetworks,reject_sender_login_mismatch,reject_authenticated_sender_login_mismatch,reject_unauthenticated_sender_login_mismatch
smtpd_sender_login_maps = mysql:/etc/postfix/mysql_virtual_sender_maps.cf,mysql:/etc/postfix/mysql_virtual_alias_maps.cf
# SMTP AUTH config here
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
配置smtpd.conf vim /usr/lib/sasl2/smtpd.conf 写道
清空内容 :1,$d
----------------------------
pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path:/var/spool/authdaemon/socket
---------------------------
----------------------------
pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path:/var/spool/authdaemon/socket
---------------------------
重启postfix后测试SMTP认证
service postfix restart
perl -e 'use MIME::Base64; print encode_base64("postmaster\@asktun.com")'
[ cG9zdG1hc3RlckBhc2t0dW4uY29t ]
perl -e 'use MIME::Base64; print encode_base64("extmail")'
[ ZXh0bWFpbA== ]
perl -e 'use MIME::Base64; print encode_base64("postmaster\@asktun.com")'
[ cG9zdG1hc3RlckBhc2t0dW4uY29t ]
perl -e 'use MIME::Base64; print encode_base64("extmail")'
[ ZXh0bWFpbA== ]
测试 telnet mail.asktun.com 25
220 mail.asktun.com ESMTP Postfix - by asktun.
ehlo asktun.com
250-mail.asktun.com
250-PIPELINING
250-SIZE 5242880
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
auth login
334 VXNlcm5hbWU6
cG9zdG1hc3RlckBhc2t0dW4uY29t334 UGFzc3dvcmQ6
配置 courier-imap
默认的courier-authlib及courier-imap都会增加系统自启动设置,因此下一次服务器启动将自动启动相应的authlib及POP3服务
yum install courier-imap
关闭IMAP
vim /usr/lib/courier-imap/etc/imapd
IMAPDSTART=NO
vim /usr/lib/courier-imap/etc/imapd-ssl
IMAPDSSLSTART=NO
直接复制下面执行:
sed -i "s#IMAPDSTART=YES#IMAPDSTART=NO#g" /usr/lib/courier-imap/etc/imapd
sed -i "s#IMAPDSSLSTART=YES#IMAPDSSLSTART=NO#g" /usr/lib/courier-imap/etc/imapd-ssl
IMAPDSTART=NO
vim /usr/lib/courier-imap/etc/imapd-ssl
IMAPDSSLSTART=NO
直接复制下面执行:
sed -i "s#IMAPDSTART=YES#IMAPDSTART=NO#g" /usr/lib/courier-imap/etc/imapd
sed -i "s#IMAPDSSLSTART=YES#IMAPDSSLSTART=NO#g" /usr/lib/courier-imap/etc/imapd-ssl
启动courier-imap 测试pop3
service courier-imap start
telnet mail.asktun.com 110
+OK Hello there.
user user@asktun.com
+OK Password required.
pass 123456
+OK logged in.
list
+OK POP3 clients that break here, they violate STD53.
1 4174
2 1887
3 1744
4 1632
5 65288
6 4330
7 651
8 674
.
quit
+OK Bye-bye.
telnet mail.asktun.com 110
+OK Hello there.
user user@asktun.com
+OK Password required.
pass 123456
+OK logged in.
list
+OK POP3 clients that break here, they violate STD53.
1 4174
2 1887
3 1744
4 1632
5 65288
6 4330
7 651
8 674
.
quit
+OK Bye-bye.
发表评论
-
iSCSI 3种连接方式
2013-01-17 16:52 812iSCSI设备的主机接口一 ... -
DRBD 配置
2012-12-24 16:58 952环境: centos 5.5 主节点:192.168. ... -
内核参数调优
2012-12-18 08:57 1012内核: net.ipv4.conf.lo.arp_ign ... -
Linux小技巧收集
2012-12-07 22:50 1040前言:因为用Linux的时间越来越长,所需要做的事也 ... -
GlusterFS分布式文件部署
2012-11-26 19:13 1343【FUSE安装】 yum install zlib-deve ... -
MooseFS分布式存储配置实现
2012-11-26 17:34 919下载源码包:http://sourceforge.net/pr ... -
FastDFS简单的配置实现
2012-11-21 15:12 61021.libevent库安装 wget http://c ... -
优化Linux的内核参数来提高服务器并发处理能力
2012-11-19 18:22 802PS:在服务器硬件资源额定有限的情况下,最大的压榨服务器的 ... -
使用yum快速安装Apache+PHP+Tomcat(JSP)+MySQL
2012-11-19 18:20 7651、安装Apahce、PHP、MySQL和PHP连接MySQL ... -
RHEL/CentOS 6.x 系统服务详解
2012-11-19 17:49 6605下面列表是在RHEL/CentOS 6.x最小化桌面环境安装下 ... -
Linux System and Performance Monitoring
2012-11-18 08:54 2200CPU 篇 ... -
tcpdump参数用法详解
2012-10-31 18:51 793下面就是关于tcpdump的使 ... -
系统吞吐量(TPS)、用户并发量、性能测试概念和公式
2012-10-31 18:28 8307PS:下面是性能测试的 ... -
Linux文件误删除恢复操作
2012-07-12 09:27 631恢复步骤 一、用运SecureCRT远程对操作系统上,查看一 ... -
Ubuntu下OpenRTMFP安装
2012-05-24 11:43 2333环境 Ubunut 11 安装相关的库 lua5.1 ... -
线上环境配置(备份记录)
2012-04-12 15:48 899项目:RED5+Trade+P2P 安装文件 re ...
相关推荐
Postfix+ExtMail邮件系统是一种功能齐全的免费电子邮件系统解决方案,核心组件包括Postfix、Amavisd-new、ClamAV、ExtMail、ExtMan、Courier系列软件。该系统可以提供完整的邮件解决方案,包括邮件传输代理、邮件...
**Courier Authlib** 是一个认证库,用于 Maildrop 和 Courier IMAP 等组件的身份验证。它是整个邮件系统中的关键组件之一。 #### 系统安装与配置注意事项 1. **磁盘分区**:为了确保系统的稳定运行,建议对硬盘...
- 调整Postfix和Courier-Authlib的相关配置以支持Cyrus-SASL。 #### 十三、安装Courier-IMAP - **Courier-IMAP**: 提供了IMAP服务支持。 - **配置**: - 安装Courier-IMAP。 - 配置Postfix以支持IMAP协议。 ####...
### Postfix邮件服务器配置详解与错误解析 #### 一、所需软件 为了搭建Postfix邮件服务器,我们需要准备一系列软件,并确保它们能够协同工作。以下是所需的软件列表及其在邮件服务器中的作用: 1. **CentOS 5.6**...
- 配置Courier Authlib与Cyrus SASL的集成。 7. **安装Courier IMAP** - 解压并安装Courier IMAP源码包。 - 配置POP3和IMAP服务。 8. **安装Maildrop** - 解压并安装Maildrop源码包。 - 配置邮件投递代理。 ...
接着,需要安装与Ldap和postfix相关的软件,如Cyrus-SASL和Courier-IMAP,以及配置它们与Ldap的连接。安装过程可能包括编译源代码,执行make和make install,以及修改配置文件,例如`/etc/postfix/main.cf`和`/etc/...
- **步骤**:下载并安装 Cyrus SASL,配置其与 Postfix 的集成。 - **注意事项**:调整配置文件以支持认证需求。 3. **安装 Apache 和 PHP** - **步骤**:下载并安装 Apache 和 PHP,确保两者能够正常工作。 -...
- **courier-authlib**:用于courier-imap和maildrop的认证。 - **cyrus-sasl**:标准的SASL实现库,支持SMTP、POP3等多种认证。 ### 安装MySQL POSTFIX可以与MySQL数据库集成,用于存储用户和认证信息。安装MySQL...
Cyrus-sasl和courier-authlib用于SMTP的身份验证,而courier-imap和pop3则用于邮件的接收。extman是邮件服务器的管理工具,extmail则是Web邮件客户端。DBD-mysql和unix-syslog解决软件依赖问题,BerkeleyDB提升...
- **POP3服务器**:courier-imap-4.5.0-3,仅使用POP3功能。 - **WebMail系统**:extsuite-webmail-1.1.0-1hzq,提供多语言和完整功能的Web界面。 - **SMTP认证库**:cyrus-sasl-2.1.22-8,实现SASL,支持Courier和...
5. **Courier-IMAP** (courier-imap-4.5.0.tar.bz2):结合Postfix提供IMAP和POP3服务。 6. **Perl** (perl-5.10.1-127.el6.x86_64.rpm):解释器,用于运行某些脚本。 7. **PCRE** (pcre-8.34.tar.gz):用于安装IMAP...
6. **courier-imap安装配置**:提供IMAP协议服务,让用户通过邮件客户端访问邮件。 7. **pcre安装**:Perl兼容正则表达式库,可能用于匹配和过滤邮件。 8. **maildrop安装**:MDA,处理邮件的最终投递。 9. **...
9.Courier Authlib 0.57是一个认证库,负责 courier-imap 和 maildrop 的认证。 10. 日志分析及显示:mailgraph_ext是一个日志分析及显示工具,用于显示邮件系统中的日志信息。 11. Web 服务器:Apache 2.2.x是一...
Cyrus SASL 2.1x 提供标准的 SMTP 认证实现,同时 Courier Authlib 0.57 用于 maildrop 和 courier-imap 等服务的认证。 13. **系统安全**: - 创建名为 sysadmin 的非 root 帐户,并禁用 root 直接登录,修改 `/...