设为首页 收藏本站
查看: 1894|回复: 0

[经验分享] 邮件系统服务器搭建记录(三)(Postfix+Cyrus-sasl+Courier-authlib+Dovecot+ExtMail+MySQL)

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-1-7 08:50:37 | 显示全部楼层 |阅读模式
7. 编译安装courier-authlib
可以配置postfix使用虚拟用户和虚拟域,而这些信息通常会使用mysql数据库进行管理。因此postfix需要访问mysql数据库。本文使用courier-authlib,该软件调用cyrus-sasl库文件,与mysql进行通信, 帮助postfix验证虚拟用户的合法性。
在编译安装courier-authlib之前,要先安装courier-unicode,避免在对courier-authlib配置时出现如下错误:
1
configure: error: The Courier Unicode Library 1.2 appears not to be installed. You may need to install a separate development subpackage, in addition to the main package



访问The Courier Mail Server(http://www.courier-mta.org/authlib/)下载courier-unicode安装包并上传到服务器,解压并进行编译安装:
1
2
3
4
[iyunv@mail ~]# tar -xvf courier-unicode-1.1.tar.bz2
[iyunv@mail ~]# cd courier-unicode-1.1
[iyunv@mail courier-unicode-1.1]# ./configure
[iyunv@mail courier-unicode-1.1]# make && make install



注:在make && make install这一步执行后,如果提示如下错误:
1
2
3
4
./libtool: line 1125: g++: command not found
make[1]: *** [unicodecpp.lo] Error 1
make[1]: Leaving directory `/root/courier-unicode-1.1'
make: *** [all] Error 2



请安装gcc+和gcc-c++:
1
[iyunv@mail courier-unicode-1.1]# yum install gcc+ gcc-c++



1
2
3
4
5
如果提示如下错误:
/usr/bin/install: cannot stat `.libs/libcourier-unicode.so.1.0.0': No such file or directory
make[1]: *** [install-libLTLIBRARIES] Error 1
make[1]: Leaving directory `/root/courier-unicode-1.1'
make: *** [install-am] Error 2



注意检查courier-authlib是否已经安装,其版本是否同courier-unicode版本匹配,然后尝试使用低版本的courier-unicode进行编译安装。

成功安装courier-unicode后,访问The Courier Mail Server(http://www.courier-mta.org/authlib/)下载courier-authlib安装包并上传到服务器,解压并进行编译安装:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[iyunv@mail courier-unicode-1.1]# cd ../courier-authlib-0.66.1
[iyunv@mail courier-authlib-0.66.1]# ./configure \
--prefix=/usr/local/courier-authlib \
--sysconfdir=/etc \
--without-authpam \    #不启用基于pam的认证方式
--without-authshadow \
--without-authvchkpw \
--without-authpgsql \
--with-authmysql \    #启用基于mysql的认证方式
--with-mysql-libs=/usr/lib64/mysql \    #指定mysql库文件存放位置
--with-redhat \
--with-authmysqlrc=/etc/authmysqlrc \
--with-authdaemonrc=/etc/authdaemonrc \    #指定authdaemonrc配置文件位置
--with-authdaemonvar=/var/spool/authdaemon \   #指定authdaemon.pid和相应套接字存放位置
--with-mailuser=postfix \    #调用courier-authlib的用户名
--with-mailgroup=postfix \    #调用courier-authlib的组名
[iyunv@mail courier-authlib-0.66.1]# make && make install



注:如果在配置courier-authlib时出现错误,请检查是否安装了所依赖的软件包,比如libtool-ltdl/libtool-ltdl-devel、sqlite-devel等。

安装完成后,需要将authdaemon.pid和套接字所在目录的权限修改为755,以保证其他系统用户可以访问PID和套接字文件,才能与courier-authlib的端口进行通信:
1
2
3
[iyunv@mail ~]# chmod 755 /var/spool/authdaemon/
[iyunv@mail ~]# ls -ld /var/spool/authdaemon/
drwxr-xr-x. 2 postfix postfix 4096 Dec 28 10:48 /var/spool/authdaemon/



并把2个配置文件复制并进行改名:
1
2
[iyunv@mail ~]# cp /etc/authdaemonrc.dist /etc/authdaemonrc
[iyunv@mail ~]# cp /etc/authmysqlrc.dist /etc/authmysqlrc



courier-authlib提供了SysV风格的启动脚本,脚本在安装包下,名称为courier-authlib.sysinit:
1
2
[iyunv@mail courier-authlib-0.66.1]# ls courier-authlib.sysvinit
courier-authlib.sysvinit



复制,+运行权限:

1
2
[iyunv@mail courier-authlib-0.66.1]# cp courier-authlib.sysvinit /etc/init.d/courier-authlib
[iyunv@mail courier-authlib-0.66.1]# chmod /etc/init.d/courier-authlib



接下来,修改/etc/authdaemonrc配置文件的如下内容:
1
2
3
[iyunv@mail etc]# vi authdaemonrc
authmodulelist="authmysql"
authmodulelistorig="authmysql"



由于暂时没有在Mysql中新建用户库,因此暂不对courier-authlib的与mysql相关的配置文件/etc/authmysqlrc进行配置。

下一节将介绍通过Web服务器 — Apache部署Webmail程序Extmail以及后台管理程序ExtMan,以及通过Extmail的脚本完成Mysql相关库和表结构的建立。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-161205-1-1.html 上篇帖子: 邮件系统服务器搭建记录(二)(Postfix+Cyrus-sasl+Courier-authlib+Dovecot+ExtMail+MySQL) 下篇帖子: 关于OpenLDAPAdmin管理页面提示“This base cannot be created with PLA"问题 服务器 邮件系统 记录
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表