搭建电子邮件服务器(设置Vimbadmin)

验证环境

2014年11月在亚马逊EC2上建立:
CentOS版本为6.5 64位,
postfix版本为2.6.6,
PHP版本为5.5.19,
Apache版本为2.2.15(CentOS),
MySQL版本为14.14 Distrib 5.1.73。

后缀,已安装mysql。同时,Selinux已关闭,并且iptables已禁用。

安装Vimbadmin

Vimbadmin的PHP版本建议为5.4或以上。目前在CentOS6.5上可通过yum包安装的PHP版本为5.3。

配置yum仓库的设置

请参考以下步骤,设置Remi仓库并获取5.5版本的包。

在CentOS上安装PHP5.5
http://qiita.com/pakiln/items/bcddcdd96e94dab96873

安装PHP

您可以基本上按照原始版本的安装步骤进行设置。

请点击以下链接查看ViMbAdmin安装的相关信息:

https://github.com/opensolutions/ViMbAdmin/wiki/Installation

仅提供一种中文本地化翻译:
由于这是针对Ubuntu的版本,所以会对一部分进行更改以适应CentOS。以下是yum软件包的安装说明。

yum -y install --enablerepo=remi --enablerepo=remi-php55 php php-mbstring php-cgi php-mcrypt php-memcache php-json php-mysql php-gettext 

指定安装路径。

export INSTALL_PATH=/srv/vimbadmin

安装 PHP Composer。

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
chmod 755 /usr/local/bin/composer

我会使用Git下载Vimbadmin并进行安装。

yum -y install git
git clone https://github.com/opensolutions/ViMbAdmin.git $INSTALL_PATH
cd $INSTALL_PATH
composer install --dev

chmod -R 777 $INSTALL_PATH/var

我将创建一个数据库。

CREATE DATABASE `vimbadmin`;
grant all privileges on vimbadmin .* to vimbadmin@localhost identified by 'password';
FLUSH PRIVILEGES;

修改设置文件的数据库部分。

resources.doctrine2.connection.options.driver   = 'pdo_mysql'
resources.doctrine2.connection.options.dbname   = 'vimbadmin'
resources.doctrine2.connection.options.user     = 'vimbadmin'
resources.doctrine2.connection.options.password = 'password'
resources.doctrine2.connection.options.host     = 'localhost'

我要创建一个表格。

cd $INSTALL_PATH
./bin/doctrine2-cli.php orm:schema-tool:create

我要修改Apache的配置文件。

<Directory "/var/www/html">

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
#    Options Indexes FollowSymLinks
    Options Indexes FollowSymLinks ExecCGI

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
#    AllowOverride None
    AllowOverride All

创建 Apache 的配置文件。

Alias /vimbadmin /srv/vimbadmin/public

<Directory /srv/vimbadmin/public>
    Options FollowSymLinks
    AllowOverride None

    # For Apache <= 2.3:
    Order allow,deny
    allow from all

    # For Apache >= 2.4
    # Require all granted

    SetEnv APPLICATION_ENV production

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^.*$ /vimbadmin/index.php [NC,L]
    # RewriteRule ^.*$ /smtpconf/index.php [NC,L]
</Directory>

重新启动httpd。

我們的安裝完成了。現在立即嘗試訪問http://localhost/vimbadmin。

image

将安全验证码更改为所显示的内容。

[user]


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Installation Keys and Salts

;securitysalt                       = ""
;resources.auth.oss.rememberme.salt = ""
;defaults.mailbox.password_salt     = ""
securitysalt                       = "@mEZ*,yx~;=L:\iA,:5TKJY?Igejx8)M<-7@VwTMi1Whjb7)3]EU>WKQ2zBIqP5n"
resources.auth.oss.rememberme.salt = "<]~o?|\|Ne(dKv{WxgpiFJ@6vO_b^qX/p!/EjL[$nczLeia+YWY=Q3=-_]S~S<1H"
defaults.mailbox.password_salt     = ">[@7pzde&WEk2yGBitSEzTM0|6Gm]HRPY=Dwac4s/1?v~?A[)\T0D<x#=n$*A@3H"

使用设定的安全密码,创建管理员账户。

security salt : 
e-mail : postmaster@example.com
passowrd : test!123

我会登录。

image

创建域名。
选择域名选项卡,点击右上角的+按钮。

image

这是一个创建域名的界面。

image

结束

GUI现在很时尚和酷。

似乎可以使用以下功能:
1.通过用户登录更改密码。
2.删除邮件账户。
在删除时,还可以选择同时删除账户的邮箱,或保留它们。