7 Replies Latest reply: Jan 28, 2014 11:31 AM by Andrew J.
benomatis Level 1 Level 1 (5 points)

iMac (27-inch Mid 2011), Mac OS X (10.7.3) (recentrly restarted as I thought it's going to solve my problem)

Mail Version 5.2 (1257) (no activity running)

No antivirus software


Steps to reproduce:

1. Go to Apple icon in menu bar

2. Choose Shut Down or Restart (ticking the Reopen windows when logging back - this is actually the point, so manually force quitting every time cannot be the solution) - some of the applications will start closing and sooner or later I get the following error message:


"You haven't been logged out because the application Mail failed to quit. To try logging out again, quit Mail and choose Apple menu > Log Out.


To suit an unresponsive application, choose Apple menu > Force Quit (or press Command-Option-Esc.)"


Currently I used the workaround to Force Quit Mail and then it works, even if I restart Mail before restarting or shutting down.


Thanks a lot for your help in advance!

iMac (27-inch Mid 2011), Mac OS X (10.7.3)
  • benomatis Level 1 Level 1 (5 points)

    I made a snapshot of what's happening when I Shut Down (see below) and guess what, Mail is Deleting trash of all of my mailboxes at once at that very moment, however the setting to do permanent deletion is set ot Never on my accounts. This activity might be hanging and causing the Shut Down to be cancelled, but for some reason I could not reproduce this error since I reported it. Will keep testing and see if it re-occurs. Until then, if you have any ideas or suggestions, they are always welcome.




  • Thebestplacehere Level 3 Level 3 (705 points)

    I suppose that as it say is deleting,may it already delete and it doesn"t happen again.What i don't understand if that if you didn't ask to do that why is doing it.

    I don't know what to advice,just be sure you have the last mail version and cross fingers to don't happen again.

  • benomatis Level 1 Level 1 (5 points)

    It's still happening time to time, the way I work around it is that I always have the activity monitor open and when shutting off, if I have pending activities, I click the red octagon which will cancel them, so the system can shut down. Not ideal, but apparently have no other choice...

  • tomasczt Level 1 Level 1 (10 points)

    This solved it for me. (I have no idea why it works)


    1. From the Apple menu bar, select "Mail" then "Preferences"
    2. Select "Accounts"
    3. You should see each of your email accounts that you use Mail for listed individually and will need to take the remaining steps for each one listed.
    4. Select your email account in the left window, and notice the last item on the screen in the right window is the TLS Certificate
    5. Click on the selector next to "TLS Certificate:"
    6. Choose the "com.apple.idms.appleid.prd.xxxx" listing instead of "None"
    7. Quit Mail


    After doing the above, the next time I had Mail open and selected "Shut Down..." while it was opened, it shut down without the shutdown being cancelled by Mail. As this has worked now three days in a row, I'm calling it solved.


    I hope if works for you as well

  • MacSavvyIT Level 1 Level 1 (0 points)

    Selecting the TLS Certificates: com.apple.idms.appleid.prd.xxxx"

    solved the issue for me... for now. I will write back if something changes because with this Mavericks "Upgrade" I have seen other problems resurrect themselves.

  • MacSavvyIT Level 1 Level 1 (0 points)

    I guess Apple only allows a limited time to edit your posts before you have to start a new one or reply to yourself. Oh well, stupid is as stupid does.


    As expected, the behaviour returned. The problem started to return gradually. First, there would be a delay until quit. Now, Mail refuses to quit at all. I won't try force quitting yet.


    There is no activity in the activity viewer. Connection doctor declares that all is well and the Force Quit window finds Mail responsive.


    Going to Activity Monitor shows three processes, one duplicated. They are:



    Mail Web Content (times 2)



    Mail and com.apple.MailServiceAgent are the two processes that were hard to quit and needed a kill signal. (Yes, I could have Force Quit, Comm-Opt.-ESC and that may have worked but it would have hidden from me which process was failing.)


    So, I relaunch Mail and only two processes show up. Mail & Mail Web Content. And Mail is working like a charm and quits, albeit a bit slowly. So, I launch again and watch the activity viewer. After a while, a duplicate of the Mail Web Content process shows up in the Activity Monitor (not to be confused with Mail's activity viewer.) running as a seperate, sequentially numbered process.


    Then I try to send a message, that's when the com.apple.MailServiceAgent shows up. That works. So, I try quitting again (exactly when no activity is showing.) and the delete activities appear and slow things down but eventually, Mail quits.


    There are two accounts, in my case, an iCloud account and a third Party Domain. It's the iCloud account that seems to be slowing things down when you watch the activity viewer. I can disable the third party account and see the same problems.


    com.apple.MailServiceAgent stays active after Mail quits.


    So, that's what I know. It's working again, albeit slow to quit. I bet if I leave the MBP running for a day or two and sleep it each night, this problem will have resurfaced.


    The sad part is that I have diligently looked everywhere to see what's going on and while I can point to the two processes that needed killing, I don't have a solution and I don't know why they only need to be killed sometimes.

  • Andrew J. Level 1 Level 1 (80 points)

    Hope this still helps in 2014