第 23 章 postfix


Postfix 是一个开源邮件传输代理(MTA),它支持 LDAP、SMTP AUTH(SASL)和 TLS 等协议。[22]
在 Red Hat Enterprise Linux 中 postfix 软件包提供 Postfix。输入以下命令查看是否安装了 postfix 软件包:
~]$ rpm -q postfix
package postfix is not installed
如果没有安装,使用 yum 工具 root 安装它:
~]# yum install postfix

23.1. Postfix 和 SELinux

启用 Postfix 后,它将默认受到限制。受限制的进程在其自己的域中运行,并且与其他受限制的进程隔开。如果一个受攻击者限制的进程受到 SELinux 策略配置的影响,攻击者对资源的访问权限和可能受到的破坏会受到限制。以下示例演示了在自己的域中运行的 Postfix 和相关进程。本例假设已安装 postfix 软件包,并且 Postfix 服务已经启动:
  1. 运行 getenforce 命令,确认 SELinux 是否在 enforcing 模式下运行:
    ~]$ getenforce
    Enforcing
    
    当 SELinux 处于 enforcing 模式时,命令会返回 Enforcing
  2. 以 root 用户身份输入以下命令来启动 postfix
    ~]# systemctl start postfix.service
    确认 服务正在运行。输出中应包括以下信息(只有时间戳有所不同):
    ~]# systemctl status postfix.service
    postfix.service - Postfix Mail Transport Agent
       Loaded: loaded (/usr/lib/systemd/system/postfix.service; disabled)
       Active: active (running) since Mon 2013-08-05 11:38:48 CEST; 3h 25min ago
    
  3. 运行以下命令来查看 postfix 进程:
    ~]$ ps -eZ | grep postfix
    system_u:system_r:postfix_master_t:s0 1651 ?   00:00:00 master
    system_u:system_r:postfix_pickup_t:s0 1662 ?   00:00:00 pickup
    system_u:system_r:postfix_qmgr_t:s0 1663 ?     00:00:00 qmgr
    
    在上面的输出中,与 Postfix master 进程关联的 SELinux 上下文为 system_u:system_r:postfix_master_t:s0。上下文的第二个最后一个部分 postfix_master_t 是此进程的类型。类型定义进程的域以及文件的类型。在这种情况下,master 进程在 postfix_master_t 域中运行。


[22] 如需更多信息,请参阅《 系统管理员指南 》中的 Postfix 部分。
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.