Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mail is killing the processes on my server with IMAP

Why is mail over running my server with IMAP processes?

I've had to start killing the process like crazy cause it was causing other services on my website to fail.

i contact support for Hostgator and they asked if i was using Mac Mail. i said yes, and he said, yeah mac mail does that. what's that suppose to mean?

it really hasn't happened in the past, why now?

 Unibody MBP 15" 2.4Ghz 4GB RAM, Mac OS X (10.5.6), iPhone 3G

Posted on Mar 12, 2009 6:31 PM

Reply
48 replies

Jul 13, 2009 4:47 PM in response to tjennings

Theresa Mesa wrote:
Here's the responses from Hostgator I received:


The key phrase here being:

"Unfortunately, this is a known issue with Apple Mail and several other IMAP clients.


I don't know for sure what Mail.app is doing, but it's become somewhat standard procedure to use "online" mode for IMAP clients when connected to IMAP4 servers, meaning the connection is kept open the entire time you remain online with the IMAP server, and to run multiple threads per mailbox, often at least one for reading, one for writing and one for downloading attachments.

This allows the activities to occur simultaneously ( e.g. allowing you to continue reading your email messages while sending a large outgoing file or downloading an attachment.)

If the number of connected threads and/or their longevity is really a big issue, perhaps you should be using POP instead.

Jul 14, 2009 8:20 PM in response to Barney-15E

Barney-15E wrote:
I'm not sure I understand it completely, but I think it keeps the connections open. If you don't use IDLE, I'm assuming that it will open the connections, do what it needs, and close the connections. I guess it doesn't help if you check all at the same time.


No, IDLE is simply a protocol to allow Mail clients to be notified of new mail without having to click refresh or otherwise manually check for it.

You can read more than you probably want to know about it in RFC 2177.

Clients using IDLE can be terminated by the server after their IDLE timeout; from the RFC:

The server MAY consider a client inactive if it has an IDLE command running, and if such a server has an inactivity timeout it MAY log the client off implicitly at the end of its timeout period. Because of that, clients using IDLE are advised to terminate the IDLE and re-issue it at least every 29 minutes to avoid being logged off.

This still allows a client to receive immediate mailbox updates even though it need only "poll" at half hour intervals.


Leaving IMAP connections open is a standard behavior that many newer IMAP clients do - I mentioned the reasons why in my earlier reply.

In short, this is not a Mail.app-specific behavior, and if it's causing issues with your server you'll need to change your email access type to POP, which does just what you want - connects, downloads mail, and disconnects.

The University of Pennsylvania has a nice FAQ page from 2004 that explains some of the differences between the protocols:

POP vs. IMAP (2004)

Jul 16, 2009 3:21 PM in response to Gabe Steinbach

It took down a PHP-based website on my account, because PHP is rendered on the server, not on the browser, and Apple Mail used up all the server processes I had left on my account. Not all IMAP mail clients do this, but Apple mail is not the only one. We're hearing about Apple right now because this is an Apple forum.

Since Apple is the company to lead the way on cutting-edge technology, it would be nice if it could at least join the IMAP mail clients that DON'T use up 4 processes every time they retrieve mail.

Jul 20, 2009 12:36 PM in response to Gabe Steinbach

The IMAP issue will not slow down a server. It will only stop access to other processes on a hosting server. So if your server is slowing down, there is something else afoot. It's not the IMAP problem being discussed here.And is is not a denial of services attack.

Actually Apple Mail.app IS the only Mac mail client doing it currently that I know of. As a consultant I've tested both Entourage & Thunderbird. They only open 1 IMAP process per eMail account being checked. Unlike Mai.app which opens a minimum of 4 process per eMail account being checked by a user. And both those apps kill all IMAP processes they create cleanly leaving no "stray" IMAP processes lingering, as can happen with Mail.app.

If a single user is checking enough accounts theoretically they can cause the same issue. The issue is not enough processes being left to run a PHP website (blog). But in an office situation, where a number of users are checking multiple accounts, the problem rears its ugly head much much sooner. But again ... it does not "slow down" the server. It only stops other processes from running because too many IMAP processes are running

I've been following the issue and writing about it on my eMac Consulting blog since I had problems surfing to a clients Wordpress blog.

http://www.emacconsulting.com

Jul 20, 2009 12:50 PM in response to Joe Streno

I work out of my home, not in an office. I have three email accounts on my domain, and Apple mail uses 12 of those processes (and doesn't close it, so those 12 processes are lingering) in checking my 3 accounts, and then it checks again and uses another 12 processes, that's 24. I can kill those processes. There's a process used by cPanel. That makes 25. There are processes being used by the daemon that are not killable. That can add another two or three processes I have no control over. I've used up my allotment of processes. Now, I have no processes left, and visitors to my Wordpress (PHP-based, server-side) get a 500 error. I kill the IMAP processes, my blog miraculously runs again. I check my IMAP email a couple of times, blog goes down. I kill the processes again. I check my blog. It's up. I check my email a couple more times. Blog goes down. It's not rocket science.

But you're right, Joe, it shouldn't be slowing down the server. The server is either up or hosed. Period. Something else is slowing down the server.

Aug 4, 2009 10:01 AM in response to BrianH

Just chiming in here and am a novice with all this IMAP and Port settings. Am not sure if my problem is same, related, or different from the one in this thread. Here's the gist:

I have Host Gator account and two email addresses.
I had to manually set up the Apple Mail using the settings from Host Gator.
All is fine and everything is working when out of nowhere, I get an error on the STMP server cannot send a message out and the mail box is not retrieving incoming messages.
I look at the settings and WOW! the port has somehow changed to 143 even though I set it to 26 (the port number specified by Host Gator) and saved that. I haven't even bothered to try SSL because that gets me absolutely nowhere.

Should I follow the earlier instruction about submitting a cronjob in my Host Gator c-panel to run every 15 minutes? I'm a new start up and home based business and I'm not getting that much email ... yet! Help!

Aug 4, 2009 10:16 AM in response to Robert here!

You don't generally use SSL with Hostgator anyway (I have an account with them). Hostgator's tech support is great, although if it's your Apple mail program, they may not be able to help.

If you check the SSL box, your port will change, but if you uncheck the SSL box, your port should change back. I believe the port does change to 143 with the SSL box checked. I could be wrong.

Port 26 is for POP SMTP (outgoing). Port 143 is for IMAP outgoing. Are you set up as POP or IMAP? Perhaps the tech was not aware you were trying to set up as IMAP instead of POP3, so you have two different process settings going on.

Here's the list of commonly used ports from their website:

E-MAIL

POP3 connects via port 110
IMAP connects via port 143
SMTP connects via port 25 and 26
Secure email connections?
SMTP over TLS/SSL 465
IMAP over TLS/SSL 993
POP3 over TLS/SSL 995



Call their support and see if they can help. I love that they have 24/7 phone support in the US, so you can understand them.

Mail is killing the processes on my server with IMAP

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.