Operating System - HP-UX
1832285 Members
2562 Online
110041 Solutions
New Discussion

Re: Many files in /var/spool/mqueue

 
ikbea
Frequent Advisor

Many files in /var/spool/mqueue

I stopped the "sendmail" when startup the server. Recently, the /var full. I find many files in /var/spool/mqueue. Most of them show standard output/error from cron jobs.

I supposed the mail cannot be sent out as the sendmail is disabled, so they queued in /var/spool/mqueue.

However, in /var/mail/, users' mail log is always updated, most of message from cron jobs.

Why users can received new mail from cron jobs?
Is any relateship to queued file in /var/spool/mqueue ?

Thanks
6 REPLIES 6
Naveej.K.A
Honored Contributor

Re: Many files in /var/spool/mqueue

Hi,
what does mailq gives??

sendmail is an MTA (mail transfer agent) and needs to be run in the system only if you want to send some mails outside of your server. I strongly feel that your system loggind daemons, syslogd and scheduling daemon, crond doesn't uses any of the MTA, if the logs are not to be send on to any other host/domain.

With best wishes
Naveej
practice makes a man perfect!!!
Michael Tully
Honored Contributor

Re: Many files in /var/spool/mqueue

Sendmail does not need to be running to use mail internal to the system, It is only required to send off the machine and receive from external. If the sendmail daemon is required and is not running the mail gets placed into 'mailq'. See the 'mailq' man page for details.

1) mail will continue to be received internally on the local system.
2) no
Anyone for a Mutiny ?
Sridhar Bhaskarla
Honored Contributor

Re: Many files in /var/spool/mqueue

Hi,

As already mentioned, you don't need to have sendmail running on the box to send the mail out.

If you looked the output of 'mailq' command you would have seen the errors. Like connection refused, hostname lookup failure etc.,. Users can do a lot of mischevious things and all those mails will get queued. If you are not running sendmail daemon, then there will be nothing on the system that will attempt to resend the mails in the queue.

So, it is a good idea to setup a cronjob every hour or so to actually run sendmail in client mode (sendmail -q) so that the mailq will be flushed out.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
T G Manikandan
Honored Contributor

Re: Many files in /var/spool/mqueue

If any cronjob is executed associated to a user,the user receives a mail to his mailbox on its completion/success/failure on the local system.

sendmail can only take you out from that system.

I assume that the reason the /var/mail/mqueue filling up is because you might have some cron job scripts which are calling sendmail and mailing users outside the system.
As the sendmail is not running,they are queued under /var/mail/mqueue.

Please check it out~!
Elmar P. Kolkman
Honored Contributor

Re: Many files in /var/spool/mqueue

Try running mailq. This will show who all the mails are for. It might be some user having a crontab, also has a alias or .forward resulting in trying to send the mail outside the system. Or his mailfile was not writable by the mail delivery agent, so the mail is old...

Running 'sendmail -q' might help in the latter case. Also check out the rights of /var/mail and /var/mail/*. All should be writable to group mail !!! Otherwise the delivery agent won't be able to deliver mail.
Every problem has at least one solution. Only some solutions are harder to find.
Tor-Arne Nostdal
Trusted Contributor

Re: Many files in /var/spool/mqueue

Since the background job (cron/at) don't have a terminal attached, the standard output is sent as a mail to the user who run the job.

If you want to get rid of all the output from the crontab entries you should consider piping it.

Example:
55 23 * * * /var/minime/night_jobs.sh >> /tmp/minime.log 2>&1

Or:
55 23 * * * /var/minime/night_jobs.sh > /dev/null 2>&1

/Tor-Arne
I'm trying to become President of the state I'm in...