如何判断 Ubuntu 16.04 上是否已安装任何 smtp 服务器(例如 postfix、ssmtp)?

如何判断 Ubuntu 16.04 上是否已安装任何 smtp 服务器(例如 postfix、ssmtp)?

我在 Ubuntu 16.04 最低版本上安装了 moodle 3.1。Moodle 无法发送任何电子邮件,错误指向 smtp 配置。

moodle 的邮件通知在开发服务器中默认有效。但在生产环境中,使用相同的设置和配置,邮件通知会失败。

我的开发服务器是本地虚拟机,而产品服务器在 AWS 中。

我需要检查 aws Ubuntu 16.04 映像中是否已安装任何 smtp 包(例如 postfix)

答案1

跑步

aptitude search '~Pmail-transport-agent' | grep "^i"                                                                     

如果没有安装提供适当邮件传输代理的软件包,将返回以下内容

i   lsb-invalid-mta                 - Linux Standard Base sendmail dummy

例如如果你运行

aptitude search '~Pmail-transport-agent'

您将获得最终能够发送电子邮件的所有软件包。对于 Ubuntu 16.04,

p   citadel-mta                - complete and feature-rich groupware server (mail transport agent)
p   citadel-mta:i386           - complete and feature-rich groupware server (mail transport agent)
p   courier-mta                - Courier mail server - ESMTP daemon
p   courier-mta:i386           - Courier mail server - ESMTP daemon
p   dma                        - lightweight mail transport agent
p   dma:i386                   - lightweight mail transport agent
p   esmtp-run                  - user configurable relay-only MTA - the regular MTA
p   exim4-daemon-heavy         - Exim MTA (v4) daemon with extended features, including exiscan-acl
p   exim4-daemon-heavy:i386    - Exim MTA (v4) daemon with extended features, including exiscan-acl
p   exim4-daemon-light         - lightweight Exim MTA (v4) daemon
p   exim4-daemon-light:i386    - lightweight Exim MTA (v4) daemon
i   lsb-invalid-mta            - Linux Standard Base sendmail dummy
p   masqmail                   - mail transport agent for intermittently connected hosts
p   masqmail:i386              - mail transport agent for intermittently connected hosts
p   msmtp-mta                  - light SMTP client with support for server profiles - the regular MTA
p   nullmailer                 - simple relay-only mail transport agent
p   nullmailer:i386            - simple relay-only mail transport agent
p   opensmtpd                  - secure, reliable, lean, and easy-to configure SMTP server
p   opensmtpd:i386             - secure, reliable, lean, and easy-to configure SMTP server
p   postfix                    - High-performance mail transport agent
p   postfix:i386               - High-performance mail transport agent
p   qmail-run                  - sets up qmail as mail-transfer-agent
p   sendmail-bin               - powerful, efficient, and scalable Mail Transport Agent
p   sendmail-bin:i386          - powerful, efficient, and scalable Mail Transport Agent
p   ssmtp                      - extremely simple MTA to get mail off the system to a mail hub
p   ssmtp:i386                 - extremely simple MTA to get mail off the system to a mail hub

答案2

为了便于输入和记忆,据我所知,所有 MTA(包括 Postfix、sSMTP 和 exim,以及 Sendmail 本身)都安装了一个sendmail可执行文件和相应的手册页。因此,如果安装了其中一个,man sendmail将打开一个手册页,该手册页还会告诉您它是哪一个。

相关内容