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: k34I74o9022240: from=root,
size=17, class=0, nrcpts=1,
Apr 4 14:07:15 xserverx sendmail: k34I74o9022240: firstname.lastname@example.org, 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.