CENTOS5下配置mail服务器[11月9日最后修正]
2007-10-28 16:17
|
CENTOS5,Fedora8下配置mail服务器
在Fedora8下比CENTOS5下配置更顺利 [QQ:48238398][抄来抄去,呵] 说明:apache,php,mysql,为centos5自带的,就是说我装系统的时候,就选择上了: cyrus-sasl,postfix,courier-authlib,maildrop ,courier-imap 是通过源码编译的, 写这个的目的就是,复制内容,照着一步步的做下去就能配置出来一个成功的可视化管理的mail服务器 如果是rpm方式按装的msqyl,include及lib目录的位置 /usr/include/mysql /usr/lib/mysql 如果是编译的,位于你指定的目录下,如果编译mysql指定目录为/usr/local/mysql则位于 /usr/local/mysql/include/mysql /usr/local/mysql/lib/mysql 开始::: 如果你的apache,php,mysqsl是centos5自带的,就是说不是你自己编译的,以下的代码可以复制粘 贴直接用 =cyrus-sasl=按装配置cyrus-sasl =cyrus-sasl=下载地址:ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/ =cryus-sasl=文件名:cyrus-sasl-2.1.22.tar.gz #rpm -qa|grep cyrus-sasl把查找出来的包都删除了 #rpm -e --nodeps 包名 #rm -rf /usr/lib/sasl #rm -rf /usr/lib/sasl2 =cyrus-sasl=进入解压目录编译: #./configure \ --enable-plain \ --enable-cram \ --enable-digest \ --enable-login \ --enable-sql \ --disable-anon \ --disable-ntlm \ --disable-gssapi \ --disable-krb4 \ --disable-otp \ --disable-srp \ --disable-srp-setpass \ -with-authdaemond=/usr/local/courier-authlib/var/spool/authdaemon/socket \ --with-mysql #make #make install #ln -s /usr/local/lib/sasl2 /usr/lib/sasl2 #vi /etc/ld.so.conf /usr/local/lib //增加该行 # ldconfig # vi /usr/local/lib/sasl2/smtpd.conf 加入以下四行 pwcheck_method: authdaemond log_level: 3 mech_list: PLAIN LOGIN authdaemond_path:/usr/local/courier-authlib/var/spool/authdaemon/socket ==postfix==按装配置postfix ==postfix==下载地址:http://www.postfix.org/download.html ==postfix==文件名:postfix-2.4.6.tar.gz ==postfix==进入解压目录编译: # yum install db*-devel* # make tidy # groupadd postfix -g 54321 //如果原来系统中有该用户则不需要再建 # groupadd postdrop # useradd -s /bin/false -u 54321 -g postfix -G postdrop postfix ==postfix==备注,我的mysql是rpm包装的,如果是你自己源码编译的,下边mysql路径会有变化 #make makefiles 'CCARGS=-DHAS_MYSQL -I/usr/include/mysql -DUSE_CYRUS_SASL -DUSE_SASL_AUTH -I/usr/local/include/sasl' 'AUXLIBS=-L/usr/lib/mysql -lmysqlclient -lm -lz -L/usr/local/lib -lsasl2' #make #make install #mv /etc/aliases /etc/aliases.old #ln -s /etc/postfix/aliases /etc/aliases #echo 'root: admin@example.com'>>/etc/postfix/aliases #/usr/bin/newaliases #postconf -n > /etc/postfix/main2.cf #mv /etc/postfix/main.cf /etc/postfix/main.cf.old #mv /etc/postfix/main2.cf /etc/postfix/main.cf # vi /etc/postfix/main.cf ==postfix==main.cf加入以下内容 # hostname mynetworks = 127.0.0.1 myhostname = mail.extmail.org mydomain = extmai.com myorigin = $mydomain mydestination = $mynetworks $myhostname # banner mail_name = Postfix - by extmail.org smtpd_banner = $myhostname ESMTP $mail_name # response immediately smtpd_error_sleep_time = 0s unknown_local_recipient_reject_code = 450 # 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: ==postfix==main.cf内容结束 ==postfix==以下几个文件可以通过cp /var/www/html/extsuite/extman/docs/mysql_* /etc/postfix/得到 ==postfix==编辑mysql_virtual_alias_maps.cf vi /etc/postfix/mysql_virtual_alias_maps.cf 内容如下: user = extmail password = extmail hosts = localhost dbname = extmail table = alias select_field = goto where_field = address ==postfix==编辑mysql_virtual_domains_maps.cf vi /etc/postfix/mysql_virtual_domains_maps.cf 内容如下: user = extmail password = extmail hosts = localhost dbname = extmail table = domain select_field = description where_field = domain #additional_conditions = and backupmx ='0' and active ='1' ==postfix==编辑mysql_virtual_mailbox_maps.cf vi /etc/postfix/mysql_virtual_mailbox_maps.cf 内容如下: user = extmail password = extmail hosts = localhost dbname = extmail table = mailbox select_field = maildir where_field = username #additional_conditions = and active = '1' ==postfix==SMTP认证需要透过Cyrus-SASL,连接到authdaemon获取认证信息,编 辑/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 AUTH config here broken_sasl_auth_clients = yes smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $myhostname smtpd_sasl_security_options = noanonymous 0
上一篇:Web服务器负载均衡
下一篇:没有了 最新评论共有 4 位网友发表了评论
查看所有评论
发表评论
热点关注
|
