qmail-queue-handlers: cannot reinject message to mail system

A Qmail server wasn’t sending the emails out for some reason. After doing some soul searching, I decided to look at the issue and figure out what might be wrong.I began by tailing the maillog:

Oct 21 08:25:15 server qmail-queue-handlers[19660]: Handlers Filter before-queue for qmail started …
Oct 21 08:25:15 server qmail-queue-handlers[19660]: from=anonymous@server
Oct 21 08:25:15 server qmail-queue-handlers[19660]: to=me@mydomain
Oct 21 08:25:15 server qmail-queue-handlers[19660]: hook_dir = ‘/var/qmail//handlers/before-queue’
Oct 21 08:25:15 server qmail-queue-handlers[19660]: recipient[3] = ‘me@mydomain’
Oct 21 08:25:15 server qmail-queue-handlers[19660]: handlers dir = ‘/var/qmail//handlers/before-queue/recipient/me@mydomain’
Oct 21 08:25:15 server qmail-queue-handlers[19660]: starter: submitter[19698] with error code 65
Oct 21 08:25:15 server qmail-queue-handlers[19660]: mailsend: wait for submitter failed
Oct 21 08:25:15 server qmail-queue-handlers[19660]: cannot reinject message to mail system

So, now I see the problem. It turns out that there are a lot of different reasons why Qmail might provide an error like this but the reason why I received this error was because of the directory ownership issues. To be specific /var/qmail/queue/*

After some comparison, I discovered that the /var/qmail/queue/remote needs to belong to qmails.qmail, otherwise you might see errors like the one above. Of course, I had to do some cleaning since messages were bastardized but the end result was that the mail server was able to send the emails again!

Leave a Reply