搭建mailin临时邮局系统 巨好用 强烈推荐大家使用

0、卸载旧版本Docker

yum remove docker \
    docker-client \
    docker-client-latest \
    docker-common \
    docker-latest \
    docker-latest-logrotate \
    docker-logrotate \
    docker-engine -y

1、更新系统

yum update -y

2、安装需要的软件包, yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的

yum install -y yum-utils device-mapper-persistent-data lvm2 git

3、设置yum源(根据服务器地域选择其中一个)

yum-config-manager —add-repo http://download.docker.com/linux/centos/docker-ce.repo

4、安装Docker

yum install -y docker-ce docker-ce-cli containerd.io

5、守护进程重启

sudo systemctl daemon-reload

6、重启docker服务

sudo systemctl restart docker

7、加入开机启动

systemctl enable docker

8、安装docker compose

sudo curl -L “https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

如果在本步骤执行遇到问题,可以直接上传二进制的文件(docker-compose)到/usr/local/bin/目录里即可;

docker-compose下载

二、安装mailin邮局

1、获取源码

git clone https://github.com/oscode1988/mailin.git

cd ./mailin

2、下载并启动

docker-compose up -d

可在mailin目录下的docker配置文件修改 网站的端口和接收邮件的地址;

docker-compose.yml

version: "3"
services:
  mailin:
    image:  oscode/mailin
    container_name: memailin
    environment:
      WEBHOOK_URL: "http://dev.mail.com/mailin.php"
    expose:
      - 25
    ports:
      - "25:25"
    extra_hosts:
      - "dev.mail.com:172.23.0.1"
    restart: always
    networks:
      extnetwork:
        ipv4_address: 172.23.0.7
  redis:
    image: redis:5.0.3-alpine
    container_name: meredis
    ports:
      - "9080:6379"
    volumes:
      - ./services/redis/redis.conf:/etc/redis.conf:ro
      - ./data/redis:/data/:rw
    restart: always
    entrypoint: ["redis-server", "/etc/redis.conf"]
    environment:
      TZ: "Asia/Shanghai"
    networks:
      extnetwork:
        ipv4_address: 172.23.0.5
  openresty:
    image:  openresty/openresty:alpine
    container_name: meopenresty
    ports:
      - "80:80"
    volumes:
      - ./www:/www/:rw
      - ./services/openresty/conf.d:/etc/nginx/conf.d/:ro
      - ./services/openresty/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf:ro
      - ./services/openresty/lua:/lua:rw
      - ./services/openresty/fastcgi-php.conf:/usr/local/openresty/nginx/conf/fastcgi-php.conf:ro
      - ./services/openresty/fastcgi_params:/usr/local/openresty/nginx/conf/fastcgi_params:ro
      - ./logs/nginx:/var/log/nginx/:rw
    environment:
      TZ: "Asia/Shanghai"
    restart: always
    networks:
      extnetwork:
        ipv4_address: 172.23.0.2

  php:
    image:  oscode/php
    container_name: mephp
    expose:
      - 9000
    volumes:
      - ./www:/www/:rw
      - ./services/php/php.ini:/usr/local/etc/php/php.ini:ro
      - ./services/php/php-fpm.conf:/usr/local/etc/php-fpm.d/www.conf:rw
      - ./logs/php:/var/log/php
      - ./data/composer:/tmp/composer
    restart: always
    cap_add:
      - SYS_PTRACE
    networks:
      extnetwork:
        ipv4_address: 172.23.0.3
networks:
  extnetwork:
    ipam:
        config:
          - 
            subnet: 172.23.0.0/16

3、解析域名

MX记录
@ MX 10 mail.domain.com

A记录
mail.domain.com A ip

3、邮件查看地址

http://IP地址:3003/mailin.php?email=邮箱

如果您喜欢本站,点击这儿不花一分钱捐赠本站

这些信息可能会帮助到你:下载帮助 | 报毒说明 | 进站必看

修改版本安卓软件,加群提示为修改者自留,非本站信息,注意鉴别

(0)

发表回复

评论问题之前, 点击我,能帮你解决大部分问题

评论列表(0条)

请用支付宝扫一扫完成支付