• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Imap connection issues

ErwanG

Regular Pleskian
Imap problem with 5 connections

Hello,

One of my customer has a imap account installed on a Ipad, Iphone, Mac... Server : Plesk 10.4.4 (Centos).
Alternately, the account connection doesn't work ("impossible to connect to imap.xxx.com...").

I've modify imap file with this :
MAXDAEMONS=80
MAXPERIP=40

And after "service courier-imap restart".

But there is always the problem...

An idea ?
Thank you.
 
What sort of related errors in /usr/local/psa/var/log/maillog?
 
May 3 10:58:50 ns369232 imapd: Connection, ip=[::ffff:2.12.20.94]
May 3 10:58:50 ns369232 imapd: IMAP connect from @ [::ffff:2.12.20.94]INFO: LOGIN, [email protected], ip=[::ffff:2.12.20.94], protocol=IMAP
May 3 10:58:50 ns369232 imapd: 1336035530.806692 DISCONNECTED, [email protected], ip=[::ffff:2.12.20.94], headers=0, body=0, rcvd=84, sent=254, maildir=/var/qmail/mailnames/xxx.com/philippe/Maildir

I don't know if this connection was an error or not.. but there is a lot of (i think so correct) :

May 3 10:54:34 ns369232 imapd: Connection, ip=[::ffff:90.84.144.111]
May 3 10:54:34 ns369232 imapd: IMAP connect from @ [::ffff:90.84.144.111]INFO: LOGIN, [email protected], ip=[::ffff:90.84.144.111], protocol=IMAP
 
Does this specified number of connections per IP works for non-Apple gadgets?
 
Do you have installed all available microupdates?
 
Over the last few months I've had a number of clients calling for support in relation to iPhones connecting to imap mailboxes.

Having looked through the mail error logs, I've noticed a number of multiple disconnects from the same client at the same time. Sometimes up to 10 disconnects at the same time, relating to the time that they can no longer connect to the mailbox.

Having done some Googling, I've found a number of issues relating to gmail imap connection issues matching the same circumstances. At the time of these issues, attentions were turned to the gmail server config.

Due to the frequency that I'm receiving these support calls, I'm fairly certain that this is an iOS issue which is possibly not connected to config of qmail, but is there anything that can be changed within the imap configuration to gracefully disconnect clients after a certain time to stop the iPhone from making multiple connections and bombing out with connection errors.

My thoughts are the iPhone connects to the mailbox, loses it's data connection but iOS thinks the connection is still open (by using connection tags). When it can't connect to the original connection, it opens a new one and the circle goes on.

Any thoughts appreciated.
 
Does this KB help: http://kb.parallels.com/en/113841
It explains how to increase the number of concurrent connections and it might possibly help even though it doesn't seem to be the real problem.

If not, you may find a timeout setting in that configuration file which could possibly be increased?
 
Hi Faris, thanks for the reply!

I applied the resolution in the KB article the first time I had this issue reported by a client, and it seemed to fix things for the last 6 months.

This recent issue was a new mailbox setup on an iPhone only a few days ago.

Couldn't find any connection timeout options in the config file.

Oh well, will just have to keep an eye on it and suggest a phone restart -seems to work. Not ideal though, what with Apple lovers presuming their devices are perfect ;)
 
Over the last few months I've had a number of clients calling for support in relation to iPhones connecting to imap mailboxes.

Having looked through the mail error logs, I've noticed a number of multiple disconnects from the same client at the same time. Sometimes up to 10 disconnects at the same time, relating to the time that they can no longer connect to the mailbox.

Having done some Googling, I've found a number of issues relating to gmail imap connection issues matching the same circumstances. At the time of these issues, attentions were turned to the gmail server config.

Due to the frequency that I'm receiving these support calls, I'm fairly certain that this is an iOS issue which is possibly not connected to config of qmail, but is there anything that can be changed within the imap configuration to gracefully disconnect clients after a certain time to stop the iPhone from making multiple connections and bombing out with connection errors.

My thoughts are the iPhone connects to the mailbox, loses it's data connection but iOS thinks the connection is still open (by using connection tags). When it can't connect to the original connection, it opens a new one and the circle goes on.

Any thoughts appreciated.

Hello DaveKay, I've noticed the exact same problem with my 11.0.9 installation, In fact, the only way I can get the iPhones to reconnect to the IMAP accounts it's by deleting the account in the iOS and configuring it again, but eventually the iOS device can loose the access randomly. I've tried increasing the number of connections by IP in courier-imap config with no luck. I hope Parallels support team can check this issue soon.
Greetings.
 
Hi Fernando,

The issue can be a real pain! Unfortunately, I don't believe it's actually an issue within Plesk/Courier, but a compounded issue with iOS as it's well documented that GMail imap had the same issue a while back. Not sure what their fix was or even if they did actually fix it!

Can't imagine there's likely to be a solid fix anytime soon!
 
If we are talking about GMAIL service (by that i mean google aps accounts), your clients MUST enable option to enable IMAP in their own account.

They can do that by login into their gmail accounts, clicking on that wheel on the right side under the account name -> Settings -> Forwarding and POP/IMAP -> IMAP Access -> Enable IMAP. Save changes.
 
MislavO,

You've misunderstood the issue. The problem is with iPhones accessing mailboxes hosted on a Plesk server using imap. I was simply referring to a similar issue with gmail account imap issues - a know problem with iOS.
 
Imap connection issues and iPhone

Just a few observations:

restarting the iPhone does not resolve the issue...

Changing connection type (i.e.: from WiFi to 3G) does not resolve the issue...

The only thing that seems to help is to change the incoming mail server; for example: change from mail.domain.com to imap.domain.com or domain.com or alternate.domain.com (of course, make sure you create A records for those subdomains in your server's DNS)

I suspect that this has to do with the self-signed security certificates that Plesk uses...
I have not tried purchasing a real security certificate, as i cannot currently afford it... (Plus, i'm not sure that would even work since my hosting provider's server name is the one that always appears as the root for the security vert)

I hope this helps!

PS: To Parallels tech support: please pay attention to this issue: i use two different servers, one is a Plesk 11.0.9 on CentOS, and the other is a Plesk 9.3 on CentOS 5.6 and they BOTH produce the exact same error, and the 'workaround' listed above is the ONLY thing that works for both...

EDIT:

Deleting the account and re-entering it (using the same values for server address) has *not* worked in any of the cases (at least 200 times with 12 or so iPhones)...
Deleting iPhone network settings does *not* resolve the issue
Pairing any of these failed attempts with restarts does *not* work at all...

Note that i have also increased the MAXPERIP and MAXDAEMONS variables for both imap and pop3 (i read somewhere that iPhones were using pop3 authentication for IMAP connections) -- vell, that did not resolve the issue either.

The only thing that seems to work is to change the iPhone configuration so that you get the message, at configuration time, to accept or not the server's unverified security certificate.
 
Last edited:
I found a really old 8.x-related thread which has a suggestion about this: http://forum.parallels.com/showthread.php?t=84532

In it, FranklinT says:

I had a similar problem with Apple Mail which has a configurable setting to use the IMAP IDLE functionality to stay logged in, periodically checking email. As the server in question was primarily used by Mac users, this caused imapd to run out of daemons and stop responding. One solution is, of course, to raise MAXDAEMONS in /etc/courier-imap/imapd, but you will eventually begin to tax your server's resources unduly.

The better solution is to disable IDLE entirely in /etc/courier-imap/imapd.

Change:

IMAP_CAPABILITY="IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE"

To:

IMAP_CAPABILITY="IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA"

... and restart courier-imap. This should prevent those pesky Blackberry (or Apple Mail) connections from persisting ad infinitum.

Hope it works for you!

Franklin
 
Thank you for the input;
I have to say i've never tried that...

The odd thing is that it really is only iPhones that have this problem...

I'll definitely report back if this solves the issue...

what about the IMAP_CAPABILITY_ORIG variable? Does it matter? Should IDLE be disabled here too?
 
In order to more quickly get to the bottom of this, please can I ask people who are affected to post a message here with the details requested by Igor in http://forum.parallels.com/showthread.php?t=106113

Basically (without changing the headings - post info below each heading please) we need posts with this info:
---------------------------------------------------------------
PRODUCT, VERSION, MICROUPDATE, OPERATING SYSTEM, ARCHITECTURE

PROBLEM DESCRIPTION

STEPS TO REPRODUCE

ACTUAL RESULT

EXPECTED RESULT

ANY ADDITIONAL INFORMATION
--------------------------------------------------------------

Under the ANY ADDITIONAL INFORMATION heading, please can you provide as much info on the iPhone being used as possible? .e.g Type (e.g. iPhone 4s) and iOS version. But please post even if you don't have this information to hand. We need to see if there's any correlation in terms of Plesk version and OS etc etc.

ALSO please include information on the firewall you are using. e.g. Plesk firewall, APF, some other firewall.
It might be helpful also to include details of any third-party utilities or applications that you might have installed, e.g. clamav, qmail-scanner, spamdyke....anything that might have any effect whatsoever with email, even if it isn't something you'd expect to directly come into the equation with IMAP.

Please also post as much info as you can on the actual error messages (if any) that the user encounters on their phone, or any errors mentioned in any logs (if there is anything logged -- which doesn't seem to be the case).

[zconsulting -- sorry, I'm not sure about that setting]
 
Last edited:
p.s. to zconsulting -- real (but basic) SSL certificates can be had for next to nothing -- $25 or less. And I think I can arrange for you to have one at my cost price (which is obviously a bit less) if you are willing to give it a try? Send me a PM if you like. No hidden agenda, no catch - just trying to help.
 
2 server specs

First server is a shared server to which i have no ssh connection:

The info from Plesk is as follows:
psa v11.0.9_build110120608.16os_CentOS 5
The sysadmin assures me that he set the following variables for 2 files in /etc/courier-imap/:
For imapd:
MAXDAEMONS=300 and MAXPERIP=200
For pop3d:
MAXDAEMONS=40 and MAXPERIP=4

i'm afraid that's all i can get on that one...


My server is a VPS:
Plesk is 9.3.0 (Parallels Plesk Panel v9.3.0_build93110722.08 os_CentOS 5)
CentOS build is: Linux 2.6.18-028stab099.3 (it is x86_64)
cat /etc/redhat-release returns: CentOS release 5.9 (Final)
i use the atomic repo for php
On my system, the variables are:
For imapd:
MAXDAEMONS=240 and MAXPERIP=120
For pop3d:
MAXDAEMONS=180 and MAXPERIP=60


PROBLEM DESCRIPTION:
On iPhone only apparently at random, suddenly the Mail application will no longer be able to connect to the server saying something like: 'could not connect to the server' (something vague like that)
When this happens, the mail account configuration still polls the server and emits no error (all checkmarks ok)


STEPS TO REPRODUCE:
Check your mail on your iPhone...
Seriously though... There is no predicting when this will happen, but once it does, it does not stop, even if you change WiFi network or go to 3G/EDGE.
Removing the account and re-creating it with the same values does not solve the issue either


TEMPORARY SOLUTION:
One solution that works every time (for a little while at least) is to change the incoming mail server to one not previously used:
i.e.: from mail.domain.com to imap.domain.com or alternate.domain.com or simply domain.com (as long as DNS A records exist on the server)


I hope this helps
Peter

PS: to Faris Raouf, i've tried the free SSL cert from StartSSL, but that only provides a personal cert, not a real http and email server cert, correct?
 
Last edited:
Hi,

I had the same problem, I checked on my own iPhone that the problem appeared after I sent my first mail...
After sending, my iPhone tried to create a new folder on IMAP named "Sent Messages" then it was impossible to synchronize the IMAP after that.

Is it possible that the default directory rules for new mails are not compatible with iOS, that the system won't create new folders
As example I'm not allowed on IMAP to delete the folder "Trash" but for iOS this folder must be named "Deleted Messages"
The same for the sent messages, server default "Sent" iOS default "Sent Messages"

My config:
OS Ubuntu 12.04 LTS
Version de Parallels Panel 11.0.9 Mettre à jour #44
Le système est à jour ; dernière vérification le Mar 31, 2013 06:55 AM

Yes I'm a french User ;-)

So may be this is the reason... some ideas?? Sorry no solution for this for the moment

Steve
 
Back
Top