# qmail is not delivering my email anymore

## uncleringo

Having followed the 'qmail/vpopmail Virtual Mail Hosting System Guide' many many months ago my email had been working very reliably until earlier this week. I was unable to connect with my mail client (thunderbird) so logged in and restarted all services that I could think were relevant, but with no success. So since the server had been up for 392 days I thought a reboot might be timely. Afterwards I seemed to be able to connect (to imap-ssl), but ever since I can't actually view any emails that weren't cached and no new emails have turned up since. No new emails show up in mutt either (running directly on the server)

I have absolutely no idea where to start with this. I've turned off my firewall just in case but with no joy, and I've run 'queue-repair -r', which found and fixed a load of file permissions but still nothing's working. I've looked in /var/log/qmail/qmail-smtpd/ and /var/log/qmail/qmail-send/, and suspiciously I have found a lot of entries like the following in /var/log/qmail/qmail-send/current:

@4000000045df897d27af4b4c alert: unable to opendir todo/0, sleeping...

Googling has not come up with much. Could anyone give me any idea as to what to try here?

I should add that i've also tried upgrading to the netqmail package since that seems the way to go in the near future.

----------

## kreep69

Check this guide, it may help you - https://forums.gentoo.org/viewtopic-t-539101-highlight-netqmail.html

Of course search the gentoo forums more as well, they are full of good info.  Your specific problem sounds permission related.  Run 'ps aux | grep qmail-smtpd' and see what user qmail is running as.  Compare this user to the owner of the queue folder you mentioned and that might be the problem right there.  You can control the user qmail runs as in - /var/qmail/control/conf-common

Or you can try fixing the queue by running -

/var/qmail/bin/queue-fix [folder your qmail queue is in usually /var/qmail/queue]

or

emerge net-mail/emerge queue-repair and run it

Important - make sure you stop qmail before trying to repair the queue (/etc/init.d/svscan stop and either wait or kill all running qmail processes).

----------

## orange_juice

 *kreep69 wrote:*   

> emerge net-mail/queue-repair and run it
> 
> Important - make sure you stop qmail before trying to repair the queue (/etc/init.d/svscan stop and either wait or kill all running qmail processes).

 

Thanx! I also checked this site for some help on the queue-repair options

Kind regards,

orange_juice

----------

## Anarcho

I also had this problem some weeks ago. I wasn't able to repair the queue. So I move all queue files away, recreated the empty directory structure.

After that I did a qmail-inject for each file I found important from the queue which delivers the mails again. This had worked and I now have all queued emails in my mailbox.

----------

## orange_juice

Actually, I did a 

```
queue-repair -r
```

which worked for a while. Then again, mail were not delivered. Unless I stoped and restarted svscan where I would get a mail stating that each mail could not be delivered due to the fact that it stayed in the queue too long.

Then I did the following:

```
/etc/init.d/svscan stop

rm -R /var/qmail/queue

queue-repair -c -s 23 -b

/etc/init.d/svscan start
```

-s 23 is the default for netqmail, so I sticked with it.

-b is for big-to-do patch which I found out that exists in portage's netqmail-1.05

Now mail seems to be working. I will check tomorrow when system would have emailed me the midninght maintenance messages.

Kind regards,

orange_juice

----------

