Why does perfectly good mail sit on the exim queue undelivered?

spaceman

Well-Known Member
Mar 25, 2002
509
5
318
Why does perfectly good email sit on the exim mail queue (WHM > Mail Queue Manager) undelivered?

I'm sure there are number of reasons, e.g. server load. But it's kind of annoying (for myself and my clients) when I see mail in the queue that is 2, 4, 8+ hours old, I click on the 'Deliver Now' link, et voila! Delivered successfully right away.

My logical guess is that if the mail doesn't get delivered first time, then exim will try again at repeat intervals. What are those intervals, and can they be easily altered?

Also, 'Attempt to deliver all messages in queue' cannot be relied upon to work (but that's another story: http://forums.cpanel.net/showthread.php?t=23382), and I know that

exim -qff

... can be used to 'force' mail to be delivered (caution: this can really whack your server load), but I was wondering if there's a variation on the exim -qff command that that can specifically target a certain email address and/or domain? I ask because right now I'm manually clicking 'Deliver Now' on one message after another (time consuming!) to push aging messages through for the same email address. I'd love to be able to run exim -qff that targets just this lucky customer who I really want to look after! :)

Any takers?
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,465
30
473
Go on, have a guess
You need to search the log for the indivisual message ID which should give you a reason why the email was initially queued rather than delivered. Most common reasons I see in your situation:

1. Load average is too high when the email arrives (default is 3)

2. DNS query for the sender times out

3. Sender verification times out

4. Unexpected results from changing exim defaults in exim.conf
 

spaceman

Well-Known Member
Mar 25, 2002
509
5
318
Cheers Chirpy.

grep 1GQIpn-0004oX-UX /var/log exim_mainlog

The result I got back was this: "failed to lock mailbox", which is of course because the POP account in question was being accessed by the owner at the same time as the attempt to deliver mail to it.

Getting slightly off-topic: in the above example the email in the queue was listing 5 recipient POP accounts at the same domain name, and the error message "failed to local mailbox" was against a single one of these 5 POP accounts. In this example, just because 1 out of 5 pop accounts couldn't respond, does that mean that the over 4 didn't get their email at this time?

I'm also seeing the word '(Delivered)' against some of the mail items in the exim mail queue. What's that about? If it's delivered in the sense I understand the word delivered, then why is it still in the queue? :confused:
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,465
30
473
Go on, have a guess
A couple of things:

1. Could the ones stating that they were delivered for multiple recipients, so one worked, others haven't?

2. I would guess you're still using mbox and cppop? If you migrated to maildir the pop lock problem should completely go away.
 

spaceman

Well-Known Member
Mar 25, 2002
509
5
318
chirpy said:
A couple of things:

1. Could the ones stating that they were delivered for multiple recipients, so one worked, others haven't?

2. I would guess you're still using mbox and cppop? If you migrated to maildir the pop lock problem should completely go away.
1. I've definitely seen '(Delivered)' against one or two recipients in a multiple recipient list on the exim mail queue, which would presumably which ones have been successfully delivered and which ones haven't. But right now I can see (Delivered) against two messages on two independent servers where both messages only have a single recipient:

1GPwaT-0006kB-PB 4.2K 43h Delete Deliver Now
[email protected] (Delivered)

1GQAXq-0005eu-E7 3.8K 28h Delete Deliver Now
[email protected] (Delivered)

Sure, these are almost certainly spam, but I still wonder about the meaning of (Delivered) against a single recipient message...

2. You're right. Converting shortly. Thanks!
 

brendanrtg

Well-Known Member
Oct 4, 2006
311
0
166
Another problem I noticed is that GENUINE mails that CANNOT BE DELIVERED just sits in the queue and for hosting serves, that can mean thousands of emails lying around per day.

Is there any tweak or fixes which can DELETE and REMOVE these emails after say a certain period or whats the default period if any?
 

mickalo

Well-Known Member
Apr 16, 2002
782
5
318
N.W. Iowa
chirpy said:
A couple of things:

1. Could the ones stating that they were delivered for multiple recipients, so one worked, others haven't?

2. I would guess you're still using mbox and cppop? If you migrated to maildir the pop lock problem should completely go away.
sorry to butt in the middle of the thread here, but we've been considering converting our server over to the maildir but have some reservations as to what effect it'll have on the 40+ hosting accounts currently using the old mbox system. What type of problem can we anticipate if we do the conversion?? We currently have Horde and Neomail enabled for all account Cpanel.

Is there a significate advatange doing the conversion to the maildir from the old mbox/cppop system?

thx's
Mickalo
 

kernow

Well-Known Member
Jul 23, 2004
995
42
178
cPanel Access Level
Root Administrator
We did the maildir conversion thing a few weeks ago, and yes it did cut down the mail queue. And those "perfectly good emails" waiting in the queue now get delivered. Cpanel prefers maildir now so i guess its the way to go.
The problems you will find by doing the conversion are, clients have to re-subscribe to their old email boxes to read/view old mail by going into squirelmail, selecting their old mail boxes and hitting the "subscribe" link. Another problem is that Neomail is removed.
And another problem we get is an error message in the daily Logwatch email saying " **Unmatched Entries**
/usr/lib/courier-imap/etc/shared/index: No such file or directory:" .
 
Last edited:

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,465
30
473
Go on, have a guess
There are also significant improvments with stability and performance of both POP3 and IMAP, especially with any accounts where users leave email on the server. There's also the nice courier imap feature that allows you to have multiple simultaneous IMAP logins to the same account which you can't do in uw-imap.
 

erick_paper

Well-Known Member
Apr 19, 2005
245
0
166
Hello

Can someone tell me where I can find a step by step newbie-admin guide to installing maildir?

Will this affect mailman and email lists? Or is this just a simple backend modification and everything will work as is?
 

brianoz

Well-Known Member
Mar 13, 2004
1,146
7
168
Melbourne, Australia
cPanel Access Level
Root Administrator
There is one minor gotcha you should be aware of:

In the old mailbox format scenario, when the user logs into webmail via cpanel they can see email for ALL the mailboxes in the account. This feature goes away when you convert to Maildir and they can only see the email for the master account (normally unused).

To add back the ability to work on subaccounts, you can manually create symlinks to the other mail directories, works like a treat. I think this is loosely described somewhere else on these forums.

There's another feature that hasn't been mentioned - I think users checking email is a little less cpu intensive - less disk/file has to be read to check for new email. This is more noticeable for larger accounts.