最详细的Extmail安装文档
Extmail安装
以下相关包下载,整理也比较耗费时间,您的鼓励,是我前进的动力!
Extmail依赖安装包
Extmail优化版
Extmail网关
openresty
extmail集成接口
部署文档
文章目录
- Extmail安装
- 一、准备工作
- 1.关闭Selinux:
- 2.关闭firewalld防火墙:
- 3.挂载镜像
- 4.更新yum :
- 5.涉及软件 :
- 6.防火墙策略开通 :
- 二、软件安装
- 1.Mysql安装 :
- 2.设置邮箱目录 :
- 3.courier-authlib安装 :
- 4.POSTFIX 安装:
- 5.dovecot安装 :
- 6.Extmail :
- 7.Web服务 :
- 8.服务启动 :
- 9.userctl说明 :
- 总结
一、准备工作
1.关闭Selinux:
setenforce 0
vi /etc/sysconfig/selinux
SELINUX=disabled
getenforce
2.关闭firewalld防火墙:
systemctl stop firewalld
3.挂载镜像
:
mount -t iso9660 -o loop /home/CentOS-7-x86_64-Everything-1810.iso /media/CentOS7
umount /media/CentOS7CentOS-Base.repo
[centos7-media]
name=centos7
baseurl=file:///media/CentOS7
enabled=1
gpgcheck=0
gpgkey=file:///media/CentOS7/RPM-GPG-KEY-CentOS-7
4.更新yum :
yum clean
yum makecache
yum update
5.涉及软件 :
软件及版本 用途
postfix-3.0.5.tar.gz 邮件基础服务,默认版本不支持虚拟机用户。
courier-authlib-0.66.2.tar.bz2 邮箱认证组件
courier-unicode-1.2.tar.bz2
Extmail1.2.tar.gz 邮箱安装包
Extman1.1.tar.gz
Unix-Syslog-1.1.tar.gz 日志组件
mysql-5.7.32-1.el7.x86_64.rpm-bundle.tar.gz 数据安装库包(由于与邮件代理、认证交互严重依赖mysql相关包,建议是使用安装版本)
6.防火墙策略开通 :
firewall-cmd --add-port=80/tcp --permanent
firewall-cmd --reload
systemctl restart firewalld
二、软件安装
1.Mysql安装 :
yum install mysql mysql-devel mysql-server
Vi /etc/my.cnf
validate_password_policy=0
validate_password_length=0
#查询临时密码
grep 'temporary password' /var/log/mysqld.log
alter user root@localhost identified by 123456;
update user set host = '%' where user = 'root';
2.设置邮箱目录 :
mkdir -p /u01/mailbox
chown -R postfix:postfix /u01/mailbox
chmod -R 775 /u01
chmod -R 775 /u01/mailbox
#一定保证/u01与/u01/mailbox权限为775 否则出现如下问题:
chdir to /home/domains/test.com/test/Maildir/, Permissiondenied
3.courier-authlib安装 :
[root@mail ~]# tar jxvf courier-unicode-1.2.tar.bz2
[root@mail ~]# cd courier-unicode-1.2
[root@mail courier-unicode-1.2]# ./configure
[root@mail courier-unicode-1.2]# make && make install[root@mail /usr/local/src]# tar -jxvf courier-authlib-0.66.2.tar.bz2
[root@mail /usr/local/src]# cd courier-authlib-0.66.2
[root@mail /usr/local/src/courier-authlib-0.66.2]#
./configure \--prefix=/usr/local/courier-authlib \--sysconfdir=/etc \--without-authpam \--without-authshadow \--without-authvchkpw \--without-authpgsql \--with-authmysql \--with-mysql-libs=/usr/lib64/mysql \--with-mysql-includes=/usr/include/mysql \--with-authmysqlrc=/etc/authmysqlrc \--with-authdaemonrc=/etc/authdaemonrc \--with-mailuser=postfix \
--with-mailgroup=postfix [root@mail /usr/local/src/courier-authlib-0.66.2]# make && make install[root@mail courier-authlib-0.66.2]#
chmod 755 /usr/local/courier-authlib/var/spool/authdaemon
[root@mail courier-authlib-0.66.2]# cp /etc/authdaemonrc.dist /etc/authdaemonrc
[root@mail courier-authlib-0.66.2]# cp /etc/authmysqlrc.dist /etc/authmysqlrc
[root@mail courier-authlib-0.66.2]# vim /etc/authdaemonrc
daemons=10
authmodulelist="authmysql"
authmodulelistorig="authmysql"[root@mail courier-authlib-0.66.2]# vim /etc/authmysqlrc //直接添加到配置文件尾部,然后去上面将响应系统默认的注视掉,或者删除即可
MYSQL_SERVER localhost
MYSQL_USERNAME extmail
MYSQL_PASSWORD Extmail@123
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_PORT 3309
MYSQL_DATABASE extmail
MYSQL_USER_TABLE mailbox
MYSQL_CRYPT_PWFIELD password
MYSQL_UID_FIELD 2525
MYSQL_GID_FIELD 2525
MYSQL_HOME_FIELD concat('/u01/mailbox/',homedir)
MYSQL_MAILDIR_FIELD concat('/u01/mailbox/',maildir)courier-authlib添加服务启动脚本及其他
[root@mail courier-authlib-0.66.2]# cp courier-authlib.sysvinit /etc/init.d/courier-authlib
[root@mail courier-authlib-0.66.2]# chmod +x /etc/init.d/courier-authlib
[root@mail courier-authlib-0.66.2]# chkconfig --add courier-authlib
[root@mail courier-authlib-0.66.2]# chkconfig courier-authlib on
[root@mail courier-authlib-0.66.2]# echo "/usr/local/courier-authlib/lib/courier-authlib" >> /etc/ld.so.conf.d/courier-authlib.conf
[root@mail courier-authlib-0.66.1]# ldconfig
[root@mail courier-authlib-0.66.1]# service courier-authlib start
Starting Courier authentication services: authdaemondsystemctl restart courier-authlib
4.POSTFIX 安装:
yum install vim gcc gcc-c++ openssl openssl-devel db4-devel ntpdate bzip2 expect php-mysql cyrus-sasl-md5 perl-GD perl-DBD-MySQL perl-Switch perl-GD perl-CPAN perl-CGI perl-CGI-Session cyrus-sasl-lib cyrus-sasl-plain cyrus-sasl cyrus-sasl-devel libtool-ltdl-devel telnet mail libicu-devel -y(Centos7 ISO缺少libtool-ltdl-devel-2.4.2-22.el7_3.x86_64.rpm,需要单独安装,否则postfix服务无法安装。) yum remove postfix -y
userdel postfix
groupdel postdropgroupadd -g 2525 postfixgroupadd -g 2526 postdropuseradd -g postfix -u 2525 -s /sbin/nologin -M postfixuseradd -g postdrop -u 2526 -s /sbin/nologin -M postdroptar xf postfix-3.0.15.tar.gzcd postfix-3.0.15make 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 -lrt -lm -L/usr/lib64/sasl2 -lsasl2 -lssl -lcrypto'make && make installchown -R postfix. /var/lib/postfix/.chown -R postfix. /var/lib/postfix/./master.lockchown -R postfix. /var/spool/postfix/privatechown -R postfix.postdrop /var/spool/postfix/public[root@mail /var/www/extsuite/extman]# chmod +x /etc/init.d/postfix
[root@mail /var/www/extsuite/extman]# chkconfig --add postfix
[root@mail /var/www/extsuite/extman]# chkconfig postfix on
[root@mail /var/www/extsuite/extman]# chown postfix.postfix -R /var/lib/postfix/
[root@mail /var/www/extsuite/extman]# chown postfix.postfix /var/spool/ -R[root@mail ~]# vim /etc/postfix/main.cf
# domain 配置
myhostname = mail.xx.gov.cn
myorigin = mail.xx.gov.cn
mydestination =
mydomain = mail.xx.gov.cn
mynetworks = 198.0.0.0/24, 127.0.0.0/8
relay_domains = cp mysql_virtual_* /etc/postfix/########################Virtual Mailbox Settings########################
virtual_mailbox_base = /u01/mailbox
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_uid_maps = static:2525
virtual_gid_maps = static:2525
virtual_transport = virtual[root@mail ~]# vim /etc/postfix/main.cf
#在配置文件末尾增加如下内容:
smtputf8_enable = no
############################CYRUS-SASL############################
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $mydestination
smtpd_sasl_security_options = noanonymous
smtpd_sasl_path = smtpd[root@mail ~]# vim /usr/lib64/sasl2/smtpd.conf //文件不存在,要自己创建
pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGINallow_plaintext=true
auxprop_plugin:mysql
sql_hostnames:localhost
sql_user:extmail
sql_password:extmail
sql_database:extmail
sql_select:select password from mailbox where username='%u'authdaemond_path:/usr/local/courier-authlib/var/spool/authdaemon/socket
chmod -R 775 /usr/local/courier-authlib/var/spool/authdaemon
5.dovecot安装 :
yum install -y dovecot dovecot-devel dovecot-mysql[root@mail dovecot]# vim dovecot.conf //直接在配置文件最后添加即可
protocols = pop3
#!include conf.d/*.conf
#Listen = *
#base_dir = /var/run/dovecot/[root@mail conf.d]# vim 10-auth.conf
disable_plaintext_auth = no
!include auth-sql.conf[root@mail conf.d]# vim 10-mail.conf
#mail_location = maildir:~/Maildir
mail_location = maildir:/u01/mailbox/%d/%n/Maildir
#mail_privileged_group = mail[root@mail conf.d]# cp auth-sql.conf.ext auth-sql.conf
[root@mail conf.d]# vim auth-sql.conf
passdb { driver = sql # Path for SQL configuration file, see example-config/dovecot-sql.conf.ext args = /etc/dovecot/dovecot-sql.conf
}userdb { driver = sql args = /etc/dovecot/dovecot-sql.conf
}[root@mail conf.d]# vim /etc/dovecot-mysql.conf //手动创建
driver = mysql
connect = host=localhost dbname=extmail user=extmail password=extmail
default_pass_scheme = CRYPT
password_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'systemctl restart dovecot
6.Extmail :
sed -i 's@TYPE=MyISAM@ENGINE=InnoDB@g' extmail.sql
sed -i 's@Password@authentication_string@g' extmail.sql
mysql -uroot -p < extmail.sql
mysql -uroot -p < init.sqlmysql> GRANT ALL ON extmail.* TO extmail@loaclhost IDENTIFIED BY 'extmail';
mysql> GRANT ALL ON extmail.* TO extmail@127.0.0.1 IDENTIFIED BY 'extmail';
mysql> GRANT ALL ON extmail.* TO webman@localhost IDENTIFIED BY 'webman';
mysql> GRANT ALL ON extmail.* TO webman@127.0.0.1 IDENTIFIED BY 'webman';
mysql> FLUSH PRIVILEGES;
mysql> \qtar xf extmail-1.2.tar.gz
mkdir -pv /var/www/extsuite
mv extmail-1.2 /var/www/extsuite/extmailtar xf extman-1.1.tar.gz
mv extman-1.1 /var/www/extsuite/extman[root@mail extmail]# cp webmail.cf.default webmail.cf
[root@mail extmail]# vim webmail.cf
SYS_SESS_DIR = /tmp/extmail
SYS_UPLOAD_TMPDIR = /tmp/extmail/upload
SYS_USER_LANG = zh_CN
SYS_MIN_PASS_LEN = 8
SYS_MAILDIR_BASE = /var/mailbox
SYS_MYSQL_USER = extmail
SYS_MYSQL_PASS = extmail
SYS_MYSQL_DB = extmail
SYS_MYSQL_HOST = localhost
SYS_MYSQL_SOCKET = /var/lib/mysql/mysql.sock
SYS_MYSQL_TABLE = mailbox
SYS_MYSQL_ATTR_USERNAME = username
SYS_MYSQL_ATTR_DOMAIN = domain
SYS_MYSQL_ATTR_PASSWD = password
SYS_AUTHLIB_SOCKET = /usr/local/courier-authlib/var/spool/authdaemon/socketmkdir -p /tmp/extmail
mkdir -p /tmp/extmail/upload
chown -R postfix.postfix /tmp/extmailvim /var/www/extsuite/extman/webman.cf
#修改用户邮件存放目录
SYS_MAILDIR_BASE = /var/mailbox
#关闭验证模块
SYS_CAPTCHA_ON = 0
#修改ID号
SYS_DEFAULT_UID = 2525
SYS_DEFAULT_GID = 2525
#修改连接数据库的用户名密码
SYS_MYSQL_USER = extmail
SYS_MYSQL_PASS = extmail
#修改存放session的临时目录
SYS_SESS_DIR = /tmpmkdir -p /tmp/extman
chown -R postfix.postfix /tmp/extman
7.Web服务 :
vim /var/www/extsuite/extmail/dispatch-init
SU_UID=postfix
SU_GID=postfix
[root@mail ~]# /var/www/extsuite/extmail/dispatch-init start
Starting extmail FCGI server...
[root@mail ~]# /var/www/extsuite/extman/daemon/cmdserver -v -d
loaded okserver {listen 80;server_name mail.everyoo.com;index index.html index.htm index.php index.cgi;root /var/www/extsuite/extmail/html/;location /extmail/cgi/ {fastcgi_pass 127.0.0.1:8888;fastcgi_index index.cgi;fastcgi_param SCRIPT_FILENAME /var/www/extsuite/extmail/cgi/$fastcgi_script_name;include fcgi.conf;}location /extmail/ {alias /var/www/extsuite/extmail/html/;}location /extman/cgi/ {fastcgi_pass 127.0.0.1:8888;fastcgi_index index.cgi;fastcgi_param SCRIPT_FILENAME /var/www/extsuite/extman/cgi/$fastcgi_script_name;include fcgi.conf;}location /extman/ {alias /var/www/extsuite/extman/html/;}access_log /var/log/extmail_access.log;
}
8.服务启动 :
systemctl restart postfix postfix服务(邮件传输代理)
systemctl restart dovecot IMAP/POP3
systemctl restart courier-authlib 认证服务
/var/www/extsuite/extmail/dispatch-init restart
/var/www/extsuite/extman/daemon/cmdserver -v -d 邮件web服务
cd /home/app/luaApp/nginx-lua/bin/ sh start.sh 代理服务
9.userctl说明 :
[root@mail tools]# perl ./userctl.plusage: ./userctl.pl command [options] ...Commands:add -- add a userbadd -- batch add usersdel -- delete a userbdel -- batch delete userslist -- list all of users in a domainshow -- show profile of a usermod -- modify user infomationhelp -- display this help and exitOptions:-u, --username="username@domain.tld" A username as email address-p, --password="******" User password-f, --file="/path/to/filename.csv" A CSV file path, Just for batch add users, one user one lineusername.tld password-d, --domain="domain.tld" A domain name-n, --name="name" common name-i, --uid="uid" uid-Q, --question="what are you doing?" Question?-A, --answer="play games" Answer-U, --uidnumber="1000" User ID number-G, --gidnumber="1000" Group ID number-e, --expire="2012-12-31" Expire date-q, --quota=100 Mail box quota-N, --ndquota=100 Network disk quota-a, --active=1 Enable or disable (1 or 0)-S, --services="smtp,smtpd,pop3,webmail" Enable services (smtp,smtpd,pop3,imap,webmail,netdisk,pwdchange)-su, --setuid="vuser" A system user to setuid if you want-sg, --setgid="vgroup" A system user to setgid if you want-H, --mailhost="mailhost" Mailhost is useful if you use ISP mode-no, --nomaildir=1 Do you want create users maildir-D, --delmaildir=0 Do you want keep users maildir-qq, --quiet quiet mode, no any feedback-x, --xml output XML format data
总结
以上为大家介绍了Extmail安装部署,如果您遇到问题解决不了也可以私信与我,也可以下载文档,其包含错误及处理办法
例如:
extmail/cgi/index.cgi?__mode=:%3E%22%27%3E%3Cscript%3Ealert(%27Antiy%27)%3C/script%3E&error=badlogin
可以被渗透,已经解决,图如下
最详细的Extmail安装文档相关推荐
- ELK安装文档及相关优化
前言:随着硬件成本的不断低廉,我们可以存储更多数据内容,也会对各数据加以利用,其中一项很重要的数据内容便是日志文件,无论是访问日志还是系统日志或是应用日志,都显得十分重要,而怎么加以利用一直是一个难题 ...
- Oracle 11g 单实例安装文档
这里介绍在Red Hat Enterprise Linux Server release 5.7 (Tikanga)下安装ORACLE 11.2.0.1.0的过程,本文仅仅是为了写这样安装指导文档而整 ...
- Oracle 12c RAC 安装文档
首先,谢谢原作者:此文为转载的文章,现将原地址贴出如下: Oracle 12c RAC 安装文档www.cnblogs.com/leohahah/p/9488963.html 更多精彩Zabbix文 ...
- 达梦数据库DSC集群安装文档
达梦数据库DSC集群安装文档 一. DSC安装准备工作 1 1.1. 创建安装用户 2 1.2. 配置udev存储 2 二. DMDSC 搭建 8 三. 搭建DW容灾架构 39 修改dm.ini,数据 ...
- openstack_Stein版安装文档
openstack Stein 版本安装文档 2019年8月28日 陈即彪 文章目录 1. openstack介绍 1.1. 云计算模式 2. OpenStack 中有哪些项目? 2.1. Opens ...
- Mac下基于Homebrew的Rattle安装和对于权威安装文档的一点更新建议
助人为乐了,没想到我也有今天(狗头).昨天帮商科舍友装Rattle, 算是让我想起以前远程Ubuntu服务器的痛苦回忆了.不过其实对于新手的干干净净的电脑来说从头装比几十个版本的Python和bala ...
- RAW+ASM 的RAC 10g 安装文档
RAW+ASM 的RAC 10g 安装文档 http://blog.csdn.net/tianlesoftware/article/details/5332909 有关RAC 的一些概念性和原理性 ...
- Boost Getting Started 安装文档(翻译1.33版本)
概要 下载 .zip 文件 .tar.gz and .tar.bz2 文件 Boost CVS 库 准备 配置工具 支持的编译器 编译安装 结果 在Windows下面自动链接 附加的步骤 概要 这个概 ...
- Zabbix4.0安装文档
**Zabbix4.0安装文档 ** zabbix的官方要求: 1.客户端 安装脚本 #!/bin/bash ##zabbix-agent安装 ##zabbix-agent版本:4.0.2 ##添加y ...
- mysql数据库21_Mysql5.7.21安装文档
Mysql5.7.21安装文档 发布时间:2020-06-27 13:59:56 来源:51CTO 阅读:946 作者:PengChonggui --1.创建用户组mysql,创建用户mysql并将其 ...
最新文章
- NHibernate Step by Step:序篇 (转)
- 检查 Flutter 应用程序是否在 Web 上运行
- thinkphp memcache mysql_thinkphp中memcache的用法实例
- MyEclipse上Git的使用(包含导入和导出)
- Vue 3源码剖析,看这篇就够了
- c语言三个数从小到大排序/输出_我的c语言笔记(三)
- pytest源码_pytest文档60pytest.main()的使用
- 电子邮件.NET控件MailBee.NET Objects v11.1发布丨附下载
- mysql+proxysql+keepalived实现高可用的数据库读写分离
- [Unity] 利用Culling Group实现LOD和剔除逻辑
- 服务器系统0 c000000f,win10系统提示错误代码0xc000000f的三种解决方法
- 禁止每次打开edge自动在开始菜单创建Microsoft Edge 的 Edge 栏
- JAVA中链表的next解释
- nc65右键生成菜单_NC65管理员层级管控
- EasyRecovery最新版本Photo16电脑数据恢复软件下载
- 计算机网络-自顶向下方法 第三章课后习题答案(第七版)
- Python输出三角形图案
- python实现中文和unicode转换
- 自动排哨位管理系统开题报告
- Win10 连接不上局域网共享文件解决方案