本文介绍在CentOS 7系统中安装postfix3的方法。Postfix是一个免费的开源邮件传输代理(MTA),用于路由和传递电子邮件,Postfix有几百个配置参数,通过main.cf文件控制。可参考在Ubuntu 18.04系统上安装和配置Postfix作为SMTP服务器。
添加Postfix 3镜像 让我们添加存储库: vim /etc/yum.repos.d/gf.repo 增加: [gf] name=Ghettoforge packages that won't overwrite core distro packages. mirrorlist=http://mirrorlist.ghettoforge.org/el/7/gf/$basearch/mirrorlist enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7 failovermethod=priority [gf-plus] name=Ghettoforge packages that will overwrite core distro packages. mirrorlist=http://mirrorlist.ghettoforge.org/el/7/plus/$basearch/mirrorlist # Please read http://ghettoforge.org/index.php/Usage *before* enabling this repository! enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7 failovermethod=priority 你现在可以继续更新yum缓存: yum clean all yum makecache fast 通过搜索postfix3包进行测试: # yum search postfix3 Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile ======= N/S matched: postfix3 ================= postfix3.x86_64 : Postfix Mail Transport Agent postfix3-cdb.x86_64 : CDB Database Support for Postfix postfix3-ldap.x86_64 : LDAP Database Support for Postfix postfix3-lmdb.x86_64 : LMDBtabase Support for Postfix postfix3-mysql.x86_64 : MySQL Database Support for Postfix postfix3-pcre.x86_64 : PCRE Database Support for Postfix postfix3-perl-scripts.x86_64 : Postfix utilities written in perl postfix3-pgsql.x86_64 : PostgreSQL Database Support for Postfix postfix3-sqlite.x86_64 : SQLite Database Support for Postfix 继续在CentOS 7上安装postfix3,添加所需的任何其他软件包: yum -y install postfix3 postfix3-ldap postfix3-mysql postfix3-mysql 检查安装的postfix3版本: # rpm -qi postfix3
启动postfix3服务 要在CentOS 7上启动postfix3,请执行以下操作: systemctl start postfix.service 启用postfix以在启动时启动: systemctl enable postfix 检查postfix状态: systemctl status postfix 在防火墙上打开postfix smtp和smtps端口: firewall-cmd --add-service={smtp,smtps} --permanent 确认防火墙配置: # firewall-cmd --list-services http smtp dhcpv6-client snmp smtps ssh https 至此,你可以随时在CentOS 7服务器上使用Postfix3了。
相关主题 |