Operating System - Linux
1821245 Members
2926 Online
109632 Solutions
New Discussion юеВ

sendmail -q - What does it do?

 
SOLVED
Go to solution
Jack C. Mahaffey
Super Advisor

sendmail -q - What does it do?

I've been asked to have sendmail -q run every hour as a task for Sarbanes-Oxley compliance.


What will the command do for me?


Another question. Does the sendmail daemon even need to be running if the extent of mail being used is to used mailx to send mail to non-UNIX servers and local UNIX accounts?


thanks ... jack...
9 REPLIES 9
Vitaly Karasik_1
Honored Contributor

Re: sendmail -q - What does it do?

sendmail -q force sendmail server to send letters from mail queue.

In order to run this command every hour, you should open your crontab for editing [crontab -e] and add the following line:

0 * * * * /usr/sbin/sendmail -q

Regarding second q. - it depends on distro you use. In modern RH distros you have to run sendmail.
Jack C. Mahaffey
Super Advisor

Re: sendmail -q - What does it do?

Under what situation will the mail queue be queued with letters to send?

For example, I run mailx on a regular basis to send an e-mail, it's my understanding that the mail would only temporarily reside in the queue. Does the -q option force 'resends' if the orginal sends did not work?
Vitaly Karasik_1
Honored Contributor
Solution

Re: sendmail -q - What does it do?

Letters "queuened" when sendmail cannot delivery them immediately - for example, MX server of recipient is down, DNS problem, etc...
Chris Xu
Trusted Contributor

Re: sendmail -q - What does it do?

Sendmail automatically wake up and process the queue at a certain interval. There is not really a need to run "sendmail -q" every hour. That command is to process the queue for out-bound mails. If your system is runnning Red Hat linux, the default interval to process the queue is 1000 seconds as sepecified in queue_run_delay = 1000s in the main.cf.default config file. Sendmail service must be running for that to work. Check your sendmail by using "service sendmail status".

Chris
Chris Xu
Trusted Contributor

Re: sendmail -q - What does it do?

If you are running an older Red Hat, i.e. AS 2.1, the interval is set in /etc/sysconfig/sendmail, and it is 1 hour by default.

Chris
Jack C. Mahaffey
Super Advisor

Re: sendmail -q - What does it do?

No... Just HP-UX 11.00.


I'm also tempted to shut sendmail down since the server doesn't receive inbound mail but does send outgoing mail.


Will there be any problems of not starting sendmail in the rc scripts. If okay to not start, should I remove the sendmail startup sendmail link in /sbin/rc2.d or just update SENDMAIL_SERVER=0 in /etc/rc.config.d/mailservs?


The crontab job to resend queued messages will remain.

jack...

Chris Xu
Trusted Contributor

Re: sendmail -q - What does it do?

Just set SENDMAIL_SERVER=0 /etc/rc.config.d/mailservs. You should be fine to turn off the mail server as you don't receive any in-bound mails. However, you can run sendmail as a mail client, which will actually do the same work as the "sendmail -q" in your crontab.

Chris
Jack C. Mahaffey
Super Advisor

Re: sendmail -q - What does it do?

Chris, thanks... That's what I thought. Didn't know if changing the setting in /etc/rc.config.d/namesrvrs would cause the sendmail command to fail when it's not running in background.


Steven E. Protter
Exalted Contributor

Re: sendmail -q - What does it do?

Linux:

If the sendmail daemon is set to run, mail will automatically be pushed regularly.

chkconfig --level 12345 sendmail on
service sendmail start


That will run the daemon, enabling inbound mail and pushing mail out the door regularly.

I have no idea why sendmail -q is required for Sarbanes-Oxley compliance. If that law requires mail to be pushed out the door the sendmail daemon will do it just fine.

Sendmail daemon settings are controlled in sendmail.cf The behavior of the daemon can be controlled with the sendmail.mc file.

There is a wealth of information on this subject at http://www.sendmail.org

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com