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 mailRelay.xxx.net

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=<200604041807.k34I74o9022240@x.xxx.net>, relay=root@localhost

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

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.  
slocoachAsked:
Who is Participating?

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

x
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 sendmail.mc

dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
define(`SMART_HOST',`relay.host.net')dnl
anfiCommented:
The entries are not caused by your cron command.

Sendmail-8.12+ sends locally submitted messages via SMTP to 127.0.0.1:25. It allowed installation without set root id binary. It is described at http://www.sendmail.org/security/secure-install.html
---------------------------------------------------------------------
If you want sendmail to send locally submitted messages to another host then
1) modify submit.cf (not sendmail.cf). In submit.mc change the last line to contain your smart host IP instead of 127.0.0.1
  FEATURE(`msp', `[127.0.0.1]')dnl
and generate new /etc/mail/submit.cf [not /etc/mail/sendmail.cf]
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 me@here.com  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?
anfiCommented:
In "normal" situations locally submitted messages will be send "at once" to relay configured in submit.cf.

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 somebody@example.com

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/sendmail.cf
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 submit.cf
# 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]
anfiCommented:
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.