centos extmail 安装 记录

 

本次装的extmail参考官方教程,但有些地方进行了修改

 

http://wiki.extmail.org/extmail_solution_for_linux_centos-5【在配置时第十一步时不要关掉IMAP服务,因为现在很多人还是喜欢用IMAP】

 

服务器上邮nginx  apache两种服务器组成。apache只为邮件服务器,地址为ai9475.com:9000/

 

域名配置

----------------------------------------------------------------------------------

 

主机名 (A)(最多允许20条)  IP 地址  TTL  操作       帮助 
  pop3.ai9475.com 122.225.96.117  3600  修改 -  删除 
 smtp.ai9475.com 122.225.96.117  3600  修改 -  删除 
 imap.ai9475.com 122.225.96.117  3600  修改 -  删除 

别名 (CNAME)(最多允许20条)  别名主机  TTL  操作       帮助 
 mail.ai9475.com ai9475.com 3600  修改 -  删除 
      添加新的别名   注:只提交新加纪录 
  
  
邮件交换记录 (MX)(最多允许20条)  目标主机  优先级  TTL  操作     帮助 
 ai9475.com ai9475.com 10  3600  修改 -  删除

 

如果不配置smpt,pop3,在smpt,pop3中填IP也可以访问

----------------------------------------------------------------------------------

extmail 本身已支持imap服务

----------------------------------------------------------------------------------

 

叁、制作_yum_仓库

# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm 在这步时。因为文件不存在了,所以通过WGET下载一个放在本地上运行

加载EMOS-1.5的光盘,请把emos的光盘放到光驱中
在这一步时,我不在服务器边只能

#mount -o loop -t iso9660 /root/rpm/EMOS_1.5_x86_64.iso /mnt/EMOS

 

# createrepo . 在这步会出现 -bash: createrepo:,是因为未安装createrepo yum install createrepo即可


===============================================

玖、配置管理后台-extman

导入初始数据后,需要将数据库中的域名改成你自己的

重启postfix 时关闭出错,但重启成功,没事,多restart一下就看到两个OK了
# service postfix restart

===============================================
[root@localhost docs]# /usr/sbin/authtest -s login postmaster@yeyaomai.net extmail
Authentication FAILED: Operation not permitted
通过 /var/log/maillog可以看到
May  5 11:24:01 localhost authdaemond: Installing libauthmysql
May  5 11:24:01 localhost authdaemond: file not found
May  5 13:33:27 localhost postfix/postfix-script[4308]: fatal: the Postfix mail system is not running

重启了courier-authlib

[root@localhost extmail]# /usr/sbin/authtest -s login postmaster@extmail.org extmail
Authentication FAILED: Input/output error

这个错误是在第伍、配置courier-authlib 修改 vi /etc/authlib/authmysqlrc 时出错,我把后面的/给删除了,注意里面mysql.sock的位置

 

===============================================
问题

install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /var/www/extsuite/extman/libs /usr/lib/perl5/site_perl/5.8.8/i

解决:
只需要安装perl-DBD-MySQL即可解决此问题。
yum install perl-DBD-MySQL
===============================================
http://122.225.96.117:9000/extmail/cgi/index.cgi

登陆管理员后不能看到所有用户:

    我进入extman后只有如下菜单
    索引 | 域列表 | 添加用户 | 添加别名 | 添加域 | 添加管理员 | 群发邮件 | 图形日志

域列表  =>  对应域名 注意看有一支笔,点那个绿色的笔即可。

===============================================
extmail登录提示不正确的用户名或密码

安装mail服务器,参考extmail论坛资料安装后,extman可以登陆,而extmail登录提示不正确的用户名或密码。前段时间,一直没有找到此问题的解决办法。昨天终于发现了问题所在,先打开mysql的debug。在/etc/my.cnf里的[mysqld]下加上log=/var/lib/mysql /sql.log。然后tail -f /var/lib/mysql/sql.log。再在web界面登录,这日记就会纪录相关信息。我发现了我的问题所在了。我在登录界面里域名框里用的是 ip地址。换成域名,问题解决。

 

===============================================

拾、配置cyrus-sasl

smtp认证测试失败

535 5.7.8 Error: authentication failed: authentication failure
用户名写错了,我用了例子中的用户名,其实应该用我自己在后台添加的用户

其日志: SASL LOGIN authentication failed: authentication failure

最后找到问题。是自己用户名和密码使用错误(大汗)



======================================================

没有产生maillog或者maillog不更新

到你的/etc/syslog.conf文件看一下,看是不是“-/var/log/maillog”将前面的“-”去掉,重启syslog服务。

 

===============================================

 

在测试IMAP服务时FOXMAIL里用户名要填 xxxxx@ai9475.com 是一个完整的

 

在IPAD,IPHONE里设置SMTP时要填写用户名和密码,并且填完整后要先选择SSL,这样才能找到IMAP.AI9475.COM主机

 

=====================================

绑定多域名下配置FOXMAI方式

 

如登陆服务器为 mail.ai9475.com

 

用户名为 test@mytest.com

 

那么在FOXMAIL。中用户名地方都用test@mytest.com

 

而在POP3,IMAP,SMTP中设置为 pop3.ai9475.com即可

=========================================

 

系统信息 Connection refused

 

因为保存在/etc/rc.local 时出现了乱码,导致服务器启动时没有启动相关数据
主要双引号问题
/usr/local/mailgraph_ext/mailgraph-init start
/var/www/extsuite/extman/daemon/cmdserver -v -d

 

=====================================

让extmail支持 smtp SSL ,但是安装时要安装tsl如下:

-----

 

 

=============================

Jun 15 11:04:44 localhost postfix/pipe[30147]: 905A068B04D2: to=<sinykk@ai9475.com>, relay=maildrop, delay=50936, delays=50935/0.24/0/1.2, dsn=4.3.0, status=deferred (temporary failure. Command output: maildrop: Invalid home directory permissions - world writable. )

解决方法:

1、查看/home/domains的权限及文件拥有者是否是 vuser/vgroup

2、/home/domains权限不能太高 ,改为 chmod -R 700 /home/domains

 

 

 

=====================================

2011-11-14 又全新安装extmail又出现更多问题

=====================================

install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /var/w

yum install perl-DBD-MySQL

=====================================



由于数据库版本不同,导入 extmail.sql 数据库时报错:

ERROR 1064 (42000) at line 50: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM COMMENT='Ext/Webman - Admin Accounts'' at line 15

用文本编辑器打开extmail.sql,将数据库文件内的所有 TYPE=MyISAM 替换为 ENGINE=MyISAM ,保存退出。

丢弃导入到一半出错的数据库 extmail 。

mysql -u root -p
mysql> drop database extmail;

重新导入数据库。

=============================================================

Starting httpd: (13)Permission denied: make_sock: could not bind to address 0.0.0.0:8000
这是linux的这安全机制
setenforce 1 设置SELinux 成为enforcing模式
setenforce 0 设置SELinux 成为permissive模式

如果要彻底禁用SELinux 需要在/etc/sysconfig/selinux中设置参数selinux=0 ,或者在/etc/grub.conf中添加这个参数

查看一下预定义
#semanage port -l
可以看出8000已经被使用
--------------------------------

关闭selinux状态:(使用无启重启系统的方法)

详见:http://blog.itechol.com/space-33-do-blog-id-5088.html

[root@cacti-test httpd]# setenforce 0            关闭命令

[root@cacti-test httpd]# getenforce              重新查看selinux状态

Permissive 

尝试再次启动apache

==============================
因为系统有NGINX,使用了80端口,所以HTTPD只有用8000了
使用到端口的地方分别为
Listen 8000
NameVirtualHost *:8000
<VirtualHost *:8000>

==============================================================================

DBI connect('database=extmail;host=localhost;mysql_socket=/var/lib/mysql/mysql.sock','webman',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) at /var/www/extsuite/extman/libs/Ext/Mgr/MySQL.pm line 45

vi /var/www/extsuite/extman/webman.cf


SYS_MYSQL_SOCKET = /var/lib/mysql/mysql.sock
此处修改为:
SYS_MYSQL_SOCKET = /tmp/mysql.sock

 

改后要记得重启postfix

-----------2012.2.8--------------------

这次在这个问题上折腾了一天多,装了yum install perl-DBD-MySQL,但这个并没有解决问题,最后重启后可用的

 


==============================================================================
535 5.7.8 Error: authentication failed: generic failure

因为sasl 的目录有2个,分别是 /usr/lib/sasl2 跟 /usr/lib64/sasl2

最后通过修改 /usr/lib64/sasl2/smtpd.conf 跟 /usr/lib64/sasl2/smtpd.conf 内容为:

pwcheck_method: saslauthd

log_level: 3

mech_list: PLAIN LOGIN

saslauthd_path: /var/run/saslauthd/mux

并重启 sasl 服务,跟 postfix 服务后

==============================================

装到后面因为有事情把服务器重启了,最后安装软件时报找不到数据源,然后在网站下载软件再装,又遇到依赖关系,最后才发现因重启了电脑,所以之前挂载的ISO文件不在了,所以报找不到源

==================================================
SMTP rcpt error

这个问题一直没有解决,因为服务器里是/tmp/mysql.sock,而EXTMAIL一直找/var/lib/mysql/mysql.sock,中途我改了 /etc/my.cnf里的路径 为/var/lib/mysql/mysql.sock也不行
最后改了调试了许久都不行,最后又重装了MYSQL,EXTMAIL,并将mysql.sock指定到/var/lib/mysql/mysql.sock才行的



 /usr/local/mysql/bin/mysqld_safe & --socket=/var/lib/mysql/mysql.sock
 ============================================
 2、确定你的mysql.sock是不是在那个位置,
mysql -u 你的mysql用户名 -p -S /var/lib/mysql/mysql.sock
也可以
mysqladmin --socket=/var/lib/mysql/mysql.sock version -uroot -p

========================
php编译时
-o sapi/fpm/php-fpm
/usr/bin/ld: cannot find -lltdl
collect2: ld returned 1 exit status
make: *** [sapi/fpm/php-fpm] Error 1
---
今天在编译一个程序的时候出现如下错误:/usr/bin/ld: cannot find -l*

把解决方法在此贴一下,方便以后查阅。

    原因:库文件缺失。

   方法一:可用yum install libtool-l*来安装
        方法二:当方法一不能成功时,可从其他机器拷贝文件到本机/usr/lib64/。具体文件:/usr/lib64/目录下与lib*相关文件(主要是二个:lib*.a和lib*.so);

==================================================
yum list
Error: requested datatype primary not available

弄了几次都出现同样的错误,最后重启服务器再yum clean all yum list

==================================================
postfix在进行sasl验证时,/var/log/maillog文件出现如下错误:

Mar 21 13:52:04 149 postfix/smtpd[26855]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory

Mar 21 13:52:04 149 postfix/smtpd[26855]: warning: SASL authentication failure: Password verification failed

Mar 21 13:52:04 149 postfix/smtpd[26855]: warning: localhost.localdomain[127.0.0.1]: SASL plain authentication failed: generic failure

同时 /var/log/messages 日志报错:
unable to dlopen /usr/lib/sasl2/liblogin.so.2: /usr/lib/sasl2/liblogin.so.2: wrong ELF class: ELFCLASS32

因为sasl 的目录有2个,分别是 /usr/lib/sasl2 跟 /usr/lib64/sasl2

最后通过修改 /usr/lib64/sasl2/smtpd.conf 跟 /usr/lib64/sasl2/smtpd.conf 内容为:

pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path:/var/spool/authdaemon/socket


并重启 sasl 服务,跟 postfix 服务后
问题解决!!!!!


service saslauthd restart
saslauthd postfix restart

=======================

 

[root@localhost yum.repos.d]# yum install courier-imap
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package courier-imap.x86_64 0:4.6.0-1 set to be updated
--> Processing Dependency: courier-authlib-devel >= 0.60.6.20080629 for package: courier-imap
--> Processing Dependency: libcourierauthsasl.so()(64bit) for package: courier-imap
--> Processing Dependency: libcourierauth.so()(64bit) for package: courier-imap
--> Running transaction check
--> Processing Dependency: libcourierauth.so.0()(64bit) for package: maildrop

.................................

maildrop-2.0.4-4hzq.x86_64 from installed has depsolving problems
  --> Missing Dependency: libcourierauth.so.0()(64bit) is needed by package maildrop-2.0.4-4hzq.x86_64 (installed)
Error: Missing Dependency: libcourierauth.so.0()(64bit) is needed by package maildrop-2.0.4-4hzq.x86_64 (installed)
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.


最后没有办法
yum remove courier-authlib
yum install courier-authlib
yum install courier-authlib-mysql
yum install maildrop
-----------------------------------------
好下方法是网上提供的,我用了没有效果

解决:

yum --skip-broken update
 
rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
 

Error:There are unfinished transactions remaining. You mightconsider running yum-complete-transaction first to finish them

#yum install yum-utils

 

# yum-complete-transaction


 

Yum is telling you that there's an incoplete transaction - running 'yum-complete-transaction' first should clear it up.



=============================================
输入该命令:
[root@ ~]# rpm --import http://dag.wieers.com/rpm/packages/PRM-GPG-KEY.dag.txt

出现以下错误:
error: http://dag.wieers.com/rpm/packages/PRM-GPG-KEY.dag.txt: import read failed(-1).
warning: u 0x8aa18e8 ctrl 0x8aa2708 nrefs != 0 (dag.wieers.com http)



解决办法以一:换一个url
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt   【测试可以用】

解决办法以二(可行):先从网络上下载到本地,再安装
wget http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm --import RPM-GPG-KEY.dag.txt
===========================================================

Feb  8 16:26:51 localhost imapd-ssl: sinykk@abcd001.com: Account's mailbox directory is not owned by the correct uid or gid


这个问题应该是我受网上的人影响配置了/var/www/extsuite/extman/webman.cf修改了里面的SYS_DEFAULT_GID = 2525 //即postfix组gid,这个不能改成2525,要默认为1000
这个问题最后我在系统后具体用户上下的 “改组ID(建议不修改)改为1000”
要记住
用户ID(建议不修改)   
组ID(建议不修改)
都保持1000不变

 

===========================================================


请问如何修改ssh端口?
# vi /etc/ssh/sshd_config

找到port 22行, 前面有#表示注释,去掉,保存后重启SSH
/etc/rc.d/init.d/sshd restart
查看端口 netstat -anlt

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值