IMAP: copying messages and flags

Hello!
Can anybody help me? I write a webmail application using JavaMail, and need to move messages to another folder (e.g to Trash). I move messages like that:
source.copyMessages(messages, dest);
but new messages have no flags (Messages in source folders were SEEN, ANSERED...) I am ready to iterate through all moved messages in dest folder, but I have no idea about new messages indentifiers As far as I know, message numbes and uids are folder-specific, so new messages (in new folder) have different identifiers.
Can anybody help me how to recognize "my" messages in new folder? Or, even better, how to move messages WITH their flags?
Thanks in advance,
Wawrzek

I'm using Mail 2.1 (752/752.2) talking to a Cyrus IMAP server running on the same machine. Messages are kept on the server. I have a GnuPG mail plugin. Ever since the last update of Mail I've had the problem of random "read" messages returning to the "unread" state, and not just in INBOX, but in other folders, all on the server. I've read them, did "Synchronize" and they soon show up as "unread" again. I've read them, quit Mail, restarted Mail, and they are "unread" again. Sounds like what other people are seeing.
So I wrote a program that talks directly to the IMAP server to see what it thinks about the "read" status. Sure enough, messages that have a sitcky "unread" state do not have the IMAP "\Seen" flag set. In other words Mail is not setting this flag for some reason. (I've check this several times, before and after Mail is supposed to mark a message "read," after quiting Mail, etc., and the "\Seen" flag is never set.)
If I use my prober program to manually set the "\Seen" flag on a message, then it stays "read." That message never again pops to the the "unread" state; however, random new messages get stuck in the "unread" state. So far the only way I have been able to mark these sticky messages as "read" is to talk directly to the IMAP server.
I believe this strongly indicates the problem lies in Mail itself and not the IMAP server. I believe there was some regression with this new version of Mail because I've never had the problem before. To conclusively prove Mail is at fault, though, I would have to eavesdrop on the communication between Mail and IMAP.
--Mike Zuhl

Similar Messages

  • Gmail IMAP "Copying message" feedback loop

    Yesterday I sent an email with 10mbs of attachments from mail.app through gmail imap. after the message sent, I noticed that the spinning icon next to the gmail inbox was perpetually spinning. in the 'activity' window, it says:
    Gmail Synchronizing with server
    copying message
    I figured mail.app and gmail were synchronizing the email. so i let the process go for a few hours yesterday, when I noticed that no new email had come in via gmail, so i checked the account through the web browser. sure enough to find new email, but nothing coming through to mail.app. so i cancelled the process and but the activity status just said "STOPPING: copying message" and didn't go away. So I restarted mail.app. as soon as mail.app was back up and running, the "copying message" status reappeared.
    Last night, I let the operation go throughout the night, to wake up this morning with nothing changed. So this morning I checked my "recovered messages (Gmail).mobx" folder to see several 345mb message files. I removed the whole "recovered messages (Gmail).mobx" folder to the desktop and restarted mail.app but I still have the same error.
    Incidentals:
    The original message with the 10mbs of attachments was a series of 47 photos. Originally, I had dragged full res photos(6-7mbs/photo) into a mail.app message and chose "medium" from the "image size" pop-up at the bottom pane of the message.
    My theory is that in between placing the photos in the message and mail.app resizing them, mail.app and gmail tried to save a draft of the message to the server with all the photos at their original size (they might have been somewhere around that 345mb mark). And somehow mail.app is freaking out continually trying to upload a draft of the message with 345mbs of attachments. just a theory.
    how do i get mail.app and gmail imap out this weird feedback loop?
    Message was edited by: Ed Fladung

    I had the same problem myself, except that the message contained over 200 pictures. The actual email was only 7MB, but Mail must have decided to create a draft before it resized the pictures. I only noticed the problem after Mail had consumed over 1.5GB of my limited bandwidth and was taking up almost 4GB in RAM, and a lot more in swap. The solution here worked, but it's unfortunate that I needed it at all. Why would I ever want Mail to upload attached photos to an IMAP server at their original size, especially after the final version of the email with resized photos has already been sent? This NEEDS to be fixed, since it could be a huge problem for someone who is less computer savvy.

  • IMAP Deleted Messages AND Unread Messages

    I've read quite a few threads about two seemingly persistent problems using Mail and IMAP servers: a) Messages deleted within Mail "reappear" in the client's in-box, and b) messages read (and marked as read -- no blue dot) "reappear" as unread messages (this latter problem occurs for me, even if moved to a folder on my IMAP account). I have to admit that I've gotten lost in the twists and turns of these discussions and I'm reluctant to start trying things that may make matters worse.
    I've tried to extract the right things to do here -- and, so far, only have checked that I am indeed saving deleted messages on the server.
    May I ask: In summary terms, are there a few standard fixes for making deleted messages go away and read messages stay that way? Thanks!!
    PB 12"   Mac OS X (10.4.7)  

    I'm using Mail 2.1 (752/752.2) talking to a Cyrus IMAP server running on the same machine. Messages are kept on the server. I have a GnuPG mail plugin. Ever since the last update of Mail I've had the problem of random "read" messages returning to the "unread" state, and not just in INBOX, but in other folders, all on the server. I've read them, did "Synchronize" and they soon show up as "unread" again. I've read them, quit Mail, restarted Mail, and they are "unread" again. Sounds like what other people are seeing.
    So I wrote a program that talks directly to the IMAP server to see what it thinks about the "read" status. Sure enough, messages that have a sitcky "unread" state do not have the IMAP "\Seen" flag set. In other words Mail is not setting this flag for some reason. (I've check this several times, before and after Mail is supposed to mark a message "read," after quiting Mail, etc., and the "\Seen" flag is never set.)
    If I use my prober program to manually set the "\Seen" flag on a message, then it stays "read." That message never again pops to the the "unread" state; however, random new messages get stuck in the "unread" state. So far the only way I have been able to mark these sticky messages as "read" is to talk directly to the IMAP server.
    I believe this strongly indicates the problem lies in Mail itself and not the IMAP server. I believe there was some regression with this new version of Mail because I've never had the problem before. To conclusively prove Mail is at fault, though, I would have to eavesdrop on the communication between Mail and IMAP.
    --Mike Zuhl

  • Mail 3, smtp, IMAP: sent messages are not saved on server

    Hello,
    I had problems using Mail 3 after I upgraded to Leopard, so I used Thunderbird for the time being. With the update 10.5.1 I tried again: most problems solved BUT: sent messages are not saved on the server in mailbox "Sent".
    Some background: I deleted the folder "<User>/Library/Mail" and "<User>/Library/Preferences/com.apple.mail.plist" and configured Mail from scratch.
    To be sure: I still have Thunderbird installed, and when I send with Thunderbird: a copy is placed in "Sent".
    Another thing I noticed: it takes more than a minute to send from Mail 3 and a few seconds when I send from Thunderbird. I have another Macbook Pro with 10.5.0 installed: same problem with sending.
    Any help is appreciated.
    rene

    Well, be stumped I did all that, but to be sure, I did it again:
    I have a lot folders with subfolders and they are shown under my account name.
    I created a new folder "test" in my IMAP account and designated it to be the new "Sent" folder. It replaces my previous Sent folder in the group Inbox, Drafts, Trash. My previous Sent folder now appears under my account name as a "normal" folder.
    I send a message and the Activity monitor says: +"Delivering message: copying message"+. After a minute Mail is done. I check my (new) "Sent" folder and it's empty. I double check in webmail: it's empty.
    So I go to the Finder and look in my IMAP folder: <user>/Library/Mail/<IMAP-account>/test.imapmbox and there is no folder "Messages", only Info.plist.
    Then I try to move a message to the "Sent' folder: for a minute the Activity moinor says: Copying messages: copying message" and then Mail prompts: +"The message "testing" could not be+
    +The connection to the server mail.hicetnunc.nl on port 143 timed out"+.
    So it looks like Mail has a problem with the default "Sent" folder: it cannot copy messages to that folder at all! Aha!
    But then I try to move a message to a "normal" IMAP folder: same thing! Mail cannot copy to any folder!
    In both instances Mail says: +"The message "..." could not be be moved to the mailbox "..."+
    +The connection to the server mail.hicetnunc.nl on port 143 timed out"+
    Last thing: I try to move a message to a folder in the same account again. But in the process I quit Mail. I open Mail again and Mail is performing pending operations: copying message. After a while Mail prompts: +"Operation could not be completed. (MFMessageErrorDomain error 1028.)"+ and crashes... I open Mail again and it tries to peform pending operations. Again: an error message and Mail crashes. This keeps going on so I delete the whole account and set it up again. Nothing's changed...
    I can receive and send, but sent messages are not copied to the "Sent" folder and I cannot move messages around within a IMAP account. But TADA!!!: I can move messages from account to account.

  • Can I copy messages between a POP and an IMAP account?

    Yesterday in helping me get access to my mail customer service at my ISP [AT&T] created a new account. Subsequently, when I deleted the old account, I lost all the messages in my Inbox and Sent folder. I did not realize when the new account was being created that it's an IMAP account. In the past AT&T mail accounts have been  POP accounts.
    I have a Time Machine. I restored the /Library/Mail folder from a time immediately preceding creation of the new account. I thought I would simply copy the older Inbox and Sent folder into the new /Library/Mail folder. but I noticed that the IMAP and POP folders are structered differently. I have tried copying messages files from the POP account folders into the corresponding IMAP folders, but they still are not showing up in the Inbox and Sent folders.
    Is there a way to solve this problem---to get the missing messages from the POP account to the IMAP account?
    Thanks,

    Format the external drive as FAT32 or ExFAT. Both computers will then be able to read and write to it.

  • HT1277 Hi there,  From time to time all inbox messages just disappear.  Just then they disappeared when I  clicked on " get mail".  Yesterday they js=ust vanished?  Please help.  I have set up as Imap on laptop and iphone.

    HI,
    I have just set up mail and every now and then the entire inbox just vanishes.   This has happened 3 times in 2 days???  Any thoughts? 

    Mac HD says 2.49.72GB and 151.88 used??
    That's impossible. I think you mean to say that your HD capacity is 249.72 GB, and you've used 151.88 GB. You do have enough free space, so that means something else is going on to cause this problem.
    Aside from setting up the Gmail account(s), did you install or update anything just prior to this problem starting? If so, what were those items?
    I didn't mention any extension, so I'm assuming you're referring to seventy one's mention of TM (Time Machine). That is a built-in backup method that you can choose to take advantage of, but I would not do it, since it's not all it's cracked up to be. What you need is to setup and maintain every day a bootable backup of your entire hard drive. You can do that with SuperDuper or Carbon Copy Cloner. You don't need an Airport device for these, nor Time Machine; in fact, I would shy away from using wireless for such things, as it's often more of a problem than a benefit.
    Also, there may be problems with your hard drive, so I would boot your Mac from the install disc, choose your language, then wait about 15 seconds for the menu bar at the top to appear and choose Utilities->Disk Utility and Repair Disk. If it comes back with any errors that can't be fixed, post them in your reply. But if not, then run Repair Permissions, and all you need to concern yourself with is the message at the end that 'Permission repair completed'; ignore anything else as long as you see that message.
    Then reboot your system and restart Mail and setup your account(s) again (assuming it's not there because you deleted the IMAP mail folder and the Envelope Index file. In the future, don't throw things away unless you know the consequences of doing so; you'll end up being unfortunately surprised when you lose critical information.

  • No Syncing of Flagged Messages and Read Messages??

    I use Mail to connect to several POP email accounts, where I also have several Smart Email Boxes setup. The message flags don't seem to be synced across the two computers. For example, if I flag a message on the G5 then sync it, my mini won't show the message as flagged when I sync on the mini.
    ...same goes for read messages. Even when my messages are read on my G5, they all appear as unread when I sync up on the mini. This has been a hassle, as I have to spend time flagging messages on each computer, and remembering which ones I have read previously.
    Any suggestions? (would be so greatly appreciated).
    Andy T.

    .Mac Sync does not synchronize mailbox content, which is what you appear to be expecting it to do. POP3 mailboxes aren't designed to be synchronized - you need to take a look at IMAP technology if you want your mail to be synchronized.
    See these documents:
    http://docs.info.apple.com/article.html?path=Mail/2.0/en/ml944.html and
    http://docs.info.apple.com/article.html?artnum=25275

  • Can you copy/paste files from the Finder to Mail in Lion, or drag them onto the Mail icon in the Dock to create a new message and attach the files to it?

    Message title says it: Can you copy/paste files from the Finder to Mail in Lion, or drag them onto the Mail icon in the Dock to create a new message and attach the files to it?
    I can't find anything in the Knowledge Base that says these two options no longer work or still do.
    I do not have a system capable of running Lion, but I need to know the answer nonetheless.

    Gee, I don't know: "paste attachments mail Lion"? ;-)
    One further question, if I may: in Panther (which is where I've aggregated nearly 7 years of mail), if you copy more than one file in the Finder, switch to Mail, and paste the files into a new message, only the file names paste in. If you copy one file and paste it into a Mail message, you get the file, not just the name. Is that still true, or has that (IMHO) bug been fixed since 10.3.9?

  • I copied message to SMS field and sent. After that the message still exist all the time in the SMS field. When I open the application I must always first delete the "saved"  ones before I write the new one. What to do to finally/definitely delete the save

    I copied message to SMS field and sent. After that the message still exist all the time in the SMS field. When I open the application I must always first delete the “saved”  ones before I write the new one. What to do to finally/definitely delete the save message?

    sorry it's ios6

  • I cannot install a previously purchased version of acrobat 9 pro downloaded from the site.  Returns message at final install steps "invalid serial number." I had copied it and pasted it directly from "My Adobe".  What to do?

    I cannot install a previously purchased version of acrobat 9 pro downloaded from the site.  Returns message at final install steps "invalid serial number." I had copied it and pasted it directly from "My Adobe".  What to do?

    Hi hgratz,
    Considering 'invalid serial number' error for Acrobat 9, I would suggest you to please refer the KB doc link mentioned below:
    Error "Invalid serial number" | Acrobat 9 | CS4
    Let me know if that helps.
    Regards,
    Anubha

  • How do i copy a thread in text messages and copy into a note pad app?

    how do i copy a thread in text messages and copy into a note pad app?

    Tap and hold a bubble, and select More. Put a checkmark beside each bubble you want to copy, then hit the arrow at bottom right. This will open a new message with the copied text in the text entry box. You can copy all of this and paste into Notes, but you lose who it came from unless you edit that in yourself.
    You can also take screenshots of each window of text bubbles.

  • How do I copy messages in a Mail folder to a flash drive?  Drag and drop is not working.

    How do I copy messages in a Mail folder to a flash drive?  Drag and drop is not working!

    Try doing a save as to the desktop and then try dragging thr .rtf file to the usb drive

  • When I copy an email message and paste it into a document, the font turns into all symbols.  What's the problem here?

    When I copy an email message and paste it into a document, the font becomes all symbols. What is wrong?

    To use images from the media browser, you must generate previews of the images first. It sounds like the "automatically generate previews for every new project" is turned off under Aperture >Preferences>Previews. To generate a preview for a photo to use in the media browser, right click it and select "update preview". The quality of the preview photo is determined by the settings in the Previews tab found under the Aperture>Preferences menu.

  • HT1539 I have tried to download a digital copy that came with a movie I purchased and I keep getting the an error about HD purchase vs. SD purchase.  I push redeem again and it has the same message and I cant download the movie.  What can I do?

    I have tried to download a digital copy that came with a movie I purchased and I keep getting the an error about HD purchase vs. SD purchase.  I push redeem again and it has the same message and I cant download the movie.  What can I do?

    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsync all music and resync
    - Restore from backup. See:                                 
    iOS: How to back up           
    - Restore to factory settings/new iOS device.

  • Why do I have so many flagged messages and how do I unflagging and delete them

    My mail app lists over 60k flagged messages, but when I click flagged messages, the list is empty. When I check for memory usage, mail comes up as 11 gb, even after a delete all the messages I can see. How do I delete/unflag messages, and how do they get flagged in the first place?

    There are two possible fixes in this discussion. Delete and add the account back on, or go to the InBox, Tap Edit, and Flag all emails and then unflag them all.
    https://discussions.apple.com/message/23111989#23111989

Maybe you are looking for