Mail system Server Setup record (v) (postfix+cyrus-sasl+courier-authlib+dovecot+extmail+mysql)

Source: Internet
Author: User
Tags auth parent directory syslog dovecot install perl

13. Configure Dovecot to access MySQL for verification

The dovecot itself is supported by the MySQL authentication method, which provides a configuration file named Auth-sql.conf.ext under/etc/dovecot/conf.d/:

[[email protected] ~]# cd/etc/dovecot/conf.d/[[email protected] conf.d]# ls auth-master.conf.ext auth-master.conf.ext

However, dovecot default use of the recipient authentication method is the System account password authentication, so auth-sql.conf.ext is not loaded by default, so to edit/etc/dovecot/conf/10-auth.conf load the file:

[Email protected] conf.d]# vi 10-auth.conf #!include auth-system.conf.ext #注释该行!include auth-sql.conf.ext #启用该行

The above modification indicates that the System account password verification configuration file will no longer be loaded and the MySQL certified configuration file is loaded.

To configure the Auth-sql.conf.ext file:

[[Email protected] conf.d]# VI auth-sql.conf.extpassdb {driver = SQL #sql驱动 # Path for SQL configuration fil     E, see example-config/dovecot-sql.conf.ext args =/etc/dovecot/dovecot-sql.conf #详细配置文件}userdb {driver = sql #sql驱动 args =/etc/dovecot/dovecot-sql.conf #详细配置文件}

Create the dovecot-sql.conf file under/etc/dovecot and add the following:

[Email protected] dovecot]# vi dovecot-sql.confdriver = mysql #驱动connect = host=localhost dbname=extmail user=extmail Password=extmail #连接数据库配置default_pass_scheme = Cryptpassword_query = SELECT username as user,password as password from Mailbox where username = '%u ' user_query = SELECT maildir,uidnumber as uid,gidnumber as GID from mailbox where username = ' %u

Note: The contents of the Passdb and UserDB driver configuration of the Auth-sql.conf.ext file are different from dovecot-sql.conf driver, one for SQL and one for MySQL (I don't know why, is it a fixed format?). )

If you restart Dovecot, the following error message is found in/var/log/maillog: Unknown passdb driver ' mysql ', please install Dovecot-mysql package.


14. Configuring Extmail and Extman

Extmail provides a configuration file named WEBMAIL.CF that can be modified for its program content and access to MySQL, editing/var/www/extsuite/extmail/webmail.cf:

[[email protected] ~]# Cd/var/www/extsuite/extmail/[[email protected] extmail]# CP webmail.cf webmail.cf.default[[ Email protected] extmail]# VI Webmail.cfsys_user_lang = ZH_CN #修改默认语言SYS_MAILDIR_BASE =/mailbox #修改maildir路径SYS_MYS Ql_user = Extmail #访问mysql的用户, consistent with Extmail library Sys_mysql_pass = Extmail

The configuration name provided by Extman is called WEBMAN.CF, and the/VAR/WWW/EXTSUITE/EXTMAN/WEBMAN.CF is edited:

[Email protected] extmail]# CD. [[Email protected] extsuite]# CD Extman/[[email protected] extman]# CP webman.cf Webman.cf.default[[email protected] Extm an]# VI webman.cfsys_maildir_base =/mailboxsys_captcha_on = 0 #不使用验证码验证登录SYS_DEFAULT_UID = 2525 #运行该程序的用户UID, should be post Fix uidsys_default_gid = 2525 #运行该程序的用户GID, should be postfix gidsys_mysql_user = Extmailsys_mysql_pass = Extmail

Create the/tmp/extman directory and modify the genus Master Group to Postfix:

[Email protected] ~]# mkdir/tmp/extman[[email protected] ~]# chown Postfix.postfix/tmp/extman


15. Deploying Extmail and Extman

Up to now, Postfix has been configured to support virtual users, Courier-authlib and CRYUS-SASL also configured to support access to MySQL for virtual user sender verification, Dovecot can also access MySQL for virtual user's receive verification, Webmail also completed the configuration, so now as long as the Extmail and Extman deployed, and through the Extman provided by the Web management interface to create virtual users and virtual domain, you can test the entire mail system!


Because the services that send and receive messages are run by postfix users, you modify the owner and group of the Extmail and Extman Web application files (see section 9th) Parent directory/var/www/extsuite to Postfix:

[Email protected] ~]# chown-r postfix.postfix/var/www/extsuite/

To modify the Apache server configuration file/etc/httpd/conf/httpd.conf:

[Email protected] ~]# vi/etc/httpd/conf/httpd.conf <virtualhost *:80> #开启虚拟主机 documentroot/var/www/extsuite /extmail/html/servername mail.ahltnew.com #与系统主机名一致 scriptalias/extmail/cgi/var/www/extsuite/extmail/cgi Al ias/extmail/var/www/extsuite/extmail/html scriptalias/extman/cgi/var/www/extsuite/extman/cgi alias/extman/var/ www/extsuite/extman/html suexecusergroup postfix postfix #表示切换成postfix用户和postfix组来运行该Web程序 </VirtualHost>


16. Restart all related services

At this point, all the configurations have been completed and the following services are restarted:

[Email protected] ~]# service postfix restart #postfix [[email protected] ~]# service SASLAUTHD restart #cyrus-sasl[    [Email protected] ~]# service courier-authlib restart #courier-authlib[[email protected] ~]# service Dovecot restart #dovecot [[Email protected] ~]# service httpd restart #apache server

At this point, the mailbox system setup basically ended.


Note: The logs during the Postfix,courier-authlib,cyrus-sasl,dovecot run can be viewed through/var/log/maillog, and the Apache server logs are/var/log/httpd/ Error_log for viewing.


Visit http://host Ip/extmail to log in to Extmail, if the page prompts Unix::syslog not found, install the Perl-unix-syslog package.

[email protected] ~]# Yum install Perl-unix-syslog


You can only assign the permissions of select to MySQL extmail users, create a new MySQL user to modify Extmail library record content, and modify WEBMAN.CF Sys_mysql_user and Sys_mysql_ Pass configuration item content is the user name and password, that is, can achieve webmail access and management of the separation of permissions.

Mail system Server Setup record (v) (postfix+cyrus-sasl+courier-authlib+dovecot+extmail+mysql)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.