Linux-Postfix+Dovecot+Postfixadmin+Roundcubemail 搭建邮件服务器管理系统(三)

搭建dovecot 收信服务器【POP3/IMAP4协议,TCP 110/143端口】

1、安装dovecot软件并开启dovecot服务并添加到系统自启

[root@mail ~]# yum  -y  remove dovecot        #  卸载
[root@mail ~]# yum  -y  install   dovecot         #  安装
[root@mail ~]# systemctl restart dovecot 
[root@mail ~]# systemctl enable dovecot
[root@mail ~]# netstat -anpt | grep dovecot
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      26338/dovecot       
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      26338/dovecot       
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      26338/dovecot       
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      26338/dovecot       
tcp6       0      0 :::993                  :::*                    LISTEN      26338/dovecot       
tcp6       0      0 :::995                  :::*                    LISTEN      26338/dovecot       
tcp6       0      0 :::110                  :::*                    LISTEN      26338/dovecot       
tcp6       0      0 :::143                  :::*                    LISTEN      26338/dovecot 

2、配置dovecot
10-auth.conf 该文件为认证配置文件
10-logging.conf 该文件为日志配置文件
10-mail.conf 该文件为邮件配置文件
10-master.conf 该文件为主线程配置文件
auth-sql.conf.ext 该文件为数据库连接方式配置文件
a、修改dovecot.conf

[root@mail home]# vim /etc/dovecot/dovecot.conf
#取消 #protocols = imap pop3 lmtp
#取消 #listen = *, :: 的注释,改为 listen = * ,IPV6没用到,所以删除  ::
#取消 #base_dir = /var/run/dovecot/ 的注释,为运行数据存放目录
#在主配置文件中的第48行,设置允许登录的网段地址,也就是说我们可以在这里限制只有来自于某个网段的用户才能使用电子邮件系统。如果想允许所有人都能使用,则不用修改本参数
login_trusted_networks = 192.168.10.0/24更改内容
#在最后添加以下三行:
 ssl = no
disable_plaintext_auth = no
mail_location = Maildir:/wdata/vmail

b、修改 10-auth.conf 配置文件

[root@mail conf.d]# vim /etc/dovecot/conf.d/10-auth.conf
# 9行: 取消注释并修改为 disable_plaintext_auth = no
# 修改 auth_mechanisms = plain 为 auth_mechanisms = plain login
#注释 !include auth-system.conf.ext 行
#取消 #!include auth-sql.conf.ext 的注释,表示开启MySQL验证

c、修改 10-master.conf 配置文件

vim /etc/dovecot/conf.d/10-master.conf
# 更改内容:
# 88-90行: 取消注释并添加 # Postfix smtp验证 
unix_listener /var/spool/postfix/private/auth { 
	mode = 0666 
	user = postfix
	group = postfix
}

d、编辑文件10-mail.conf

vim /etc/dovecot/conf.d/10-mail.conf
# 更改内容:
# 30行: 取消注释并添加 mail_location = maildir:~/Maildir

e、编辑文件10-ssl.conf,如果我们没有使用ssl的话需要进行下面的操作。使用了则不需要

vim /etc/dovecot/conf.d/10-ssl.conf 
# 更改内容:
# 8行: 将ssl的值修改为 ssl = no

3、使用 telnet 测试收信(user02)

[root@mail ~]# telnet mail.auto.com 110           //  连接邮件服务器的110端口
Trying 127.0.0.1...
Connected to mail.auto.com.
Escape character is '^]'.
+OK Dovecot ready.
user user02
+OK
pass test1234
+OK Logged in.
list														//  查看邮件列表
+OK 1 messages:
1 448
.
retr 1                                             //  获取编号为1的邮件
+OK 448 octets
Return-Path: <user01@auto.com>
X-Original-To: user02@auto.com
Delivered-To: user02@auto.com
Received: from localhost (localhost [127.0.0.1])
	by mail.auto.com (Postfix) with SMTP id 2D37565968E
	for <user02@auto.com>; Wed, 15 Jan 2020 10:30:01 +0800 (CST)
Subject: my test mail 1.
         my first mial document...
Message-Id: <20200115023012.2D37565968E@mail.auto.com>
Date: Wed, 15 Jan 2020 10:30:01 +0800 (CST)
From: user01@auto.com
.
quit
+OK Logging out.
Connection closed by foreign host.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CentOS+Postfix+Dovecot+Postfixadmin+Roundcube邮件服务器搭建步骤如下: 1. 安装 CentOS 操作系统,并更新至最新版。 2. 安装 Postfix 邮件服务器,并进行基本配置。 3. 安装 Dovecot IMAP/POP3 服务器,并进行基本配置。 4. 安装 Postfixadmin 邮箱管理系统,并进行基本配置。 5. 安装 Roundcube Webmail 邮件客户端,并进行基本配置。 具体步骤如下: 1. 安装 CentOS 操作系统,并更新至最新版。 在安装 CentOS 操作系统时,选择最小化安装,并根据实际情况进行分区和网络配置。安装完成后,使用以下命令更新系统: ``` yum update ``` 2. 安装 Postfix 邮件服务器,并进行基本配置。 使用以下命令安装 Postfix: ``` yum install postfix ``` 安装完成后,修改 /etc/postfix/main.cf 文件,使其支持 TLS 和 SASL 认证: ``` smtpd_tls_cert_file = /etc/pki/tls/certs/server.crt smtpd_tls_key_file = /etc/pki/tls/private/server.key smtpd_tls_security_level = may smtp_tls_security_level = may smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination ``` 然后重启 Postfix 服务: ``` systemctl restart postfix ``` 3. 安装 Dovecot IMAP/POP3 服务器,并进行基本配置。 使用以下命令安装 Dovecot: ``` yum install dovecot ``` 安装完成后,修改 /etc/dovecot/dovecot.conf 文件,使其支持 TLS 和 SASL 认证: ``` ssl_cert = </etc/pki/tls/certs/server.crt ssl_key = </etc/pki/tls/private/server.key auth_mechanisms = plain login ``` 然后重启 Dovecot 服务: ``` systemctl restart dovecot ``` 4. 安装 Postfixadmin 邮箱管理系统,并进行基本配置。 使用以下命令安装 Postfixadmin: ``` yum install postfixadmin ``` 安装完成后,修改 /etc/httpd/conf.d/postfixadmin.conf 文件,使其支持 SSL: ``` SSLEngine on SSLCertificateFile /etc/pki/tls/certs/server.crt SSLCertificateKeyFile /etc/pki/tls/private/server.key ``` 然后重启 Apache 服务: ``` systemctl restart httpd ``` 访问 https://your-domain.com/postfixadmin,使用管理员账号登录,创建邮箱账号和域名等相关配置。 5. 安装 Roundcube Webmail 邮件客户端,并进行基本配置。 使用以下命令安装 Roundcube: ``` yum install roundcubemail ``` 安装完成后,修改 /etc/httpd/conf.d/roundcubemail.conf 文件,使其支持 SSL: ``` SSLEngine on SSLCertificateFile /etc/pki/tls/certs/server.crt SSLCertificateKeyFile /etc/pki/tls/private/server.key ``` 然后重启 Apache 服务: ``` systemctl restart httpd ``` 访问 https://your-domain.com/roundcubemail,使用邮箱账号登录,即可使用 Roundcube 邮件客户端。 以上就是 CentOS+Postfix+Dovecot+Postfixadmin+Roundcube邮件服务器搭建步骤,如有问题可以参考相关文档或者咨询技术人员。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值