The cat's mustaches — Mail issues

by Francois Joseph de Kermadec



The problem



Mail, also called "Mail viewer" (by developers) and Mail.app (by uh... many people including myself) is a wonderful little application on which many of us rely for our daily workflow. Mail 2.0, included in Tiger, is a big step forward from the previous versions and its many new features have been acclaimed by heavy users — including its new found love for search capabilities.



For some users, however, the upgrade hasn't gone as smoothly as they hoped: seemingly lost mails, crashes and the inability to send or retrieve messages have lead them to think that Mail was no longer to be trusted. Luckily, the solution is usually one little step away.



The solution



In issues like these, there are often as many solutions as there are causes — pretty precise, uh? Generally speaking, though, the best way to start is to ask yourself what could potentially interfere with Mail, which includes haxies, bundles, services and enhancers of any kind. Should you have any applications of this kind running, you might want to follow these steps:




  1. Quit or force-quit Mail, keeping in mind that force quitting it might cause some settings to be lost and could leave your mailbox indexes in a somewhat unstable state — Mail sometimes takes a long time to quit if you interrupt it in the middle of a server-related process, in which case patiently waiting is the best policy. Then, immediately backup your "Mail" folder, located in your "Library" folder.


  2. Perform your

    regular maintenance

    steps, in order to ensure that no minor disk issue or permissions problem could interfere with your work. Sure, permissions issues have almost no chance to be, by themselves, the cause of a Mail problem but, as we are dealing with third-party installers here, it is better to be on the safe side.


  3. Navigate to your various "Library/Mail" folders and remove any folders called "Bundles". "Bundles" are commonly used third-party "hacks" that add functionality to Mail and, since the application first appeared, enjoy some kind of love-hate relationship with it -- everybody knows they exist and work but nobody really says so officially.


  4. Navigate to your various "Library/Services" folders and temporarily remove any third-party components you might see here. As services are constantly available from within your applications, a misbehaving service can cause unexpected trouble.


  5. If all this remains ineffective, you can delete (at a later time) your various "Library/Caches/Mail" folders.


  6. Update your Mac in order to ensure that you are using the latest available version of Mac OS X. Mac OS X v. 10.4.1, for example, improves Mail's handling of misbehaving add-ons and plug-ins.



Once this is done, simply relaunch Mail and select your mailboxes one by one in the left hand side. For each one, use the "Rebuild" command of the "Mailbox" menu, which will force Mail to purge and re-create the indexes it keeps for the mailbox. Damaged indexes can lead to strange symptoms like "ghost" messages, messages that do not appear or general sluggishness — and while you are at it, try to delete as many attachments as you can (mail servers hate attachments) and ensure that you have purged any deleted messages from any POP server you might have.



Keep in mind that some of your accounts (such as Hotmail accounts) that are not natively managed by Mail and require third-party plug-ins might no longer work since the corresponding files have been removed. In that case, simply ask the developers whether an updated version is available and install it with caution. The best policy, of course, is to avoid these accounts or set them to "forward" any mail to an account you can check through officially supported standard methods but one does not always have the choice.



Should you have had issues with importing messages from your old installation, you can use the "Import Mailboxes…" menu item of the "File" menu in order to force the re-import of any potentially misbehaving mailboxes.



As you can see, these steps are pretty straightforward and basic. They should however help you work around most Mail-related issues and allow you to enjoy that great little application!




Have you found other troubleshooting techniques for Mail?


4 Comments

Sjakelien
2005-05-17 11:31:41
Mail's Applescript crippled
This is not really a troubleshooting hint, but rather a question. Please delete if not wanted.
For 10.3 I wrote this little Applescript:
If Mail.app would receive a message from my phone provider that contained a voice mail (the so-called "VoicemailInEmail" functionality) it would:
1) Read the subject of the message (e.g. "You have a voicemail from 0205159695")
2) Lookup the phone number in Addressbook
3) Take the associated name from the Addressbook
4) Change the sender (my provider) into the name associted with the number.
In this way I could easily see who had left a voice message, and I could sort these message by sender, etc. I was very proud of myself, until Tiger broke this script.
I've been looking at the new Applescript implementation of Mail, but I haven't found a way to change subject or sender by means of a script.
I hope that someone is a bit smarter than me. Please find below the Script, and help me to make it work again!
on perform_mail_action(info)
tell application "Mail"
set selectedMessages to |SelectedMessages| of info
repeat with eachMessage in selectedMessages

set theSubject to subject of eachMessage
set TotalNumber to number of characters of word 5 of theSubject as integer
set StartNumber to TotalNumber - 6 as integer
set WhatNumber to characters StartNumber thru TotalNumber of word 5 of theSubject as string

tell application "Address Book"
repeat with thePerson in the people
set theNumber to value of phone of thePerson as string
if theNumber contains WhatNumber then
set theName to name of thePerson as string
--else
--set theName to WhatNumber
end if
end repeat
end tell


set TheBody to content of eachMessage
set subject of eachMessage to word 23 of TheBody & " seconden"
set sender of eachMessage to theName


end repeat
end tell
end perform_mail_action


Thanks
sjakelien@spymac.com

F.J.
2005-05-18 10:41:07
Mail's Applescript crippled
Hi!


First of all, congratulations on writing such a script and thank you for taking the time to write, I really do appreciate it! :^)


I guess a way to achieve what you want would be to forward the message to yourself, setting the sender as the person you wish, thanks to a "make new outgoing message" handler like this one:


set newMessage to make new outgoing message with properties {visible:true, content:theSource, sender:"Jane Doe ", subject:"You got a call, Jane!", message signature:""}


Have you tried posting on the Apple Discussions? You should find an active community of AppleScript users who will be able to assist you in the writing of this new script!


Let me know if this helps!


FJ

Nix
2005-05-25 23:54:36
Troubleshooting Mail
I've been helping a few users with Mail problems recently. They were having trouble deleting messages. I told them part of the problem was the number of gigantic messages they had.


"Your Inbox is nearly 2GB. There are over 7,000 messages and several messages that are each bigger than 100MB. I think that last 175MB message was what pushed it over the edge." It's surprising how many people don't ever delete any email messages. Not even viagara spam.


I don't think it's unreasonable that Mail.app faulters. I try to open the text file at the heart of the mailbox with TextEdit. There's just no guessing how long it might take to open a 2GB text file. 10 minutes pass. TextEdit appears to have hung up, the Finder appears to crash and recover, and I quickly get bored. It's still anyone's guess. That was Panther Mail.app.


Now what about *Tiger* Mail.app?
I can't find any way a user can display the size of a POP Mailbox. That seems to have disappeared in Tiger Mail. Get Info just tells me about the server. And there's no indication of the number of messages per mailbox either. Turning on the Size column doesn't also turn on the Size status messages.


I can't educate users (who can't tell the difference between a KB and a GB) if all the indicators have been removed. I feel like a speed cop in a town where the speedometers have been removed from all of the cars and the drivers are weaselled on amphetamenes and coke.


"You were going Mach II in a 30mph zone."
"Is that fast?"
"It's twice the speed of sound."
"?!?"
"Faster than a jet."
"Oh. That's not so fast is it?"


Never mind. People will use their email until it breaks. Then I'll fix it. We won't talk about why it broke, or how to avoid breaking it if there's no way of measuring. In any case, it's not just Mail.app - it's email. Someone's going have to redesign it from scratch because it doesn't look like it's going to last long once we start using it to file share 1GB files. And we *will* do that. There's no stopping us. Put us in a group and we're crazy.

F.J.
2005-05-26 02:51:36
Troubleshooting Mail
Hi!


First of all, thank you very much for taking the time to write and for sharing these experiences with us! :^)


The new Tiger mail now creates one individual file per message, in each mailbox folder, meaning that corruption issues are a lot less likely, even at the mailbox level.


Mail Help should provide you with tips on how to calculate and display the size of mailboxes. It is true that this information is less prominently displayed than it used to be.


About managing the flow of e-mail, would company policies allow you to install a system like Zoe? That way, users would automatically have archives of their mails available but could be instructed to not keep everything on their computers…


FJ