Mail system server Setup record (iv) (POSTFIX+CYRUS-SASL+COURIER-AUTHLIB+DOVECOT+EXTMAIL+MYSQL)

Source: Internet
Author: User
Tags dovecot

8. Install Apache Http Server:

[email protected] ~]# Yum install httpd

9. Download Extmail and Extman and initialize the Extmail database using the MySQL script provided by Extman

Visit the Extmail official website (http://www.extmail.org/) to download the Extmail and Extman package, unzip:

[Email protected] ~]# tar-xf extmail-1.2.tar.gz[[email protected] ~]# tar-xf extman-1.1.tar.gz

Create a new/var/www/extsuite directory and move the extracted extmail and Extman directories to this directory:

[Email protected] ~]# Mkdir-pv/var/www/extsuite[[email protected] ~]# mv Extmail-1.2/var/www/extsuite/extmail[[email Protected] ~]# MV Extman-1.1/var/www/extsuite/extman

Entering the/var/www/extsuite/extman/docs directory, you can find 2 files named SQL-terminated:

[[email protected] ~]# cd/var/www/extsuite/extman/docs/[[email protected] docs]# ls *.sqlextmail.sql init.sql

Two are MySQL scripts, Extmail.sql used to build Extmail database and related table structure; Init.sql is used to insert some initialization data and run as root using the MySQL command:

[Email protected] ~]# mysql-uroot <extmail.sql[[email protected] ~]# mysql-uroot <init.sql

At this point MySQL has established the Extmail database, and the virtual user, virtual domain-related table structure has been established.

Note: If MySQL is a version above 5.1, then the above script may run with errors and need to modify "Type=myisam" in the script to "Engine=innodb".


10. Configuring the Cyrus-authlib AUTHMYSQLRC file

In this case, MySQL has generated the Extmail database, and established a Extmail user to access the Extmail database, so you can configure the cyrus-authlib MySQL configuration file/ETC/AUTHMYSQLRC:

[[email protected] ~]# vi /etc/authmysqlrcmysql_server             localhost     #mysql服务器所在地址MYSQL_USERNAME            extmail     #访问mysql的用户名MYSQL_PASSWORD           extmai     #访问mysql的用户口令MYSQL_ socket    /var/lib/mysql/mysql.sock     #mysql套接字文件所在地址MYSQL_PORT                3306    # MySQL Service listener Port mysql_opt                0     #可选项MYSQL_DATABASE           extmail      #库名, the script provided by Extman is based on the Extmail library mysql_user_table         mailbox     #要访问的虚拟用户信息所在的表名MYSQL_CRYPT_PWFIELD      password      #验证虚拟用户所用到的口令, use the password field of the mailbox table in the Extmail library to represent mysql_uid_field          2525     #启动mysql服务的系统用户的UID because the postfix user calls Postfix and Courier-authlib, So it should be the Postfix user's uidmysql_gid_field         2525      #启动mysql服务的系统用户的GIDMYSQL_LOGIN_FIELD        username      #虚拟用户名, use the username field of the mailbox table in the Extmail library to represent mysql_home_field         Concat ('/mailbox/', homedir)      #虚拟用户家目录的地址, specific user's home directory address using/mailbox/+ Homedir field values stored in the mailbox table of the Extmail library are stitched together into mysql_name_field        name      #虚拟用户姓名MYSQL_MAILDIR_FIELD      concat ('/mailbox/', MAILDIR)       #虚拟用户存放邮件的地址, the specific user's home directory address using/mailbox/+ stored in extMail Library mailbox table Maildir field values are stitched together 

11. Configure Postfix to support virtual users

To edit the postfix configuration file/etc/postfix/main.cf, add the following configuration parameters:

#virtualvirtual_mailbox_base =/mailbox #配置虚拟用户邮箱所在基本目录virtual_mailbox_maps = Mysql:/etc/postfix/mysql_virtual_ MAILBOX_MAPS.CF #配置虚拟用户邮箱地址virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf # Configure the virtual domain virtual_alias_domains =virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf #配置虚拟用户别名virtual_ Uid_maps = static:2525 #访问所有虚拟邮件用户时, need to use the operating system user for proxy access, the agent access system user Uidvirtual_gid_maps = static:2525 #访问所有虚拟邮件用户时, need to use the operation system User for proxy access, System user Gidvirtual_transport = Virtual #支持虚拟用户所使用的postfix驱动为virtual

Note: If you enable quota control for a virtual user's mailbox, you can add the following configuration parameters:

Message_size_limit = 14336000 #单条邮件大小的最大值, in bytes Virtual_mailbox_limit = 52428800 #单用户邮箱容量的最大值, in bytes

In the above configuration, the Virtual_mailbox_maps,virtual_mailbox_domains,virtual_alias_maps parameter value format is MySQL: Config file address, Indicates that postfix will look for table records in MySQL to get the corresponding parameter values, and the Postfix lookup table type is mysql-enabled:

[Email protected] ~]# Postconf-m | grep mysqlmysql

The corresponding virtual user mailbox address, virtual domain, virtual user alias configuration file, Extman has been provided, location under/var/www/extsuite/extman/docs/, copy it to the/etc/postfix/directory:

[Email protected] ~]# cd/var/www/extsuite/extman/docs/[[email protected] docs]# ls-l mysql_virtual_*-rw-r--r--. 1 postfix postfix 166 DEC 2005 Mysql_virtual_alias_maps.cf-rw-r--r--. 1 postfix postfix 168 mysql_virtual_domains_maps.cf-rw-r--r--. 1 postfix postfix 2005 Mysql_virtual_limit_maps.cf-rw-r--r--. 1 postfix postfix 172 Dec 2005 Mysql_virtual_mailbox_maps.cf-rw-r--r--. 1 postfix postfix 173 Mar 7 Mysql_virtual_sender_maps.cf[[email protected] docs] #cp mysql_virtual_*/etc/postfix/

12. Modify the CYRUS-SASL configuration file for smtpd/usr/lib64/sasl2/smtpd.conf, which is taken over by the Authdaemond process (provided by the Courier-authlib service):

[Email protected] ~]# Vi/usr/lib64/sasl2/smtpd.confpwcheck_method:authdaemondmech_list:plain Loginauthdaemond_ Path:/var/spool/authdaemon/socket #authdaemond使用套接字通信的套接字文件所在路径

The next article will cover configuration Dovecot to support access to MySQL to complete the collection certification work, as well as the deployment of Extmail and the hypervisor Extman

Mail system server Setup record (iv) (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.