script to re-download imap mail message?

I’m running latest version of mail and snow leopard.
i connect to gmail using IMAP on my mac and my iphone 3GS.
the iphone i dont have problems…but the mac is an endless nightmare.

i have lots of folders (gmail tags).
and some of those folders have folders inside them as well…

I have mail setup to download and keep all messages and attachments for offline viewing.
incoming messages come into the inbox OK.
i read the messages, and then file the messages accordingly into folders (sometimes copying a single message to multiple folders).

later…when i go into one of the folders to check an old message, sometimes the message was corrupted or garbled. So i had to go into my library (via finder) and find message, delete message, quit mail, restart mail, reselect message, and it will then redownload message correctly.

This is understandable if its once in a blue moon. HOWEVER…this is happening all the time now. Im finding tons of old messages that have become garbled. its very tiresome to search all my folders and messages in finder and run through that process.

is there any applescript or right-click context menu i can add to automate the process on the selected message?
I’d be willing to pay a few bucks to a kind soul to help write something for me if it hasnt been done yet…

Hello

What you have to investigate for starters is why your messages get garbled.
It is no point of curing the symptoms and let the problem go free.

I haven’t had this problem, so I honestly doesn’t know what I’m speaking about.
Your first step would be to backup your Mail every time you know it is in a sound state.
A second step to check the sanity of your system:

Do you run disk utility often. 
Have you really maintained your system lateley, using a free tool like Onyx and cleaned everything?
You got no rights problems? Have you checked the Console log for errors regarding Mail.app?

A third step would be to research what causes the corruption of email in Mail app

By some intensive googling and searching in the various User groups and mailing lists.
Maybe you can find an answer there to why your mail gets corrupted, which is the really interesting
thing. Preferably with a solution on have to avoid it.

Maybe a solution to your problem can be found at gmail itself.

When you have done this please either come back with your solution, or your explanation of the problem
and we might take it from there. You should be totally specific of what it is that gets garbled (headers, message or attachment.) Other thing to both specify and google for is what if any plugins/addons you use.

Consider googling any problems with Iphone and mail as well, it could be a kind of collateral damage by some freak accident from all what I know.

Good luck and good hunt

McUsr

thanks for the thoughts…

actually, i have had this problem for a long time, and have researched for many many months, without any answers. i have also posted this question on countless gmail forums, apple forums, general computer forums, misc forums. no one has had an answer or solution on how to solve…or what the cause is.

the closest thing anyone has been able to determine is that it “”“”“”“might”“”“”“”" be due to the numerous folders or levels of folders. However this i can not change, as it is necessary for my work organization.

i do not have any plugins/add-ons installed.
my system is kept up to date.
i run onyx, and disk utility twice a month, alternating each week.

i have 2 gmail accounts…
1 is my personal account with a handful of folders (1 level deep), and i never have any problems.
It is only my work account that has lots of folders that is causing problems. it appears like once i move a message into a folder, then click on folder, then click on message…it appears like it tries re-downloading the message but fails. the entire message/headers/etc all turn to garbled text. attachments become garbled text as well.

so…i appreciate your thoughts on finding a cause…but after months and months of searching…i’d rather have some level of correction in place to make my life easier while i wait for a solution to come about.

so…back to topic…anyone have a script or able to write me a script that would redownload the message?

Hello

I have read your post.

I’m sorry to hear about your problems.

I’ll think about this and come back to you tomorrow.
But I don’t promise anything

Best Regards

McUsr

Hello.

I hope you file this as a bug with Apple.

Have you considered switching to another email client? Like Thunderbird or Entourage?
This shouldn’t lead to any problems as long as you access the gmail from both your iPhone and Mail.app.

Some things of all the things I gotta know If we don’t end up with a solution that doesn’t require scripting.

Do you sync your Mail on the mac with iPhone or via Gmail?

How do you get a message to be re-downloaded after you have deleted it?

How are your mailboxes stored? Are they stored in a local structure on your disk, or under your accounts.
(If I were a better I’d bet that they are laying under the accounts.)

Best Regards

McUsr

Hello.

Today I received this link to an ongoing discussion about email at Lifehacker via Newshound. Maybe someone there could help you with your problem.

Best Regards

McUsr

sry for late reply, was out of town for a bit…

Have filed this bug several times…no feedback…

Have tried Entourage, but its slow as molasses. Thunderbird is better, but has several functions that I don’t play nicely with, and always make mistakes on my emails. I’d really prefer to use Mail.app, if it weren’t for this one problem. Hence why instead of waiting on apple I would like to get a script going.

I dont sync my mac and iphone for mail (in itunes settings). instead i just use gmail IMAP to sync for each separately.

Once i find the message in Finder by manually browsing to see a garbled message file, I then simply delete the file, and relaunch Mail. Then i select the message in Mail, and it will recache the message OK this time.

Im not sure I understand this question. My accounts are setup however Mail sets them up. I just added accounts to my Mail application in the accounts setting page as normal, and then started using it. I have not moved where Mail saves files, and have everything on a local internal HDD on my MBP.

so…I’m still actively interested in a script.
anyone able to write this for me for a few bucks?

Hello.

You know I really looked at this as a solved problem by know.

I’ll help you if can. I remember from last time in this thread that I wondered about how deep the nesting of your mailboxes go. and if you maybe you could flatten the structure a bit by say mesh together all mailboxes that have say only one or two “sub mailboxes”.

I also wonder if you have contacted people behind software like MailActOn, maybe the have cooked in some solutions for problems like yours silently. Stuff like MailActOn comes with a price tag, but I you can regard yourself as a professional Mail user. (That being said, I have no idea wether Mail acton fits the bill or not).

The damage you experience can also be some kind of “collateral”, Have you got a nice an clean Console log, without very many messages about DYLD memory conflicts, incompatibilities and such. You should really strive for having an as clean log as possible.

I’ll come back to you and look at it in the degree that I can, but you should really post your problem in MacOsx hints,
MacRumours, Apple forums - everywhere.

Best Regards.

McUsr