麒麟邮件客户端安装相关的软件包
[root@mail ~]# cat /etc/os-release
NAME="Kylin Linux Advanced Server"
VERSION="V10 (Sword)"
ID="kylin"
VERSION_ID="V10"
PRETTY_NAME="Kylin Linux Advanced Server V10 (Sword)"
ANSI_COLOR="0;31"
[root@mail ~]# hostnamectl set-hostname mail.test.com
[root@mail ~]# cd /opt/
[root@mail opt]# ls
clucene-core-2.3.3.4-35.ky10.x86_64.rpm dovecot-2.3.10.1-3.p02.ky10.x86_64.rpm firefox patch_workspace postfix-3.3.1-10.ky10.x86_64.rpm
[root@mail opt]# rpm -ivh dovecot-2.3.10.1-3.p02.ky10.x86_64.rpm clucene-core-2.3.3.4-35.ky10.x86_64.rpm postfix-3.3.1-10.ky10.x86_64.rpm
警告:dovecot-2.3.10.1-3.p02.ky10.x86_64.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID 7a486d9f: NOKEY
Verifying... ################################# [100%]
准备中... ################################# [100%]
软件包 clucene-core-2.3.3.4-35.ky10.x86_64 已经安装
软件包 dovecot-1:2.3.10.1-3.p02.ky10.x86_64 已经安装
软件包 postfix-2:3.3.1-10.ky10.x86_64 已经安装
变量配置
[root@mail opt]# vi /etc/postfix/main.cf
myhostname = mail.test.com
mydomain = test.com
myorigin = $mydomain
inet_interfaces = all
inet_protocols = ipv4
mydestination = $myhostname, $mydomain
home_mailbox = Maildir/
[root@mail]# groupadd mailusers //添加邮件账号组
[root@mail]# useradd -g mailusers -s /sbin/nologin haojiahuo
[root@mail]# passwd haojiahuo
[root@mail]# useradd -g mailusers -s /sbin/nologin niuniuniu
[root@mail]# passwd niuniuniu //添加邮件服务测试账号
[root@mail]# yum install -y telnet //安装远程登录插件,用于登录25端口测试
[root@mail]# telnet mail.test.com 25 //远程登录25端口,如报错连接不上,重启postfix
[root@mail conf.d]# cat /etc/dovecot/conf.d/10-auth.conf |grep -v ^# |grep -v ^$
ssl = no
disable_plaintext_auth = no
mail_location =maildir:~/Maildir
auth_mechanisms = plain
!include auth-system.conf.ext
[root@mail opt]# cat /etc/dovecot/dovecot.conf |grep -v ^# |grep -v ^$
protocols = imap pop3 lmtp
listen = *
dict {
#quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
#expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext
}
!include conf.d/*.conf
!include_try local.conf
[root@mail ~]# cat /etc/dovecot/conf.d/10-ssl.conf |grep -v ^$|grep -v ^#
ssl = no
ssl_cert = </etc/pki/dovecot/certs/dovecot.pem
ssl_key = </etc/pki/dovecot/private/dovecot.pem
ssl_cipher_list = PROFILE=SYSTEM
服务器状态(查看端口情况/禁用防火墙)
注意:实际生产情况禁止禁用防火墙
[root@mail ~]# systemctl restart postfix
[root@mail ~]# systemctl status postfix
● postfix.service - Postfix Mail Transport Agent
Loaded: loaded (/usr/lib/systemd/system/postfix.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2021-11-23 01:26:21 CST; 4s ago
Process: 6069 ExecStartPre=/usr/libexec/postfix/aliasesdb (code=exited, status=0/SUCCESS)
Process: 6072 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=0/SUCCESS)
Process: 6074 ExecStart=/usr/sbin/postfix start (code=exited, status=0/SUCCESS)
Main PID: 6142 (master)
Tasks: 3
Memory: 3.0M
CGroup: /system.slice/postfix.service
├─6142 /usr/libexec/postfix/master -w
├─6143 pickup -l -t unix -u
└─6144 qmgr -l -t unix -u
11月 23 01:26:21 mail.test.com systemd[1]: Starting Postfix Mail Transport Agent...
11月 23 01:26:21 mail.test.com postfix/master[6142]: daemon started -- version 3.3.1, configuration /etc/postfix
11月 23 01:26:21 mail.test.com systemd[1]: Started Postfix Mail Transport Agent.
[root@mail ~]#
[root@mail ~]# systemctl restart dovecot
[root@mail ~]# systemctl status dovecot
● dovecot.service - Dovecot IMAP/POP3 email server
Loaded: loaded (/usr/lib/systemd/system/dovecot.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2021-11-23 01:26:41 CST; 5s ago
Docs: man:dovecot(1)
http://wiki2.dovecot.org/
Process: 6154 ExecStartPre=/usr/libexec/dovecot/prestartscript (code=exited, status=0/SUCCESS)
Main PID: 6161 (dovecot)
Tasks: 4
Memory: 2.6M
CGroup: /system.slice/dovecot.service
├─6161 /usr/sbin/dovecot -F
├─6165 dovecot/anvil
├─6166 dovecot/log
└─6167 dovecot/config
11月 23 01:26:41 mail.test.com systemd[1]: Starting Dovecot IMAP/POP3 email server...
11月 23 01:26:41 mail.test.com systemd[1]: Started Dovecot IMAP/POP3 email server.
11月 23 01:26:41 mail.test.com dovecot[6161]: master: Dovecot v2.3.10.1 (a3d0e1171) starting up for imap, pop3, lmtp
[root@mail ~]# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 6161/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 6161/dovecot
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 976/rpcbind
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1726/sshd: /usr/sbi
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 6142/master
tcp6 0 0 :::111 :::* LISTEN 976/rpcbind
tcp6 0 0 :::22 :::* LISTEN 1726/sshd: /usr/sbi
[root@mail ~]# systemctl stop firewalld
[root@mail ~]# setenforce 0
setenforce: SELinux is disabled
UOS系统foxmail测试