-1

I got a server with mysql+php running on it only. Cronned PHP scripts (not available publicly) send occasionally emails, but not more than 10 per hour. However, whenever I type "top" in bash I see something like this:

top - 00:44:33 up 13 days, 18:47,  1 user,  load average: 31.43, 31.17, 30.75
Tasks: 196 total,   1 running, 195 sleeping,   0 stopped,   0 zombie
%Cpu(s):  1.0 us,  1.2 sy,  0.0 ni, 66.3 id, 31.4 wa,  0.1 hi,  0.0 si,  0.0 st
KiB Mem:  32857820 total, 28981048 used,  3876772 free,   190144 buffers
KiB Swap: 16768892 total,   343284 used, 16425608 free. 22893448 cached Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
29004 www-data  20   0  388240  15636   5352 S   2.7  0.0   0:00.83 apache2
 1260 mysql     20   0 9719528 3.998g   4904 S   2.3 12.8   1358:52 mysqld
 1414 root      20   0  106952   8688   1668 D   0.7  0.0   0:28.56 sendmail-mta
 1675 syslog    20   0  260848  32684    960 S   0.7  0.1 187:49.06 rsyslogd
11894 root      20   0  108408  10172   1668 D   0.7  0.0   1:05.93 sendmail-mta
13597 root      20   0  106160   7916   1668 D   0.7  0.0   0:10.16 sendmail-mta
19896 root      20   0  108140   9864   1668 D   0.7  0.0   0:57.19 sendmail-mta
30286 root      20   0  105896   7680   1668 D   0.7  0.0   0:04.58 sendmail-mta
    8 root      20   0       0      0      0 S   0.3  0.0  25:54.50 rcuos/0
    9 root      20   0       0      0      0 S   0.3  0.0  30:23.56 rcuos/1
   10 root      20   0       0      0      0 S   0.3  0.0  30:10.26 rcuos/2
   11 root      20   0       0      0      0 S   0.3  0.0  35:55.97 rcuos/3
   14 root      20   0       0      0      0 S   0.3  0.0  28:06.34 rcuos/6
  264 root      20   0       0      0      0 D   0.3  0.0  94:44.98 jbd2/md2-8
  721 root      20   0  108008   9784   1668 D   0.3  0.0   0:56.14 sendmail-mta
 1029 root      20   0  107084   8812   1668 D   0.3  0.0   0:31.64 sendmail-mta
 1493 root      20   0  108932  10684   1668 D   0.3  0.0   1:18.55 sendmail-mta
 2991 root      20   0  105764   7580   1668 D   0.3  0.0   0:02.18 sendmail-mta
 9322 root      20   0  107480   9184   1668 D   0.3  0.0   0:40.74 sendmail-mta
11139 root       0 -20       0      0      0 S   0.3  0.0   0:05.35 kworker/u17:2
11767 root      20   0   24964   1744   1176 R   0.3  0.0   0:00.56 top
12332 root      20   0  107084   8904   1668 D   0.3  0.0   0:33.95 sendmail-mta
15232 root      20   0  107616   9312   1668 D   0.3  0.0   0:44.07 sendmail-mta
16204 root      20   0  108800  10460   1668 D   0.3  0.0   1:13.26 sendmail-mta
17133 root      20   0  107216   9016   1668 D   0.3  0.0   0:36.18 sendmail-mta
18282 root      20   0  106560   8396   1668 D   0.3  0.0   0:21.29 sendmail-mta
18284 root      20   0  106688   8500   1668 D   0.3  0.0   0:24.23 sendmail-mta
18834 root      20   0  106560   8284   1668 D   0.3  0.0   0:18.80 sendmail-mta
21074 root      20   0  107876   9644   1668 D   0.3  0.0   0:51.99 sendmail-mta
21632 root      20   0  106028   7784   1668 D   0.3  0.0   0:07.25 sendmail-mta
21874 root      20   0  109064  10864   1668 D   0.3  0.0   1:22.93 sendmail-mta
26762 root      20   0  107348   9116   1668 D   0.3  0.0   0:39.16 sendmail-mta
30181 root      20   0  108272  10028   1668 D   0.3  0.0   1:02.36 sendmail-mta
    1 root      20   0   34224   2036   1296 S   0.0  0.0   0:06.01 init
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.24 kthreadd
    3 root      20   0       0      0      0 S   0.0  0.0   1:12.29 ksoftirqd/0
    5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:0H
    7 root      20   0       0      0      0 S   0.0  0.0  26:11.06 rcu_sched
   12 root      20   0       0      0      0 S   0.0  0.0  25:56.72 rcuos/4
   13 root      20   0       0      0      0 S   0.0  0.0  29:28.44 rcuos/5
   15 root      20   0       0      0      0 S   0.0  0.0  27:28.79 rcuos/7

How to get rid of these sendmails? Did this server turn into a spamming server?

I just checked the 8 GB mail log file at /var/log/mail.log (mail.err is 2 GB and with similar messages as below). It seems that every second I get hundreds of error messages:

c /usr/sbin/sensible-mda: No such file or directory
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[10416]: s9MEL4VU004904: to=<root@Ubuntu-1204-precise-64-minimal>, delay=08:52:47, xdelay=00:00:00, mailer=local, pri=4622861, dsn=4.0.0, stat=Operating system error
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[18516]: s9JCvGxc029924: Warning: program /usr/sbin/sensible-mda unsafe: No such file or directory
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[18516]: s9JCvGxc029924: SYSERR(root): Cannot exec /usr/sbin/sensible-mda: No such file or directory
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[15232]: s9JCvGxc029924: to=root, delay=3+04:03:05, xdelay=00:00:00, mailer=local, pri=35400000, dsn=4.0.0, stat=Operating system error
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[18517]: s9INvGkB009352: Warning: program /usr/sbin/sensible-mda unsafe: No such file or directory
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[18518]: s9J2lGxv018288: Warning: program /usr/sbin/sensible-mda unsafe: No such file or directory
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[18517]: s9INvGkB009352: SYSERR(root): Cannot exec /usr/sbin/sensible-mda: No such file or directory
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[18518]: s9J2lGxv018288: SYSERR(root): Cannot exec /usr/sbin/sensible-mda: No such file or directory
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[18519]: s9M3HG5V029554: Warning: program /usr/sbin/sensible-mda unsafe: No such file or directory
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[18519]: s9M3HG5V029554: SYSERR(root): Cannot exec /usr/sbin/sensible-mda: No such file or directory
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[18520]: s9LJHGAs025335: Warning: program /usr/sbin/sensible-mda unsafe: No such file or directory
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[721]: s9INvGkB009352: to=root, delay=3+16:07:48, xdelay=00:00:00, mailer=local, pri=40620000, dsn=4.0.0, stat=Operating system error
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[18520]: s9LJHGAs025335: SYSERR(root): Cannot exec /usr/sbin/sensible-mda: No such file or directory
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[21074]: s9J2lGxv018288: to=root, delay=3+14:39:10, xdelay=00:00:00, mailer=local, pri=40170000, dsn=4.0.0, stat=Operating system error
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[18521]: s9MId1GO014969: Warning: program /usr/sbin/sensible-mda unsafe: No such file or directory
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[2991]: s9M3HG5V029554: to=root, delay=11:59:38, xdelay=00:00:00, mailer=local, pri=6060000, dsn=4.0.0, stat=Operating system error
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[21632]: s9LJHGAs025335: to=root, delay=19:45:57, xdelay=00:00:00, mailer=local, pri=9750000, dsn=4.0.0, stat=Operating system error
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[18521]: s9MId1GO014969: SYSERR(root): Cannot exec /usr/sbin/sensible-mda: No such file or directory
Oct 23 01:13:52 Ubuntu-1204-precise-64-minimal sm-mta[18524]: s9I6vGQY014865: Warning: program /usr/s

What can I do about this? I am a novice, please give me some hint.

Edit: after solving the sensible-mda issue, mail.log is still contantly growing and now looks like this:

Oct 23 02:57:55 Ubuntu-1204-precise-64-minimal sm-mta[18356]: s9LIHGb5020340: to=root, delay=22:29:33, xdelay=00:00:00, mailer=local, pri=10560000, dsn=2.0.0, stat=Sent
Oct 23 02:57:55 Ubuntu-1204-precise-64-minimal sm-mta[22383]: s9M57GIm010249: to=root, delay=11:20:38, xdelay=00:00:00, mailer=local, pri=5430000, dsn=2.0.0, stat=Sent
Oct 23 02:57:55 Ubuntu-1204-precise-64-minimal sm-mta[18356]: s9LIHGac020340: to=root, delay=22:30:08, xdelay=00:00:00, mailer=local, pri=10560000, dsn=2.0.0, stat=Sent
Oct 23 02:57:56 Ubuntu-1204-precise-64-minimal sm-mta[22383]: s9M5HGR4024737: to=root, delay=11:11:19, xdelay=00:00:01, mailer=local, pri=5430000, dsn=2.0.0, stat=Sent
Oct 23 02:57:56 Ubuntu-1204-precise-64-minimal sm-mta[18356]: s9LIHGc9020340: to=root, delay=22:27:59, xdelay=00:00:00, mailer=local, pri=10560000, dsn=2.0.0, stat=Sent
Oct 23 02:57:56 Ubuntu-1204-precise-64-minimal sm-mta[22383]: s9M5HGQQ024737: to=root, delay=11:12:30, xdelay=00:00:00, mailer=local, pri=5430000, dsn=2.0.0, stat=Sent
Oct 23 02:57:56 Ubuntu-1204-precise-64-minimal sm-mta[18356]: s9LIHGbr020340: to=root, delay=22:28:25, xdelay=00:00:00, mailer=local, pri=10560000, dsn=2.0.0, stat=Sent
Oct 23 02:57:57 Ubuntu-1204-precise-64-minimal sm-mta[4623]: s9M9v2BT016169: timeout waiting for input from local during Draining Input
Oct 23 02:57:57 Ubuntu-1204-precise-64-minimal sm-mta[22383]: s9M5HGQj024737: to=root, delay=11:11:55, xdelay=00:00:01, mailer=local, pri=5430000, dsn=2.0.0, stat=Sent
Oct 23 02:57:58 Ubuntu-1204-precise-64-minimal sm-mta[18356]: s9LIHGae020340: to=root, delay=22:30:09, xdelay=00:00:01, mailer=local, pri=10560000, dsn=2.0.0, stat=Sent
5
  • Have a look at this question and answer. Oct 23, 2014 at 0:01
  • Thanks, this has solved the sensible-mda thing - an issue I discovered while trobleshooting the original issue of too many sendmail instances. The original issue still remains. Oct 23, 2014 at 0:55
  • What makes you think you have too many sendmail instances? What is your baseline? There's really not a lot to go on here. It doesn't appear that the mail is going anywhere but root. Clear your queue and make sure you are not acting as an open relay. Oct 23, 2014 at 19:32
  • In the top command log above I see more than 10 instances of sendmail, this is too much. At maximum, I send 5 automatic emails at once, every 15 minutes, by a PHP cronned script. I set up PHP to use Gmail to send emails: "sendmail_path = /usr/bin/msmtp -C /etc/.msmtp_php --logfile /var/log/msmtp.log -a gmail -t". I don't use sendmail at all! All 'real' emails are logged in a different file /etc/log/msmtp.log. Still, /etc/log/mail.log is growing like crazy. Oct 23, 2014 at 20:48
  • You don't know if those processes are trying and failing to deliver the same messages over and over and over because you won't look at the mail queue. Regardless of how many messages your scripts are configured to send, this is an MTA and will deliver subsystem messages, delivery failures, etc. The status is 'sent' have you looked at root's mail spool? What's in root's Inbox? Oct 23, 2014 at 21:53

1 Answer 1

1

Perhaps due the earlier configuration error your server had entered in this brilliant Spiral of Notify E-Mail Errors via E-Mail loop.

"Hmm, it seems I could not deliver my e-mail... hey, I've got an idea, I'll report about that in an e-mail! Oh, I guess my report about this error did not went through, let me report this error about an error via e-mail...".

Make sure you have everything configured right and then see if there's any actual e-mail to deliver.

1
  • All emails sent by mail() function in my PHP scripts are delivered successfully. I have just rechecked and tested everything again, and it works fine. Oct 23, 2014 at 19:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .