# Sendmail using resources



## SeattleMatt (Apr 19, 2016)

I have a system in which sendmail is using too many processes and causing

```
-bash: fork: Resource temporarily unavailable
```
What's strange is that I disabled sendmail and it is still racking up PIDs somehow

```
# ps ax | grep sendmail*
3687  ??  Is     0:00.01 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
7890  ??  Is     0:00.01 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
12084  ??  Is     0:00.02 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
16309  ??  Is     0:00.02 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
21005  ??  Is     0:00.01 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
25986  ??  Is     0:00.02 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
30191  ??  Is     0:00.01 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
34333  ??  Is     0:00.01 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
38441  ??  Is     0:00.02 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
42619  ??  Is     0:00.01 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
46706  ??  Is     0:00.01 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
51647  ??  Is     0:00.02 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
55753  ??  Is     0:00.01 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
59918  ??  Is     0:00.01 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
64121  ??  Is     0:00.03 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
68255  ??  Is     0:00.02 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
72938  ??  Is     0:00.01 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
78008  ??  Is     0:00.01 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
82108  ??  Ss     0:00.01 /usr/sbin/sendmail -FCronDaemon -odi -oem -oi -t
83009   0  S+     0:00.00 grep sendmail*

# /etc/rc.d/sendmail onestatus
sendmail is not running.
sendmail_clientmqueue is not running
```


----------



## Juha Nurmela (Apr 19, 2016)

See cron(8) there's  `-m ''` flag to discard mail unless an explicit MAILTO= is in tab. rc.conf and cron_flags="-m ''"

Juha


----------



## SeattleMatt (Apr 20, 2016)

Ok, I read that, are you saying you think that something else is starting sendmail threads, event though the service is not running?


----------



## usdmatt (Apr 20, 2016)

It looks like an application (probably cron judging by the sender name it's using...) is running /usr/sbin/sendmail in order to send emails. My first thought was that you have some malware trying to send emails but it could just be something regularly being run by cron. 

Even though the Sendmail daemon is disabled, applications like cron will still try and send email, and ideally your system should be set up to allow those messages to be delivered somewhere. This is why the Sendmail submit/outbound & queue processor services are on by default.


----------



## SirDice (Apr 20, 2016)

Note that periodic(8) will send mail at regular intervals. Even if there's no MTA running on the machine. You might be able to figure out what it's doing by reading /var/log/maillog.


----------



## Juha Nurmela (Apr 20, 2016)

You might install some simple local mail delivery system, mail/dma is one, maybe there are others better suited.

Would it be possible to put mail.local(8) into mailer.conf(5) for a super simple system ? It won't do aliases, does it allow the basic set of options programs like to use, expecting sendmail ?

Juha


----------

