iRedMail邮件服务搭建记录

2024-07-18 17:39:57
iRedMail搭建背景

iRedmail搭建使用的docker进行,在阿里云ecs进行的安装,本来没什么好记录
参考这里,按部就班就可以。

由于阿里云封禁了25端口,安装完成收邮件没问题,没法发送。
后来将iRedMail迁移到办公网络,通过frp做了穿透,特此记录一下

frp相关配置

在阿里云ecs安装frps服务端进行配置,略

这里贴出客户端配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
[root@mail ~]# cat /usr/local/frp/frpc.toml 
serverAddr = "x.x.x.x"
serverPort = 7000

[[proxies]]
name = "tcp_mail"
type = "tcp"
localIP = "127.0.0.1"
localPort = 443
remotePort = 443


[[proxies]]
name = "tcp_110"
type = "tcp"
localIP = "127.0.0.1"
localPort = 110
remotePort = 110

[[proxies]]
name = "tcp_995"
type = "tcp"
localIP = "127.0.0.1"
localPort = 995
remotePort = 995

[[proxies]]
name = "tcp_143"
type = "tcp"
localIP = "127.0.0.1"
localPort = 143
remotePort = 143

[[proxies]]
name = "tcp_993"
type = "tcp"
localIP = "127.0.0.1"
localPort = 993
remotePort = 993


[[proxies]]
name = "tcp_25"
type = "tcp"
localIP = "127.0.0.1"
localPort = 25
remotePort = 25

[[proxies]]
name = "tcp_465"
type = "tcp"
localIP = "127.0.0.1"
localPort = 465
remotePort = 465

[[proxies]]
name = "tcp_587"
type = "tcp"
localIP = "127.0.0.1"
localPort = 587
remotePort = 587
iRedMail相关配置

由于iRedMail容器重启,会导致mysql生成随机密码无法链接,需要在配置文件中指定,参考这个issue

配置如下

1
2
3
4
5
6
7
8
9
10
11
[root@mail ~]# cat /iredmail/iredmail-docker.conf 
HOSTNAME=mail.abc.com
FIRST_MAIL_DOMAIN=abc.com
FIRST_MAIL_DOMAIN_ADMIN_PASSWORD=
MLMMJADMIN_API_TOKEN=
ROUNDCUBE_DES_KEY=
MYSQL_ROOT_PASSWORD=
VMAIL_DB_ADMIN_PASSWORD=
VMAIL_DB_PASSWORD=
AMAVISD_DB_PASSWORD=
SA_BAYES_DB_PASSWORD=

启动后测试发送邮件,遇到了spf问题,在域名解析里添加 v=spf1 mx include:spf.mail.qq.com ~ all