Operating System - HP-UX
1834789 Members
2332 Online
110070 Solutions
New Discussion

Re: Run sendmail periodically from cron

 
Gary_O
Frequent Advisor

Run sendmail periodically from cron

I see you can disable sendmail by first stopping it, and then editing the /etc/rc.config.d/mailservs file.

But to get any mail for root, how do I run sendmail from cron to clear out its queue?
2 REPLIES 2

Re: Run sendmail periodically from cron

Any time sendmail is run for a send the queue will be processed, so local delivery should not be an issue. You can use Bastille to configure the cron run, available:

http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=B6849AA

or simply add the following entry to your root crontab:

0,15,30,45 * * * * /usr/sbin/sendmail -q

This will run sendmail to clear the queue every 15 minutes.

Tyler
Vasikaran Venkatesan
Frequent Advisor

Re: Run sendmail periodically from cron

You do not need sendmail to be running for sending out mail. Mails will go automatically without the daemon running -
IF there is a mail queued for some reason, you can run the sendmail -q from the cron in a frequency, to clear the queue.