postfix邮件系统(4)postfix正式安装
在安装postfix之前有个很重要的工作要做,那就是将sendmail给删除掉,当然也可以不用删除sendmail,但是这种情况就要切换系统的mta为postfix.为什么一定要这么做呢?原因很简单同样作为mail服务的两个软件在mta的时候会产生矛盾,就像是一山不容二虎一样 # rpm -e --nodeps sendmail一, 创建用户和组 创建运行postfix服务的用户(postfix)、组(postfix、postdrop)# groupadd -g 1001 postfix
# groupadd -g 1002 postdrop
# useradd -M -u 1001 -g postfix-s /sbin/nologin postfix# useradd -M -u 1002 -g postdrop-s /sbin/nologinpostdrop
二,编译安装
在postfix的README文档中这么说的。要想编译安装postfix支持mysql,那么就要加上-DHAS_MYSQL 和 -I这两个参数,还给了我们这个例子,其他的参数是添加安全和认证
CCARGS参数:为编译器提供额外的参数。“-I”选项指出标准的额外头文件的存放目录。例如,mysql和cyrus-sasl的头文件分别位于目录:/usr/local/mysql/lib/mysql、/usr/include/sasl。
AUXLIBS参数:指出位于标准位置之外的额外函数库。如果需要链接SASL、MySQL或任何附加的函数库,而且它们不是存放在标准位置(/usr/lib/目录),则必须在AUXLIBS参数中指出这些函数库的路径。例如,mysql和cyrus-sasl的库文件分别位于目录:/usr/local/mysql/lib/mysql、/usr/lib/sasl2。
#make makefiles 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl' 'AUXLIBS=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm -L/usr/lib/sasl2 -lsasl2'
按照以下的提示输入相关的路径([]号中的是缺省值,”[]”后的是输入值,省略的表示采用默认值)(可全部采用默认值)注意)生成别名二进制文件,这个步骤如果忽略,会造成postfix效率极低:
#newaliases
[*]install_root: [/] /
[*]tempdir:
[*]config_directory:
[*]command_directory:
[*]daemon_directory:
[*]data_directory:
[*]html_directory: /
[*]mail_owner:
[*]mailq_path:
[*]manpage_directory:
[*]newaliases_path:
[*]queue_directory:
[*]readme_directory:
[*]sendmail_path:
[*]setgid_group:
编译排错(1)
dict_mysql.c:772: error: ‘HOST’ has no member named ‘db’
dict_mysql.c:773: error: ‘HOST’ has no member named ‘db’
dict_mysql.c:774: error: ‘HOST’ has no member named‘hostname’
dict_mysql.c:775: error: ‘HOST’ has no member named ‘name’
dict_mysql.c:776: error: ‘HOST’ has no member named ‘name’
make: *** 错误 1
make: *** 错误 1
解决:
因为刚开始的时候看一些文档里面路径用的是/usr/local/mysql/include,/usr/local/mysql/lib所以找不到mysql.h文件后来改成/usr/local/mysql/include/mysql,/usr/local/mysql/lib/mysql错误就解决了
(2)Install the appropriate db*-devel package first.安装要想mysql支持就要安装e db*-devel
# yum install -y db*-devel
(3)xsasl_cyrus_server.c:606: error: 'XSASL_CYRUS_SERVER' has no member named 'username'
xsasl_cyrus_server.c:607: error: 'XSASL_CYRUS_SERVER' has no member named 'username'
make: *** Error 1
make: *** Error 1缺少cyrus认证包:有cyrus-sasl-md5 cyrus-sasl-lib cyrus-sasl-plain cyrus-sasl cyrus-sasl-devel# yum install -y cyrus-sasl-md5 cyrus-sasl-lib cyrus-sasl-plain cyrus-sasl cyrus-sasl-devel
(4)bin/postconf: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory解决方法:这里说找不到mysql的共享库,需要将路径加入/etc/ld.so.conf#echo "/usr/local/mysql/lib/mysql">>/etc/ld.so.conf#ldconfig# cp /usr/local/mysql/lib/mysql/libmysqlclient.so.16 /usr/lib/export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mysql/lib/mysql/
#/usr/sbin/postfixstart
postfix/postfix-script: fatal: the Postfix mail system is already running
# netstat -antup|grep 25
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 32713/master
学习了,谢谢分享、、、 比我有才的都没我帅,比我帅的都没我有才! 帮你顶下哈!! 精典之极就是精斑!!! 在一辆拥挤的公车上,一位女郎忽然叫了起来:别挤啦!别挤啦!把人家的奶都挤出来啦!(她拿着酸奶呢)。 路过,学习下
页:
[1]