FJ集团企业级邮件服务器――IRedMail服务器安装与配置

 

一、iRedMail安装之前的准备工作:

1)检查服务器FQDN :

clip_image002

2)检查2个hostname文件:

clip_image004 clip_image006

3)yum源构建:

将/etc/yum.repos.d/下的所有yum仓库开启(.repo扩展名的文件),即把enabled=1,如下图所示:

(1)创建CentOS文件目录、挂载光盘:

mkdir /media/CentOS //创建文件目录CentOS,后面安装iRedMail服务器要用到!

mount /dev/cdrom /media/CentOS //挂载之

cd /media/CentOS --- ll 查看之:

cd /etc/yum.repos.d

vi CentOS-Base.repo //绝对路径是: vi /etc/yum.repos.d/CentOS-Base.repo

clip_image008

vi /etc/yum.repos.d/CentOS-Media.repo

clip_image010

二、iRedMail服务器安装:

1)编译安装:

mkdir /root/mail

mount /dev/hdc /media/

ll /media/

cp /media/iRedMail-0.7.4.tar.bz2 /root/mail

cd /root/mail && ll

tar –jxvf iRedMail-0.7.4.tar.bz2 -C /usr/local/src

clip_image012

若出现如下图所示报错:

备注: 下图中的5个组件光盘中没有,需到网上下载,但是域名iredmail.org被墙了:)故修改为IP址:173.254.22.21

clip_image014

解决方法1:

重点:先下载5个组件!将下图红框中的5个网址复制到IE中,回车!

< INFO > + 1 of 5: http://173.254.22.21/yum/misc/iRedAPD-1.3.6.tar.bz2

< INFO > + 2 of 5: http://173.254.22.21/yum/misc/iRedAdmin-0.1.6.tar.bz2

< INFO > + 3 of 5: http://173.254.22.21/yum/misc/roundcubemail-0.7.tar.gz

< INFO > + 4 of 5: http://173.254.22.21/yum/misc/phpldapadmin-1.2.2.tgz

< INFO > + 5 of 5: http://173.254.22.21/yum/misc/phpMyAdmin-3.4.8-all-languages.tar.bz2

clip_image016

简单的复制方法:

[root@mail misc]# cd /media/

[root@mail media]# cp -p * /usr/local/src/iRedMail-0.8.0/pkgs/misc/

[root@mail media]# cd /usr/local/src/iRedMail-0.8.0/pkgs/misc/

[root@mail misc]# ll

total 9856

-r-xr-xr-x 1 root root 459487 Jun 12 2012 iRedAdmin-0.1.7.tar.bz2

-r-xr-xr-x 1 root root 16300 Jun 12 2012 iRedAPD-1.3.7.tar.bz2

-r-xr-xr-x 1 root root 1415565 Jun 13 2012 phpldapadmin-1.2.2.tgz

-r-xr-xr-x 1 root root 4666051 Jun 12 2012 phpMyAdmin-3.4.9-all-languages.tar.bz2

-r-xr-xr-x 1 root root 778547 Jun 12 2012 phpPgAdmin-5.0.4.tar.bz2

-r-xr-xr-x 1 root root 2714219 Jun 12 2012 roundcubemail-0.7.2.tar.gz [root@mail misc]#

解决方法2:

重点: 将/usr/local/src/iRedMail-0.7.4/pkgs/get_all.sh中的iredmail.org替换为173.254.22.21如下图所示:

clip_image018

clip_image020

clip_image022

//下面原来没有设置:

clip_image024

clip_image026

clip_image028

clip_image030

//挂载光盘原因是其他组件光盘中都有!除了上面的5个组件外J

[root@mail ~]# mount /dev/hdc /media/CentOS/ //挂载光盘

mount: block device /dev/hdc is write-protected, mounting read-only

[root@mail ~]# cd /usr/local/src/iRedMail-0.7.4/pkgs/

[root@mail pkgs]# ll

total 36

-rw-r--r-- 1 root root 10836 Jun 4 21:53 get_all.sh

-rw-r--r-- 1 root root 328 Jan 8 23:44 MD5.misc

-rw-r--r-- 1 root root 58 Jan 8 23:44 MD5.opensuse

-rw-r--r-- 1 root root 188 Jan 8 23:44 MD5.ubuntu.lucid

drwxr-xr-x 2 root root 4096 Jun 4 21:33 misc

drwxr-xr-x 2 root root 4096 Jun 3 18:58 pkgs

-rw-r--r-- 1 root root 140 Jan 8 23:44 SHASUM.freebsd.misc

[root@mail pkgs]# bash get_all.sh

< INFO > Generating yum repository ...

< INFO > Fetching Source Tarballs ...

< INFO > + 1 of 5: http://173.254.22.21/yum/misc/iRedAPD-1.3.6.tar.bz2

< INFO > + 2 of 5: http://173.254.22.21/yum/misc/iRedAdmin-0.1.6.tar.bz2

< INFO > + 3 of 5: http://173.254.22.21/yum/misc/roundcubemail-0.7.tar.gz

< INFO > + 4 of 5: http://173.254.22.21/yum/misc/phpldapadmin-1.2.2.tgz

< INFO > + 5 of 5: http://173.254.22.21/yum/misc/phpMyAdmin-3.4.8-all-languages.tar.bz2

< INFO > Validate Packages ... [ OK ]

< INFO > Installing package(s): dialog.x86_64

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: mirror.bit.edu.cn

* c5-media:

* centosplus: mirror.bit.edu.cn

* extras: mirror.bit.edu.cn

* updates: mirror.bit.edu.cn

c5-media | 1.3 kB 00:00

c5-media/primary | 1.2 MB 00:00

c5-media 3595/3595

centosplus | 1.9 kB 00:00

centosplus/primary_db | 53 kB 00:01

contrib | 1.9 kB 00:00

contrib/primary_db | 1.1 kB 00:00

extras | 2.1 kB 00:00

iRedMail | 951 B 00:00

iRedMail/primary | 56 kB 00:00

iRedMail 179/179

iRedMail-Dovecot-12 | 951 B 00:00

iRedMail-Dovecot-12/primary | 5.3 kB 00:00

iRedMail-Dovecot-12 17/17

updates | 1.9 kB 00:00

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package dialog.x86_64 0:1.0.20051107-1.2.2 set to be updated

--> Finished Dependency Resolution

 

Dependencies Resolved

 

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

Package Arch Version Repository Size

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

Installing:

dialog x86_64 1.0.20051107-1.2.2 base 165 k

 

Transaction Summary

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

Install 1 Package(s)

Upgrade 0 Package(s)

 

Total download size: 165 k

Downloading Packages:

dialog-1.0.20051107-1.2.2.x86_64.rpm | 165 kB 00:04

warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897

base/gpgkey | 1.5 kB 00:00

Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) <[email protected]>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : dialog 1/1

 

Installed:

dialog.x86_64 0:1.0.20051107-1.2.2

 

Complete!

********************************************************

* All tasks had been finished successfully. Next step:

*

* # cd ..

* # bash iRedMail.sh

*

********************************************************

 

[root@mail pkgs]# cd ..

[root@mail iRedMail-0.7.4]# bash iRedMail.sh

clip_image032

解决方法:

软件包冲突,系统已经安装了openldap 的旧版本

方法1:建议先通过 yum update 升级系统,再安装 iRedMail

yum update --exclude=openldap

方法2:卸载掉冲突的i386

//找出冲突的软:

[root@mail iRedMail-0.7.4]# rpm -q openldap --qf '%{NAME} %{VERSION} %{ARCH}'

openldap 2.3.43 x86_64

openldap 2.3.43 i386

[root@mail iRedMail-0.7.4]#

//卸载掉冲突的i386

clip_image034

注:从下往上依次卸载!可能还会出现别的依赖关系:)故如下图所示加 --nodeps

clip_image036

三、iRedMail服务器的配置:

1、创建少量用户:

clip_image038

clip_image040

2、批量创建用户:

cd /usr/local/src/iRedMail-0.7.4/tools/create_mail_user_OpenLDAP.sh

clip_image042

clip_image044

clip_image046

//检验批量创建用户是否成功 https://192.168.1.225/phpldapadmin

clip_image048

clip_image050

3、支持大附件:

1)邮件客户端能发送大附件(eg: outlook) 注:接收方也要能接收大附件,才可,切记!

clip_image052

[root@mail ~]# postconf -e message_size_limit='104857600'

[root@mail ~]# /etc/init.d/postfix restart

Shutting down postfix: [ OK ]

Starting postfix: [ OK ]

[root@mail ~]# service postfix restart

Shutting down postfix: [ OK ]

Starting postfix: [ OK ]

[root@mail ~]#

2)WebMail能发送大附件

//NO.1 vi /etc/php.ini

clip_image054

查找php.ini的绝对路径:

clip_image056

clip_image058

vi /etc/php.ini

clip_image060

clip_image062

//NO.2 vi /var/www/roundcubemail-0.7/.htaccess

clip_image064

vi /var/www/roundcubemail-0.7/.htaccess

clip_image066

重新启动apache服务:

clip_image068

添加apache为系统服务和开机器自启动
# chkconfig --add httpd
# chkconfig httpd on

4、停用杀毒和发垃圾的功能(Aavisd+clamAV+SpamAssassin)

//查找main.cf的绝对路径:

clip_image070

注释掉下面的1行:

clip_image072

clip_image074

clip_image076

clip_image078

一、能收到邮件,但不能发送邮件!

clip_image080

下面是上图报错时,第1745行内容,如下图所示:

clip_image082

思考:

能收,不能发送???接收是pop3服务,发送是SMTP服务!于是,我们检查检查,如下图所示:

clip_image084

经过上面设置后,收发自如!!!

本文出自 “beyondhedefang” 博客,谢绝转载!

你可能感兴趣的:(邮件服务器,iredmail,企业邮件服务器,iRedMail服务器,iRedMail服务器端配置)