Linux与云计算——第二阶段 第九章:Mail电子邮件服务器架设—配置基于SSL的邮件服务器以及虚拟域的使用

Linux与云计算——第二阶段Linux服务器架设

第九章:Mail电子邮件服务器架设—配置基于SSL的邮件服务器以及虚拟域的使用

邮件客户端配置

可以自行选择电子邮件客户端根据服务器的配置进行设置即可。推荐使用foxmail或者outlook等客户端软件。

配置SSL

配置SSL来加密连接。 SMTPS使用端口465/TCP, POP3S使用端口995/TCP, IMAPS使用端口993/TCP.

[1] 创建证书

[2] PostfixDovecot配置SSL.

[[email protected] ~]# vi /etc/postfix/main.cf

# 在最后添加以下内容

smtpd_use_tls = yes

smtpd_tls_cert_file = /etc/pki/tls/certs/server.crt

smtpd_tls_key_file = /etc/pki/tls/certs/server.key

smtpd_tls_session_cache_database = btree:/etc/postfix/smtpd_scache

[[email protected] ~]# vi /etc/postfix/master.cf

# line 26-28: 取消注释

smtps       inet   n       -       n       -       -       smtpd

-o syslog_name=postfix/smtps

-o smtpd_tls_wrappermode=yes

[[email protected] ~]# vi /etc/dovecot/conf.d/10-ssl.conf

# line 8: 修改

ssl = yes

# line 14,15: 指定证书文件

ssl_cert = </etc/pki/tls/certs/server.crt

ssl_key = </etc/pki/tls/certs/server.key

[[email protected] ~]# systemctl restart postfix

[[email protected] ~]# systemctl restart dovecot

[3] 在客户端内选择SMTP和IMAP使用TLS/SSL

Virtual domain

配置Postfix来使用一个虚拟域发送一封和自己起源域不同名字的邮件。

For example,

present domain name  example.com

new domain name  virtual.host

一个用户 [jeffrey] 有一个邮件地址 [[email protected]],

一个用户 [redhat] 有一个邮件地址 [[email protected]],

用户 [redhat] 也使用相同的名字 for before [@] with [jeffrey].

[1] 配置虚拟

[[email protected] ~]# vi /etc/postfix/main.cf

# 在文件末尾添加以下部分

virtual_alias_domains = virtual.host

virtual_alias_maps = hash:/etc/postfix/virtual

[[email protected] ~]# vi /etc/postfix/virtual

# 在文件前面添加以下内容

[email protected] redhat

[[email protected] ~]# postmap /etc/postfix/virtual

[[email protected] ~]# systemctl reload postfix

时间: 2024-08-13 11:56:05

Linux与云计算——第二阶段 第九章:Mail电子邮件服务器架设—配置基于SSL的邮件服务器以及虚拟域的使用的相关文章

Linux与云计算——第二阶段 第一章:NTP服务器架设

Linux与云计算--第二阶段Linux服务器架设 第一章:NTP服务器架设 1.NTP Server(NTPd)安装NTPd并且配置NTP服务器来完成时间调节. [1] 安装NTPd. [[email protected] ~]# yum -y install ntp [[email protected] ~]# vim /etc/ntp.conf 参考17行,在第18行添加哪个网段内的主机允许访问你的NTP服务器: restrict 192.168.96.0 mask 255.255.255

Linux与云计算——第二阶段 第二章:DHCP服务器架设

Linux与云计算--第二阶段Linux服务器架设 第二章:DHCP服务器架设 1.配置DHCP服务器 配置DHCP ( Dynamic Host Configuration Protocol ) 服务器. DHCP使用UDP端口67. [1] 安装并配置DHCP服务器. [[email protected] ~]# yum -y install dhcp [[email protected] ~]# vim /etc/dhcp/dhcpd.conf # 创建一个新文件 # 指定域名 optio

Linux与云计算——第二阶段Linux服务器架设 第九章:Mail电子邮件服务器架设—postfix和Dovecot

Linux与云计算--第二阶段Linux服务器架设 第九章:Mail电子邮件服务器架设-postfix和Dovecot 安装Postfix 安装Postfix来配置SMTP服务器. SMTP使用25/TCP. [1] Postfix 是CentOS系统默认安装,哪怕你选择了最小安装,如果确认没有安装,请先安装. [[email protected] ~]# yum -y install postfix [2] 使用Dovecot's SASL 来配置SMTP认证. [[email protect

Linux与云计算——第二阶段Linux服务器架设 第六章:目录Directory服务器架设—FreeIPA

Linux与云计算--第二阶段Linux服务器架设 第六章:目录Directory服务器架设-FreeIPA 1 FreeIPA 配置FreeIPA服务器 Configure IPA Server to share users' account in your local network. [1] Install FreeIPA. [[email protected] ~]# yum -y install ipa-server ipa-server-dns bind bind-dyndb-lda

Linux与云计算——第二阶段 第五章:存储Storage服务器架设—分布式存储Ceph

Linux与云计算--第二阶段Linux服务器架设 第五章:存储Storage服务器架设-分布式存储Ceph 1 Ceph 配置Ceph集群 Install Distributed File System "Ceph" to Configure Storage Cluster. For example on here, Configure Cluster with 1 admin Node and 3 Storage Node like follows. | +------------

Linux与云计算——第二阶段 第一十一章:代理Proxy服务器架设—Squid代理服务器正向代理和客户端配置

Linux与云计算--第二阶段Linux服务器架设 第一十一章:代理Proxy服务器架设-Squid代理服务器正向代理和客户端配置 安装Squid 安装Squid来配置代理服务器. [1] 这是一个通用的转发代理配置 [[email protected] ~]# yum -y install squid [[email protected] ~]# vi /etc/squid/squid.conf # line 26: 添加一条新的ACL acl lan src 192.168.96.0/24

Linux与云计算——第二阶段 第三章:SSH服务器架设(上)openssh 基础

Linux与云计算--第二阶段Linux服务器架设 第三章:SSH服务器架设(上)openssh 基础 1.密码认证 配置SSH服务器以便远程主机连接访问 [1] 即使你在安装CentOS系统的时候选择了最小化安装,OpenSSH也会被默认安装,所以你不需要再安装任何额外的软件包来实现该功能.缺省情况下你可以通过密码实现远程访问,如果需要增强安全性,建议还是要修改部分配置. [[email protected] ~]# vim /etc/ssh/sshd_config # line 49:去掉备

Linux与云计算——第二阶段 第三章:SSH服务器架设(下)openssh 进阶

Linux与云计算--第二阶段Linux服务器架设 第三章:SSH服务器架设(下)openssh 进阶 5.SFTP+Chroot 配置SFTP only + Chroot. 给一些用户限制他们只允许SFTP访问特定的目录. [1] 例如, 设置 /home 作为Chroot目录. # 为SFTP创建一个组 [[email protected] ~]# groupadd sftp_users # 限制只有用户"user"可以使用SFTP [[email protected] ~]# u

Linux与云计算——第二阶段Linux服务器架设 第一十二章:数据库搭建—PostgreSQL

Linux与云计算--第二阶段Linux服务器架设 第一十二章:数据库搭建-PostgreSQL 1.1 安装PostgreSQL [1] 安装并启动PostgreSQL. [[email protected] ~]# yum -y install postgresql-server [[email protected] ~]# postgresql-setup initdb Initializing database ... OK [[email protected] ~]# vim /var