![如何判断 Ubuntu 16.04 上是否已安装任何 smtp 服务器(例如 postfix、ssmtp)?](https://linux22.com/image/1058141/%E5%A6%82%E4%BD%95%E5%88%A4%E6%96%AD%20Ubuntu%2016.04%20%E4%B8%8A%E6%98%AF%E5%90%A6%E5%B7%B2%E5%AE%89%E8%A3%85%E4%BB%BB%E4%BD%95%20smtp%20%E6%9C%8D%E5%8A%A1%E5%99%A8%EF%BC%88%E4%BE%8B%E5%A6%82%20postfix%E3%80%81ssmtp%EF%BC%89%EF%BC%9F.png)
我在 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
将打开一个手册页,该手册页还会告诉您它是哪一个。