Original address: https://www.aolens.cn/?p=1018 1,extmail Overview
Extmail solution is an e-mail system solution based on excellent open source software, with core components including Postfix, Amavisd-new, ClamAV, Extmail, Extman, Courier series Software. is a relatively full-featured free e-mail system.
And Extmail is a Perl language, for large-capacity/isp-level applications, free high-performance webmail software, mainly including Extmail, Extman two parts of the program suite. The Extmail Suite is used to provide a web interface for logging in from the browser, using the messaging system, and the Extman suite for providing a web interface to manage the messaging system from the browser.
2,extmail Working principle
extmail is postfix, a Web page that creates accounts and can send and receive mail. Extman can register the account. The account is stored inside MySQL. Postfix send Letters, dovecot receive letters. Use Outlook to receive letters (DOCECOT) and send letters (postfix) through MySQL queries. Send a letter (postfix) to extract the MySQL account information through Courier-authlib. is a virtual account based mail system.
Configuration preparation:
Modify the host name to mail.aolens.cn
Parsing the mail.aolens.cn on DNS
@ MX mail.aolens.cn
Mail A IP Address
3,extmail Construction
3.1 Installation Dependencies
[[email protected] ~]# yum install httpd mysql mysql-server mysql-devel openssl-devel dovecot perl-dbd-mysql tcl tcl-devel libart_lgpl libart_lgpl-devel libtool-ltdl libtool-ltdl-devel expect [[email protected] ~]# yum groupinstall "Development libraries" "Development tools" [email protected] ~]# service httpd start is starting httpd:httpd: Could not Reliably determine the server ' s fully qualified domain name, using node2.aolens.cn for servername [Determine] [[email protected] ~]# service mysqld start Initialization MySQL database: installing mysql system tables ... [OK] starting mysqld: [Determine] [[email protected] ~]# mysqladmin password aolens #为数据库设置密码3 .2 Installation postfix [[email protected] ~]# rpm -qa postfix postfix-2.6.6-2.2.el6_1.x86_64 [[email protected] ~]# rpm -e postfix --nodeps [[email protected] ~]# id postfixuid=89 (postfix) gid =89 (postfix) Group =89 (postfix), (mail) [[email protected] ~]# userdel postfix [[Email protected] ~]# groupdel postfix [[email protected] ~]# grep postfix /etc/passwd [[email protected] ~]# rm -rf /var/spool/postfix [[email protected] ~]# groupadd -g 2525 postfix [[email Protected] ~]# useradd -g postfix -u 2525 -s /sbin/nologin -M postfix [[email Protected] ~]# groupdel postdrop [[email protected] ~]# groupadd -g 2526 postdrop[[email protected] ~]# useradd -g postdrop -u 2526 -s /sbin/nologin -m postdrop [[email protected] ~]# grep post* /etc/passwd postfix:x:2525:2525::/home/postfix:/sbin/nologin postdrop:x:2526:2526::/home/ Postdrop:/sbin/nologin
postfix version: postfix-3.2-20160327
[[email protected] ~]# wget ftp://ftp.cuhk.edu.hk/pub/packages/mail-server/postfix/ Experimental/postfix-3.2-20160327.tar.gz [[email protected] ~/postfix-3.2-20160327]# yum install cyrus-sasl* sasl:simple authintication secure layer Simple authentication security layer, used to authenticate the mailbox account [[email protected] ~/postfix-3.2-20160327]# make makefiles ' Ccargs=-dhas_mysql -i/usr/include/mysql -duse_sasl_auth -duse_cyrus_sasl -i/usr/include/sasl -duse_tls ' ' auxlibs=-l/usr/lib64/mysql -lmysqlclient -lz -lm -l/usr/lib64/sasl2 - Lsasl2 -lssl -lcrypto ' [[email protected] ~/postfix-3.2-20160327]# make && make install && echo ok follow the prompts to enter the relevant path, omitting the default value install_ Root: [/] /tempdir: [/root/postfix-3.2-20160327] /tmpconfig_directory: [/etc/postfix] /etc/postfixcommand_directory: [/usr/sbin] /usr/sbindaemon_directory: [/usr/libexec/postfix]data_directory: [/var/ lib/postfix]html_directory: [no] /var/www/postfix_htmlmail_owner: [postfix]mailq_path: [/ Usr/bin/mailq]manpage_directory: [/usr/local/man]queue_directory: [/var/spool/postfix]readme_ Directory: [no]sendmail_path: [/usr/sbin/sendmail]setgid_group: [postdrop]shlib_directory: [no]meta_directory: [/etc/postfix][[email protected] ~/postfix-3.2-20160327]# newaliases newaliases: warning: smtputf8_enable is true, but eai Support is not compiled in postalias: warning: smtputf8_enable is true, but eai support is not compiled in [[email protected] /media]# mkdir postfix2.6 [[email protected] /media]# cd postfix2.6/ [[email protected] /mediA/postfix2.6]# wget http://mirrors.sohu.com/centos/6.7/os/x86_64/packages/postfix-2.6.6-6.el6_5.x86_ 64.rpm [[email protected] /media/postfix2.6]# rpm2cpio postfix-2.6.6-6.el6_5.x86_64. rpm |cpio -id 19862 Block [[email protected] /media/postfix2.6]# ls * postfix-2.6.6-6.el6_5.x86_64.rpm etc: pam.d postfix rc.d Sasl2 usr: bin lib libexec sbin share var: lib spool
# Creating a SysV script
[[EMAIL PROTECTED] /MEDIA/POSTFIX2.6/ETC/RC.D/INIT.D]# CP -P POSTFIX /ETC/INIT.D / [[email protected] ~]# chown -r postfix /var/lib/postfix [[email protected] ~]# service postfix start Start postfix: [Determine] [[email protected] ~]# ss -tnlp|grep 25listen 0 100 *:25 *:* users: (("Master", 55347,13) [[email protected] ~]# Chkconfig --add postfix [[email protected] ~]# chkconfig postfix on [[email protected] ~]# vim /etc/postfix/main.cf #添加下列参数 myhostname = mail.aolens.cn mydomain = aolens.cnmyorigin = aolens.cn #邮件地址伪装伪装mail. aolens.cn to aolens.cn inet_interfaces = all mydestination = $ Myhostname, localhost. $mydomain, localhost, $mydomain #所有目标邮件为以上的就是本机, no relaying,  MYNETWORKS = 192.168.1.0/24,127.0.0.0/8.
# #这里注意一下, I 192.168.1.0/24 start writing 192.168.1.129/24 cause RCPT TO: has been 453 errors.
Use the following command to verify that the postfix supports Cyrus-style SASL authentication, which is supported if your output is the following:
[[Email protected] ~]# Service SASLAUTHD start is starting SASLAUTHD: [OK] [email protecte D] ~]# postconf-a Cyrus Dovecot
postconf Command: Configure Postfix
-D: Show default configuration
-N: Show modified Configuration
-M: Show all supported lookup table types
-A: Display supported SASL client plug-in types
-e:parmater=value: Change a parameter configuration information and save it to the main.cf file
SMTP Status code:
SMTP: Protocol command
Helo (SMTP protocol)
EHLO (ESMTP protocol)
Mail from: Mail sender
RCPT TO: Mail Recipient
Date message Content
Subject: Message Header
. Message Terminator
Alias: Mail Alias
[Email protected]:[email protected] French ABC will actually be sent to EFG
Use newaliases to generate/etc/aliases.db
Verify that postfix is installed OK
[[Email protected] ~]# useradd test [[email protected] ~]# telnet localhost 25 Trying ::1... telnet: connect to address ::1: connection refused trying 127.0.0.1... connected to localhost. escape character is ' ^] '. 220 welcome to our mail.aolens.cn esmtp,warning: Version not Available! helo 501 Syntax: HELO hostname helo Localhost 250 mail.aolens.cn mail from:[email protected] 250 2.1.0 ok rcpt to:test 250 2.1.5 Ok data 354 End data with < cr><lf>.<cr><lf> subject:aaa aaaaaaa . 250 2.0.0 ok: Queued as 2b78580ccb quit 221 2.0.0 bye connection closed by foreign host.&nBsp [[email protected] ~]# vim /var/spool/mail/test from [email protected] Wed May 11 10:24:45 2016 Return-Path: <[email protected]> X-Original-To: test Delivered-To: [email protected] Received: from localhost (localhost [127.0.0.1]) by mail.aolens.cn (Postfix) with smtp id 2b78580ccb for <test>; wed, 11 may 2016 10:24:25 + 0800 (CST) subject:aaa message-id: <[email protected]> date: wed, 11 May 2016 10:24:25 +0800 (CST) From: [email protected] Aaaaaaa
We found that the corresponding user in the Mail Drop directory has the email we sent. That means the delivery was successful.
This article is from the "Aolens blocks until those" blog, be sure to keep this source http://aolens.blog.51cto.com/7021142/1783870
Extmail Mail server CentOS build (i)