我在这里推荐一个我自己还在用的邮件系统——EwoMail

软件官网主页截图

软件官网

传送门?

软件使用截图




软件最低配置要求

  • CPU:1核
  • 内存:1G
  • 硬盘:40G

服务器特殊要求

服务器需要25端口
目前已知国内可开放25端口的VPS商:
一般国外主机都开放25端口
如果你们还知道什么可以开25端口的可以在评论区留言

是否支持服务器虚拟化

如果你们还知道什么虚拟化可以安装可以在评论区留言

  • 支持OpenV
  • 支持KVM
  • 支持独服

软件安装教程

系统选择Centos 7
以下部分教程及图片来自官方安装文档

  1. 先连接上自己的服务器
  2. 关闭selinux
    vi /etc/sysconfig/selinux
    SELINUX=enforcing 改为 SELINUX=disabled

  3. 检查swap
    查看swap
    free -m
  4. 创建swap分区(内存超过2G,可不配置)
    创建1G的swap,可以根据你的服务器配置来调整大小

    dd if=/dev/zero of=/mnt/swap bs=1M count=1024

    设置交换分区文件

    mkswap /mnt/swap

    启动swap

    swapon /mnt/swap

    设置开机时自启用 swap 分区

    需要修改文件 /etc/fstab 中的 swap 行,添加
    /mnt/swap swap swap defaults 0 0

  5. 安装EwoMail
    yum -y install git
    cd /root
    git clone https://github.com/gyxuehu/EwoMail.git
    cd /root/EwoMail/install
    #需要输入一个邮箱域名,不需要前缀,列如下面的test.com
    sh ./start.sh test.com
  6. 域名解析
    以下为官方参考图,部分内容请自行替换
  7. 用mail.test.com进行https连接
    上传SSL证书到/root/EwoMail/ssl

    cd /root/EwoMail/
    mkdir ssl
    cd /root/EwoMail/ssl

    上传证书至该目录

  8. 修改Nginx配置文件

    vi /ewomail/nginx/conf/nginx.conf

    删除如下

    server {
        listen 80 default_server;
        server_name localhost;
        root /ewomail/www/default;
        index index.php index.html index.htm;
    
        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                        fastcgi_param  PHP_VALUE        open_basedir=$document_root:/tmp/:/proc/;
            include        fastcgi_params;
        }

    替换如下

    server {
    listen 80;
    listen 443;
    ssl on;
    server_name mail.test.com;
    #http转发至https
    if ($server_port !~ 443){
        rewrite ^(/.*)$ https://$host$1 permanent;
    }
    #ssl信息,请自行修改
    ssl_certificate    /root/EwoMail/ssl/fullchain.pem;
    ssl_certificate_key    /root/EwoMail/ssl/privkey.key;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    error_page 497  https://$host$request_uri;
    #端口转发至8000
    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        root /usr/local/nginx/html;
        index index.html index.htm;
        }
    }
  9. 启动Nginx
    service nginx start
  10. 管理后台地址
    请及时修改密码

进阶玩法

mail.test.com对应用户区
mailadmin.test.com对应后台
在修改Nginx配置文件时,删除后替换如下

server {
listen 80;
listen 443;
ssl on;
server_name mail.test.com;
#http转发至https
if ($server_port !~ 443){
    rewrite ^(/.*)$ https://$host$1 permanent;
}
#ssl信息,请自行修改
ssl_certificate    /root/EwoMail/ssl/fullchain1.pem;
ssl_certificate_key    /root/EwoMail/ssl/privkey1.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
error_page 497  https://$host$request_uri;
#端口转发至8000
location / {
    proxy_pass http://127.0.0.1:8000;
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    root /usr/local/nginx/html;
    index index.html index.htm;
    }
}
server {
listen 80;
listen 443;
ssl on;
server_name mailadmin.test.com;
#http转发至https
if ($server_port !~ 443){
    rewrite ^(/.*)$ https://$host$1 permanent;
}
#ssl信息,请自行修改
ssl_certificate    /root/EwoMail/ssl/fullchain2.pem;
ssl_certificate_key    /root/EwoMail/ssl/privkey2.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
error_page 497  https://$host$request_uri;
#端口转发至8010
location / {
    proxy_pass http://127.0.0.1:8010;
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    root /usr/local/nginx/html;
    index index.html index.htm;
    }
}

注意:

  • 一定要区分两个SSL证书的名字
  • 也可以分两个文件夹分别放两张SSL证书

如果还有任何问题可以在下方评论区留言哦!!


代码改变世界,科技改变未来