Attempting "sendmail -q" via cron without sendmail service running

Desired Scenario:
I want sendmail service off by default.  As system services send alert emails they will backup in the Q.  I want to use cron to flush the Q every 10 minutes via

I setup cron to clear out the mail Q every 10 minutes.  
 */10 * * * * /usr/sbin/sendmail -q

If I have the service running all is well, but when I stop sendmail the sendmail -q command causes this in /var/log/maillog.
 Apr 4 14:07:15 xserverx sendmail[22240]: k34I74o9022240: from=root,
size=17, class=0, nrcpts=1,
msgid=<>, relay=root@localhost

Apr 4 14:07:15 xserverx sendmail[22240]: k34I74o9022240:, ctladdr=root (0/0), delay=00:00:11, xdelay=00:00:00,
mailer=relay, pri=30017, relay=[] [], dsn=4.0.0,
stat=Deferred: Connection refused by []

It appears I can't send the email because the MUA was attempting to connect to the MTA (sendmail) locally instead of using the relay server, but I'm obviously missing something.
If I start sendmail and run sendmail -q all is well, but that defeats the purpose.  Please advise.  
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slocoachAuthor Commented:
As an afterthought, I'm adding more detail to whittle down possibilites.
Below is from

dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
The entries are not caused by your cron command.

Sendmail-8.12+ sends locally submitted messages via SMTP to It allowed installation without set root id binary. It is described at
If you want sendmail to send locally submitted messages to another host then
1) modify (not In change the last line to contain your smart host IP instead of
  FEATURE(`msp', `[]')dnl
and generate new /etc/mail/ [not /etc/mail/]
2) Change the cron command to flush "client" queue instead of main queue
/usr/sbin/sendmail -q -Ac

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
slocoachAuthor Commented:
Thanks for the fast response.  I think that worked, at the very least I can send mail out.  
I'm curious as to how I can test the Q though.
If I sendmail  blah .   The email is immediately sent instead of being put into any Q.

Does that have anything to do with this?
[root@as1 mail]# /usr/sbin/sendmail -q
No local mailer defined
QueueDirectory (Q) option must be set
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

slocoachAuthor Commented:
And I will change the cron task to /usr/sbin/sendmail -q -Ac .  I'm just curious as to how this can be tested.  How can I Q up some "client" jobs to flush?
In "normal" situations locally submitted messages will be send "at once" to relay configured in

Periodic flushing of "client queue" is required only to repeat delivery attempts in case of  (sporadic) delivery problems  e.g. network problems OR overload of the receiving sendmail OR maintanance shutdown of the receiving host. You may see *weeks* without the cron job pushing any queued mail not delivered by "at once" delivery attempt.

If you want to test cron based client queue runs the send a message in queue delivery mode:
    (echo subject: test ; echo) | /usr/sbin/sendmail -odq -oi

You can check client queue content using:
   mail -Ac

ABOUT "/usr/sbin/sendmail -q" reporting "No local mailer defined"
most likely it marks lack of proper /etc/mail/
IF you do not plan to start local sendmail daemon AND "/usr/sbin/sendmail -q -Ac" does not report similar problems THEN you may ignore it.
slocoachAuthor Commented:
From my
# queue directory
O QueueDirectory=/var/spool/clientmqueue
slocoachAuthor Commented:
Re:IF you do not plan to start local sendmail daemon AND "/usr/sbin/sendmail -q -Ac" does not report similar problems THEN you may ignore it.

Yes, that is the intention and the sendmail -q -Ac command does not create the Q error in the maillog.
However, i'm curious.  If I did plan on starting the local sendmail daemon how would I fix it?  
If you prefer, I can start another question with some points attached to continue this dialog.

This has been enlightening.  I really appreciate the help.  
slocoachAuthor Commented:
Couldn't check on my Q:

[root@xxx /]# mail -Ac
mail: invalid option -- A
Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
            [- sendmail-options ...]
       mail [-iInNv] -f [name]
       mail [-iInNv] [-u user]
Sorry, it was *my* typing mistake. I meant:
   mailq -Ac
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Email Servers

From novice to tech pro — start learning today.