我试图安装 sendmail 但它在尝试生成 ssl 证书时挂起。我取消了安装过程,后来杀死了锁定任何新软件包无法安装的进程。
但是每当我运行apt-get install <package_name>
它时,它都会返回到 sendmail 安装并尝试安装 ssl 证书。
我已经重新启动系统,但问题仍然存在。
我该如何解决?
sudo dpkg --configure -a
Setting up sendmail-bin (8.15.2-3) ...
Updating sendmail environment ...
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Writing configuration to /etc/mail/sendmail.conf.
Writing /etc/cron.d/sendmail.
Disabling HOST statistics file(/var/lib/sendmail/host_status).
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Writing configuration to /etc/mail/sendmail.conf.
Writing /etc/cron.d/sendmail.
Could not open /etc/mail/databases(No such file or directory), creating it.
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Creating /etc/mail/databases...
Checking filesystem, this may …
Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的服务器上运行 postfix,但在我的服务器中不断收到以下错误/var/log/mail.log
:
postfix/master[5041]: 致命: 绑定 0.0.0.0 端口 25: 地址已被使用
我做了一些搜索,发现Oli 的这个很好的答案(关于这个问题),其中建议我基本上删除我的服务器上的 sendmail 包以避免冲突,然后重新安装 postfix,这将依次安装自己品牌的 sendmail。不幸的是,它并没有完全解决问题(参见下文)。
我按照说明进行了以下检查,收到了令人鼓舞的回复:
$ dpkg -S `which sendmail`
postfix: /usr/sbin/sendmail
Run Code Online (Sandbox Code Playgroud)
但是,当我再次启动 postfix 时,我遇到了同样的错误。
根据 Oli 的意外情况,我查找了占用 25 端口的进程,如下所示:
$ sudo netstat -pel | grep smtp
tcp 0 0 localhost.localdom:smtp *:* LISTEN root
35704126 27626/sendmail: MTA
Run Code Online (Sandbox Code Playgroud)
但这就是令人困惑的地方:然后我查找了该过程,27626
但随后被告知:
dpkg-query: 没有找到匹配模式27626
连接的路径。
我拉起 htop 并能够找到与以下命令关联的上述 PID:
sendmail:MTA: 接受连接
然后我试图杀死了过程killall sendmail
,并killall 27626
与不断得到no process found
。 …
如何彻底删除sendmail?我尝试了以下方法:
apt-get remove sendmail
apt-get purge sendmail
Run Code Online (Sandbox Code Playgroud)
Sendmail 仍然存在并正在运行,我如何完全删除它和所有配置文件?
我已经使用“apt-get install sendmail”安装了 sendmail,还使用 Webmin 安装了 postfix。但是Postfix无法启动,当我检查/var/log/mail.err
*Jul 11 14:09:03 victoria postfix/master[6588]: fatal: bind 0.0.0.0 port 25: Address already in use
Jul 11 14:09:10 victoria postfix/master[6821]: fatal: bind 0.0.0.0 port 25: Address already in use
Jul 11 14:09:11 victoria postfix/master[6820]: fatal: daemon initialization failure
Jul 11 14:09:12 victoria postfix/postfix-script[6822]: fatal: mail system startup failed*
Run Code Online (Sandbox Code Playgroud)
和我的“netstat -tap”显示:
*root@victoria:/etc/init.d# netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 localhost:mysql *:* …
Run Code Online (Sandbox Code Playgroud) 使用 sendmail 发送一封电子邮件大约需要 15 秒。
/var/log/mail.log:
Jul 31 09:52:42 piotr-probook sendmail[2912]: My unqualified host name (piotr-probook) unknown; sleeping for retry
Run Code Online (Sandbox Code Playgroud)
/etc/主机名:
piotr-probook
Run Code Online (Sandbox Code Playgroud)
/etc/hosts:
127.0.0.1 piotr-probook localdev localhost
192.168.1.1 router
Run Code Online (Sandbox Code Playgroud)
/etc/mail/sendmail.cf:
# hosts file (normally /etc/hosts)
O HostsFile=/etc/hosts
Run Code Online (Sandbox Code Playgroud)
显然piotr-probook
,当我输入 url 时,我可以在浏览器中ping主机和 HTTP 服务器弹出窗口http://piotr-probook
我究竟做错了什么?如何解决问题?
我觉得问这个问题有点傻……因为答案可能很简单……但是在 AU、Google 或 上搜索man mail
,没有给我答案。
如果我开始mail
,我会看到这个:
"/var/mail/al": 8 messages 8 unread
>U 1 root@al-Inspiron-7 Sun Nov 28 06:01 156/5409 Logwatch for al-Inspiron-
U 2 root@al-Inspiron-7 Mon Nov 29 06:11 173/6447 Logwatch for al-Inspiron-
U 3 root@al-Inspiron-7 Tue Nov 30 05:23 149/5261 Logwatch for al-Inspiron-
U 4 root@al-Inspiron-7 Wed Dec 1 01:53 215/9228 Logwatch for al-Inspiron-
U 5 root@al-Inspiron-7 Thu Dec 2 02:27 187/7610 Logwatch for al-Inspiron-
U 6 root@al-Inspiron-7 Fri Dec 3 05:42 204/8129 Logwatch for …
Run Code Online (Sandbox Code Playgroud) 我有一个开发 Ubuntu Server (12.04.1) VM,用于开发 php 站点和电子商务站点(如 Magento 等)。
因为这是出于开发目的,并且我需要使用我自己以外的电子邮件地址进行测试,所以我需要一种让 sendmail 命令接受邮件但不实际发送邮件的方法,而是存档是我可以查看的地方它。
安装邮件服务器以便 sendmail 命令将所有邮件路由到本地目录的最简单方法是什么?即我不希望任何邮件被传送到互联网。
我尝试了这个问题中讨论的步骤(SMTP 服务器将所有邮件发送到 user@localhost),但它似乎不起作用 - 我的(本地)邮箱中收到一条错误消息,告诉我它无法发送我的测试消息(例如,someone@gmail.com)
我已安装nagios
用于监视和sendmail
发送邮件。从root
帐户测试时,我收到邮件,但从nagios
帐户发送邮件时却没有收到邮件。我用谷歌搜索,发现只有root
用户可以使用sendmail MTA
. 如何启用sendmail
从nagios
帐户发送邮件?
请注意,我不直接从本地计算机发送消息,而是使用我的 ISP/提供商中继。以下日志显示消息来自 时中继的错误nagios@
,但不显示来自 时的错误root@
。
猫 /var/log/maillog
Sep 19 15:52:32 ubuntubackup-chennai sendmail[6088]: q8JAMWXZ006088: from=nagios, size=237, class=0, nrcpts=1, msgid=<201209191022.q8JAMWXZ006088@localhost.localdomain>, relay=nagios@localhost
Sep 19 15:52:32 ubuntubackup-chennai sendmail[6089]: q8JAMWCn006089: from=<nagios@localhost.localdomain>, size=517, class=0, nrcpts=1, msgid=<201209191022.q8JAMWXZ006088@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Sep 19 15:52:32 ubuntubackup-chennai sendmail[6088]: q8JAMWXZ006088: to=karthick.murugadhas@****.com, ctladdr=nagios (496/492), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30237, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q8JAMWCn006089 Message accepted for delivery) …
Run Code Online (Sandbox Code Playgroud)我一直在尝试让命令行 sendmail 工作,但没有成功。我需要这个来在某处输出我的 anacron 错误。
我已经安装了 sendmail 包。配置 /etc/aliases 为:
root: me@gmail.com
Run Code Online (Sandbox Code Playgroud)
但是每当我尝试向任何地址(root,me@gmail.com)发送电子邮件时,sendmail 日志一直告诉我它已中继到“localhost”并已发送。再也找不到了。有些文件是在 /var/mail/mqueue 中创建的。
日志输出:
root@tok:/var/mail# sendmail me@gmail.com test37
Feb 27 13:35:40 tok sendmail[23616]: r1RCZanW023616: from=tys, size=7, class=0, nrcpts=1, msgid=<201302271235.r1RCZanW023616@tok.mydomain.nl>, relay=root@localhost
Feb 27 13:35:40 tok sm-mta[23617]: r1RCZe41023617: from=<tys@tok.mydomain.nl>, size=289, class=0, nrcpts=1, msgid=<201302271235.r1RCZanW023616@tok.mydomain.nl>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb 27 13:35:40 tok sendmail[23616]: r1RCZanW023616: to=me@gmail.com, ctladdr=tys (1000/1000), delay=00:00:04, xdelay=00:00:00, mailer=relay, pri=30007, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (r1RCZe41023617 Message accepted for delivery)
Run Code Online (Sandbox Code Playgroud)
为什么它决定应将 me@gmail.com 传送到 localhost 并且它从未尝试实际连接到 gmail.com? …
每次 cron 运行时,都会创建一些 sendmail 进程,这些进程使我们的机器承受巨大的高负载。我们已经将这个问题追溯到 cron 和 sendmail。
在 cron 之上添加 MAILTO="" 是一种解决方案,将每个 cron 命令管道到 dev null 是另一种解决方案,但我需要一个全局解决方案......在 cron 左右进行某种配置。
Vixiecron没有以下选项,我相信它可以解决我的问题
-m This option allows you to specify a shell command to use for sending Cron mail output instead of
using sendmail(8) This command must accept a fully formatted mail message (with headers) on stan?
dard input and send it as a mail message to the recipients specified in the mail headers. Specify?
ing the string off (i.e., …
Run Code Online (Sandbox Code Playgroud)