Folder problems in Mail

A friend, whose PC runs Windows XP, has recently purchased an iPad. Being new to iOS he has had various problems working his iPad most of which I have been able to solve. However  - as a long-term iMac user - I have been unable to help with his problems with Mail as I'm insufficiently familiar with Outlook and Windows XP. I'd be grateful if any iPad and Windows users out there could suggest a solution to his problems quoted below
'If open on comp - not open on pad.
How to make files in Inbox and how to save msgs to such files
Some old incoming and outgoing mail from before bought pad appears in Draft file
Sent file seems ok but only from pad. Cant see msgs sent fm comp. Thought they were supposed to be' syncd.
Under heading
INBOXES - there are there subheadings viz - All, iCloud and Alice but none of these list any files
Below them is another heading ACCOUNTS which lists
I cloud which then lists Inbox, drafts, sent, trash, archive, junk - all empty
And ALICE [his ISP] which takes me back to INBOXES.
If u can come up with any solutions I would be grateful."

Thanks J,
It worked! Would you be able to say if any emails flagged as Junk until now (i.e. before this folder was created) would be actually stored somewhere?
Thanks!
Calx

Similar Messages

  • Hi I am having problems removing mail from trash folder. Can anyone help please

    Hi I am having problems removing mail from trash folder. I can send mails to the folder but cannot delete them permanently from the trash folder. I am using Iphone 3G and anm up to date with OS. Can anyone help please

    Check that there isn't a different Trash folder to the one with the proper Trash symbol on it.
    If you see one in your list of folders rather than a separate one, highlight it, then click on Mailbox...Use this mailbox for...Trash

  • I am having a problem with mail. In my junk mail folder I have two messages which I drag to trash and empty. Within a few minutes the messages are back in junk mail folder

    I am having a problem with mail.  I am attempting to trash junk mail. Each time I do this and a while later I find the junk mail has not been discarded and is back in junk mil folder.

    Hi tony paine,
    Welcome to the Support Communities!
    The article below may be able to help you with this.
    Click on the link to see more details and screenshots. 
    iCloud: Keeping the Junk folder consistent between iCloud Mail and OS X Mail
    http://support.apple.com/kb/HT4911
    Cheers,
    - Judy

  • Mail folder problem

    I just encountered a problem, where I changed the name of a mail sub-folder, thereby loosing all contained e-mails in the folder. This is obviously a problem in Mail.
    OK, I moved up one step to the parent folder, entered time machine, went back a couple of hours and found my lost e-mails. Marked them (about ten e-mails in all) and hit restore.
    Then everything froze, dead. Could not find any better idea than power off.

    One thing that may help is to go to Mail Preferences, Accounts, and in your account under the Advanced tab select the check box for "Prompt me to skip messages over xxx kB" (where you indicate how many kB). This can reduce the download times by factors of 2 to 4 or more, depending on the size of the attachments.
    I think the more specific control you are looking for that is analogous to what you can do on the iPhone and iPad might not be available on the computer versions of Mail.
    Edit added: I just noticed that the above option is only available for POP accounts, but not for Exchange (IMAP) accounts, so unfortunately it may not apply to your account.
    Message was edited by: steve626

  • How to avoid messages going automatically to the archive folder in Apple Mail?

    Dear list members, I've been using Apple Mail (version 7.3 (1878.6)) on my MacBook Pro 13" (9,2) (MacOS 10.9.4) for years to integrate my GMail, university, and other e-mail accounts in the imap mode. Since some weeks, Mail is behaving odd: some messages are sent automatically to the archive folder. That's quite annoying, as I have to move them manually back to the inbox folder, and sometimes I mess some messages. I did not change any config in Apple Mail or my e-mails servers. Could you please help me solve this problem? Thanks.

    The Archive folder in Apple Mail is linked to the All Mail "label" in Gmail. A label is treated like an IMAP folder, but it really isn't the same thing.
    In case you weren't aware, Gmail saves every email you send or receive inside the All Mail label. In Gmail, you can tag a file with multiple labels. So, a file that comes into Gmail appears in two places at once, the Inbox and All Mail. When you trash a file, the Inbox label is removed, but it still remains in All Mail.
    Previously, the All Mail label was hidden from you in Mail. Apple has been trying to make Mail work with Gmail, but that hasn't been going well.
    I have never had a problem, but I have both Gmail and Apple Mail set up such that any email I trash actually gets deleted and not stored on the Gmail server. I also have it set to no display the All Mail folder at all.  This may not be a fix as others have similar setups, but have problems with Gmail.
    This is how I set it up. I followed the original article, not the Part Deux article. However, you don't need to change the IMAP path prefixes or the label names in Gmail settings. I just have the part where I configured it to delete the emails when I trash them, and hid all the Labels I didn't care to see in IMAP.
    Remember, this may not resolve your problems. I don't know of another "fix."

  • Since installing mountain lion i have a problem with mail. when i delete a message close  and open mail the message has come back. please help!

    Since installing Mountain Lion i have a problem with Mail. I delete a number of messages from the same person but keep the newest message in my Inbox. I actually delete them from the Trash. The next time i open Mail the deleted messages are back again. Can anybody please help as this is getting annoying. Thanks in Anticipation.

    Problems such as yours are sometimes caused by files that should belong to you but are locked or have wrong permissions. This procedure will check for such files. It makes no changes and therefore will not, in itself, solve your problem.
    First, empty the Trash.
    Triple-click the line below to select it, then copy the selected text to the Clipboard (command-C):
    find ~ $TMPDIR.. \( -flags +sappnd,schg,uappnd,uchg -o ! -user $UID -o ! -perm -600 -o -acl \) 2> /dev/null | wc -l
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). The command may take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear.
    The output of this command, on a line directly below what you entered, will be a number such as "41." Please post it in a reply.

  • On 10.4.11 Mac Mail I get this: Mail cannot update your mailboxes because your home directory is full. You must free up space in your home folder before using Mail. Delete unnedded documents or move documents to another volume. I can't open mail.

    On 10.4.11 iMac Mac Mail I get this message: "Mail cannot update your mailboxes because your home directory is full. You must free up space in your home folder before using Mail. Delete unneeded documents or move documents to another volume." I can't open mail to do this. I have reinstalled software but no effect. How do I get into Mail to delete?

    Found this on the "more like this" Worked like a charm!
    With the Mail.app quit and using the Finder, go to Home > Library > Mail. Copy the Mail folder and place the copy on the Desktop for backup purposes.
    Go to Home > Library > Mail > Envelope Index. Move the Envelope Index file to the Desktop.
    Launch Mail and you will be prompted to import mailboxes. Select OK and allow the import process to complete.
    After confirming all mailboxes were successfully imported and available, you can delete the copy of the Mail folder and old Envelope Index file from the Desktop and this should resolve the problem.

  • Mac Newbie - Problem opening Mail, says home directory is full

    I am new to Mac so forgive my ingnorance. I have been using Mail with no problems but just now (and each successive time despite restarts), when I open Mail a box pops up that says
    "Mail cannot update your mailboxes because your home directory is full. You must free up space in your home folder before using Mail. Delete unneeded documents or move documents to another volume."
    I appreciate any help.
    G-Mc

    Try the following.
    Quit the Mail.app first and using the Finder, go to Home > Library > Mail > Envelope Index. Delete the Envelope Index file and empty the Trash.
    Copy the Mail folder and place the copy on the Desktop for backup purposes.
    Launch Mail and you will be prompted to import all mailboxes located in the Mail folder at Home > Library > Mail.
    Select OK and allow the import process to complete. This process isn't really importing anything but replacing the deleted Envelope Index file and re-indexing all mailboxes.
    If this resolves the problem and after confirming all mailboxes and messages are available, you can delete the copy of the Mail folder placed on the Desktop.

  • Problems with Mail and Safari

    Hi,
    I'm running OS 10.11 and am having some consistent problems with Mail and Safari on my MacPro Dual 2.66. Here they are:
    Sometimes, for no apparent reason, selecting these applications from the dock no longer opens the application (or a new window if already opened), but causes them to be revealed in the finder.
    In Safari, when this problem occurs, another symptom seems to be that new windows will ONLY open in a new tab, even though I have preferences set to open links in a new window. If I click on a bookmark within a folder in the bookmark toolbar, Safari will open ALL the bookmarks in the folder in new tabs!!
    In Mail, when I open my Inbox, clicking on various messages will highlight (in blue) ALL the messages I'm clicking on, instead of simply displaying the highlighted message in the reader.
    The only way to get things back to normal is to reboot my machine, which is getting to be a total drag, especially since this seems to happen fairly often.
    One other thing that may be related- if my screen saver is running, and I move the mouse to go to an active screen, the computer will "freeze." It stays like this indefinitely- I figured out that if I press the button on the machine itself it will go to sleep, and I can wake it up and then everything is fine, but I don't understand what's going on.
    I have tried using Disk Utility and Disk Warrior, and have used OnyX to clean out my system cache and aall sorts of other stuff, but to no avail.
    Is anybody else experiencing any of this? I'm starting to get really frustrated. Thanks for any advice.
    Cheers,
    Andrew

    Scott,
    I had posted earlier that I had Flash payer problems and then QuickTime and PDF preview problems too, on my Intel PowerMac. I could not figure out what the problem was, because fixing permissions and moving plugins did not work. Console indicated that the Quicktime components were not found, with the problem in a webkit pref file somewhere (nil field value). Anyway, I bailed and reinstalled Leopard from a 10.5.0 DVD, and then updated using the combo updater to 10.5.3. Everything worked. Then, after the 'Java for Mac OSX 10.5 Update 1', it all broke again. This time, repairing permissions resulted in:
    User differs on "System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/jvm.cfg", should be 0, user is 95.
    User differs on "System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Libraries/classlist" , should be 0, user is 95.
    Now it all works again. This is obviously a flaw with the Java update, and also somehow Disk Utility did not find it earlier. Anyway, take a look at reverting the Java update, or manually changing user for those files (I suppose user 0 is root, but maybe it is nobody).
    Obscure....

  • Problems with mail after every shutdown

    I posted a few days ago when mail kept crashing following the security update (probably due to me not closing all applications before installing).
    I managed to get mail working again by resetting the junk mail filter.
    However, since then I have had problems with mail every time I restart my computer. Every morning, it mail crashes when I open it. I have fixed it a few times by quickly deleting select messages from my inbox before it crashes, but today I can't even do that. Resetting junk mail filter doesn't seem to work now. It's weird because once I get mail open I can close/open with no problem. I only have problems again after I have shutdown the computer.
    I verified the start up disk and permissions - there were no problems there - and I also checked for corrupted fonts (I have been reading all the suggestions posted on this site to people having similar problems).
    The console log reads:
    Jun 1 09:40:34 su-pwbk crashdump[218]: Mail crashed
    Jun 1 09:40:34 su-pwbk crashdump[218]: crash report written to: /Users/shancock/Library/Logs/CrashReporter/Mail.crash.log
    And the crash report reads:
    Date/Time: 2007-06-01 09:53:53.492 -0700
    OS Version: 10.4.9 (Build 8P135)
    Report Version: 4
    Command: Mail
    Path: /Applications/Mail.app/Contents/MacOS/Mail
    Parent: WindowServer [61]
    Version: 2.1 (752)
    Build Version: 1
    Project Name: MailViewer
    Source Version: 7520000
    PID: 221
    Thread: 3
    Exception: EXCBADINSTRUCTION (0x0002)
    Code[0]: 0x00000002
    Code[1]: 0x9a397784
    Thread 0:
    0 libSystem.B.dylib 0x9000b448 machmsgtrap + 8
    1 libSystem.B.dylib 0x9000b39c mach_msg + 60
    2 com.apple.CoreFoundation 0x907deba8 __CFRunLoopRun + 832
    3 com.apple.CoreFoundation 0x907de4ac CFRunLoopRunSpecific + 268
    4 com.apple.HIToolbox 0x9329bb20 RunCurrentEventLoopInMode + 264
    5 com.apple.HIToolbox 0x9329b1b4 ReceiveNextEventCommon + 380
    6 com.apple.HIToolbox 0x9329b020 BlockUntilNextEventMatchingListInMode + 96
    7 com.apple.AppKit 0x93780ae4 _DPSNextEvent + 384
    8 com.apple.AppKit 0x937807a8 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 116
    9 com.apple.AppKit 0x9377ccec -[NSApplication run] + 472
    10 com.apple.AppKit 0x9386d87c NSApplicationMain + 452
    11 com.apple.mail 0x000871d8 0x1000 + 549336
    12 com.apple.mail 0x00087080 0x1000 + 548992
    Thread 1:
    0 libSystem.B.dylib 0x900553a8 semaphoretimedwait_signaltrap + 8
    1 libSystem.B.dylib 0x90055204 pthreadcondtimedwait + 676
    2 com.apple.Foundation 0x92c625d4 FCONDITION_WAITTIMEOUT + 144
    3 com.apple.Foundation 0x92c624f0 -[NSConditionLock lockWhenCondition:beforeDate:] + 128
    4 com.apple.MessageFramework 0x9a2b9d90 -[InvocationQueue _drainQueue] + 176
    5 com.apple.Foundation 0x92be31a0 forkThreadForFunction + 108
    6 libSystem.B.dylib 0x9002be08 pthreadbody + 96
    Thread 2:
    0 libSystem.B.dylib 0x900553a8 semaphoretimedwait_signaltrap + 8
    1 libSystem.B.dylib 0x90055204 pthreadcondtimedwait + 676
    2 com.apple.Foundation 0x92c625d4 FCONDITION_WAITTIMEOUT + 144
    3 com.apple.Foundation 0x92c624f0 -[NSConditionLock lockWhenCondition:beforeDate:] + 128
    4 com.apple.MessageFramework 0x9a2b9d90 -[InvocationQueue _drainQueue] + 176
    5 com.apple.Foundation 0x92be31a0 forkThreadForFunction + 108
    6 libSystem.B.dylib 0x9002be08 pthreadbody + 96
    Thread 3 Crashed:
    0 com.apple.MessageFramework 0x9a397784 -[ABAddressBook(MailAdditions) _bestRecordMatchingFormattedAddress:inSubscribedContent:] + 0
    1 com.apple.MessageFramework 0x9a2dc7f0 -[ABAddressBook(MailAdditions) bestRecordMatchingFormattedAddress:] + 44
    2 com.apple.MessageFramework 0x9a2dc6c8 -[MailAddressManager bestRecordMatchingFormattedAddress:] + 184
    3 com.apple.mail 0x00040ee0 0x1000 + 261856
    4 com.apple.mail 0x00037014 0x1000 + 221204
    5 libobjc.A.dylib 0x90a461f4 objc_msgSendv + 180
    6 com.apple.Foundation 0x92bdec94 -[NSInvocation invoke] + 944
    7 com.apple.MessageFramework 0x9a2b0800 -[MonitoredInvocation invoke] + 144
    8 com.apple.MessageFramework 0x9a2b9e80 -[InvocationQueue _drainQueue] + 416
    9 com.apple.Foundation 0x92be31a0 forkThreadForFunction + 108
    10 libSystem.B.dylib 0x9002be08 pthreadbody + 96
    Thread 4:
    0 libSystem.B.dylib 0x900553a8 semaphoretimedwait_signaltrap + 8
    1 libSystem.B.dylib 0x90071be8 pthreadcond_timedwait_relativenp + 556
    2 ...apple.AddressBook.framework 0x94e35cac -[ABRemoteImageLoader workLoop] + 132
    3 com.apple.Foundation 0x92be31a0 forkThreadForFunction + 108
    4 libSystem.B.dylib 0x9002be08 pthreadbody + 96
    Thread 3 crashed with PPC Thread State 64:
    srr0: 0x000000009a397784 srr1: 0x000000000008f030 vrsave: 0x0000000000000000
    cr: 0x24000248 xer: 0x0000000020000004 lr: 0x000000009a2dc7f0 ctr: 0x000000009a397784
    r0: 0x000000009a2dc7f0 r1: 0x00000000f0202ef0 r2: 0x00000000a0001fac r3: 0x0000000004a00490
    r4: 0x000000009a3ec540 r5: 0x0000000004a5cac0 r6: 0x0000000000000000 r7: 0x000000006e636f63
    r8: 0x0000000000000000 r9: 0x0000000000000000 r10: 0x0000000090a3f628 r11: 0x0000000000000001
    r12: 0x000000009a397784 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x0000000000000000
    r16: 0x0000000000000000 r17: 0x0000000000000000 r18: 0x00000000001b0000 r19: 0x0000000004a229a0
    r20: 0x0000000000000002 r21: 0x0000000000000000 r22: 0x0000000004a2f110 r23: 0x00000000001b0000
    r24: 0x0000000000000000 r25: 0x0000000000000000 r26: 0x0000000000000000 r27: 0x0000000004a5cac0
    r28: 0x0000000004a5cac0 r29: 0x0000000004a00490 r30: 0x00000000aa2b5048 r31: 0x000000009a2dc610
    Model: PowerBook5,2, BootROM 4.7.1f1, 1 processors, PowerPC G4 (1.1), 1 GHz, 768 MB
    Graphics: ATI Mobility Radeon 9600, ATY,RV350M10, AGP, 64 MB
    Memory Module: SODIMM0/J25LOWER, 256 MB, DDR SDRAM, PC2700U-25330
    Memory Module: SODIMM1/J25UPPER, 512 MB, DDR SDRAM, PC2700U-25330
    Modem: LastDash, Euro, V.92, 4.0, APPLE VERSION 2.6.6
    Bluetooth: Version 1.7.14f14, 2 service, 0 devices, 1 incoming serial ports
    Network Service: Built-in Ethernet, Ethernet, en0
    PCI Card: TXN,PCIXXXX-00, cardbus, PC Card
    Parallel ATA Device: MATSHITACD-RW CW-8123
    Parallel ATA Device: TOSHIBA MK6026GAX, 55.89 GB
    USB Device: Bluetooth HCI, Up to 12 Mb/sec, 500 mA
    USB Device: Microsoft 3-Button Mouse with IntelliEye(TM), Microsoft, Up to 1.5 Mb/sec, 500 mA
    Would greatly appreciate a more permanant fix to this problem!
    Thanks, Su
    PowerBook5,2   Mac OS X (10.4.9)  

    As I said in the other thread, in your case Mail was crashing because of a problem with Address Book, so it should be no surprise that resetting the junk filter didn’t really fix the problem. It would have been more appropriate to post back there instead of starting a new thread...
    If Address Book itself works fine, the problem is probably the Previous Recipients list that Mail stores in the Address Book database. If you can do this without Mail crashing, in Mail open Window > Previous Recipients and remove all the entries from there.
    If that doesn’t work, you’ll have to re-create the entire Address Book database:
    1. If you have a .Mac account and .Mac synchronization of Address Book data is enabled either in Address Book > Preferences > General or in System Preferences > .Mac, disable it before proceeding.
    2. You may also need to reset the entire sync history (iSync > Preferences > Reset Sync History) to avoid synchronization issues if you use .Mac or iSync to synchronize your Address Book with other computers or devices.
    3. Open Address Book.
    4. As an extra safety measure, do File > Back up Address Book and save the backup wherever you wish.
    5. Go to Address Book > Preferences > vCard, set the vCard Format to 3.0 and check Export notes in vCards. Close the Preferences window when done.
    6. Select the All group in the main Address Book window and do File > Export Group vCard (the command should read “Export Group vCard”, not just “Export vCard”).
    7. Quit Address Book, Mail, and any other applications that might use Address Book for something. Or just quit all applications to be on the safe side.
    8. In the Finder, go to ~/Library/Application Support/ and move the entire AddressBook folder out of there, e.g. to the Desktop (to be deleted after fixing the problem and making sure you don’t miss anything).
    9. Check whether the problem is fixed now. If it is, you may be able to restore your contacts without the problem happening again by opening Address Book and doing File > Import > vCards to import the previously exported cards back into Address Book.
    10. If the problem has been fixed and .Mac synchronization of Address Book data was enabled at the beginning, enable it again, go to System Preferences > .Mac > Advanced, click Reset Sync Data, and choose the appropriate options to reset the Address Book data stored on the .Mac server with the data locally stored on the computer, i.e. sync data must flow from the computer to the .Mac server.
    Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder. That is, ~/Library is the Library folder within the user’s home folder, i.e. /Users/username/Library.

  • Problem in Mail deletion in POP3

    Hi
    I am using Pop3.
    I opened folder using
    folder.open (Folder.READ_WRITE);
    setting flag for deletion
    mimeMessages.setFlag (Flags.Flag.DELETED, true);
    then in finally block closing the folder
    if (mailbox.isConnected ()) {
    if(folder != null && folder.isOpen()) {
    try {
    folder.close (true);
    sometimes it is not deleting the messages.
    Please suggest something.
    Thanks
    Atal

    I am sorry but what do u mean by this? can u please explain in detail.
    actually most of times it works fine but in few cases mail deletion is failing.
    In my code: after folder.close (true); I just take a dump that comes successfully.
    The MailBox folder has been closed after deleting the ToBeDeleted Mails, if any, by folder.close method.
    MessageId of 1 th message which has been marked for Deletion : 1150475083.23686.prod-util-1.aspdeploy.com,S=57857
    MessageId of 2 th message which has been marked for Deletion : 1150475117.23813.prod-util-1.aspdeploy.com,S=6808
    MessageId of 3 th message which has been marked for Deletion : 1150475120.23818.prod-util-1.aspdeploy.com,S=9425
    MessageId of 4 th message which has been marked for Deletion : 1150475140.23852.prod-util-1.aspdeploy.com,S=6121
    these 4 messages were marked for deletion.
    then close called. after
    The MailBox folder has been closed after deleting the ToBeDeleted Mails, if any, by folder.close method.
    message, it again tries to retrieve the folder with messages
    Retrieving messages for mailbox ..
    MessageId of the: 1 th message is 1150475083.23686.prod-util-1.aspdeploy.com,S=57857
    MessageId of the: 2 th message is 1150475117.23813.prod-util-1.aspdeploy.com,S=6808
    MessageId of the: 3 th message is 1150475120.23818.prod-util-1.aspdeploy.com,S=9425
    MessageId of the: 4 th message is 1150475140.23852.prod-util-1.aspdeploy.com,S=6121
    MessageId of the: 5 th message is 1150475338.13255.prod-util-2.aspdeploy.com,S=7458
    MessageId of the: 6 th message is 1150475387.13339.prod-util-2.aspdeploy.com,S=6394
    MessageId of the: 7 th message is 1150475393.13357.prod-util-2.aspdeploy.com,S=59238
    MessageId of the: 8 th message is 1150475553.13615.prod-util-2.aspdeploy.com,S=86236
    first 4 messages are same which were not deleted.
    I have just attached the code. If you want to have a look then plz.
    thanks
    atal
    package com.deploy.email;
    import com.baltimore.jpkiplus.vaults.Vault;
    import com.baltimore.jpkiplus.x509.JCRYPTO_X509Certificate;
    import com.baltimore.jsmt.smime.JSMTException;
    import com.baltimore.jsmt.smime.SMIMEv2;
    import com.deploy.email.api.EmailException;
    import com.deploy.email.api.InitException;
    import com.deploy.email.api.ReceivedMessage;
    import com.deploy.email.config.LogicalMailboxConfiguration;
    import com.deploy.email.config.MailConfiguration;
    import com.deploy.email.config.PhysicalMailboxConfiguration;
    import com.deploy.email.util.SecureEmailHelper;
    import com.sun.mail.pop3.POP3Folder;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.BufferedReader;
    import java.security.MessageDigest;
    import java.security.NoSuchAlgorithmException;
    import java.util.ArrayList;
    import java.util.Enumeration;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Vector;
    import javax.mail.Address;
    import javax.mail.AuthenticationFailedException;
    import javax.mail.Flags;
    import javax.mail.Folder;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.Multipart;
    import javax.mail.Part;
    import javax.mail.Store;
    import javax.mail.UIDFolder;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    import javax.naming.NamingException;
    import org.apache.log4j.Logger;
    * This class spawns a thread for each mailbox and pulls messages from those mailboxes at a specified interval.
    * Use start to initialize and stop to end the threads
    * Bug Fixes
    * - 8399 Broke out the mailServer into two separate potential servers; sendMailServer and receiveMailServer
    * This class was updated to reflect the receiveMailServer setting
    * 04/25/03 John Gemski
    * - 10619 Added support for the Lotus Notes Client as per the 3.x fix. Copied logic from 3.x as detailed
    * by Hari in the bug report
    * 08/13/03 John Gemski
    * - Added Email Client Calendaring support - John Gemski 10/21/2003
    * @see com.deploy.email.EmailChannel
    public class RetrieveMail implements Runnable {
    /** Used to tell the threads when to stop */
    private static boolean keepRunning=true;
    //anish For nationwide
    private int maximumsizeofinbox=-1;
    /** The messages on the mail server that have been pulled but not deleted */
    private HashMap messagesOnServer;
    /** These are the mailbox types. Will only be one here for the Azetra impl */
    private static List logicalMailboxes;
    /** The list of running threads. Need to be tracked so they can be interrupted upon stop */
    private static ArrayList receiveThreads;
    /** A reference to the EmailChannel object, which may contain updated information. */
    private static EmailChannel emailChannel = EmailChannel.getInstance();
    private static Logger log = Logger.getLogger(EmailChannel.LOGGER_MODULE_NAME);
    // Thread variables
    /** the configuration for the physical mailbox from which the emails are being pulled. */
    private PhysicalMailboxConfiguration tPhysicalMailbox;
    /** the logical type (OLJB, ScanWorld, Task Response, Resume) that the physical mailbox thread is pulling for */
    private String tLogicalType;
    /** JavaMail Store */
    private Store mailbox;
    // Acceptable Protocols to retrieve mail from the mail server.
    public static final int RECEIVE_MAIL_PROTOCOL_POP3 = 0;
    public static final int RECEIVE_MAIL_PROTOCOL_IMAP = 1;
    public static final int NUM_RECEIVE_MAIL_PROTOCOLS = 2;
    public static String [] RECEIVE_MAIL_PROTOCOL_NAME;
    /** Indicates whether or not the Secure Email feature is enabled. */
    private static boolean secureEmailEnabled =false;
    static {
    RECEIVE_MAIL_PROTOCOL_NAME = new String [NUM_RECEIVE_MAIL_PROTOCOLS];
    RECEIVE_MAIL_PROTOCOL_NAME [RECEIVE_MAIL_PROTOCOL_POP3] = "pop3";
    RECEIVE_MAIL_PROTOCOL_NAME [RECEIVE_MAIL_PROTOCOL_IMAP] = "imap";
    // FIX for socket hang issue (FIX PR 14253) while processing the mail
    public static final String SOCKET_READ_ERROR = "No inputstream from datasource";
    /** Constructor for new RetrieveMail thread.
    * @param phys_config the mailbox configuration for a specific physical mailbox (i.e. [email protected])
    * @param logical_type the logical type for this mailbox ("Resumes", "OLJB", "ScanWorld", or "TaskResponse")
    private RetrieveMail(PhysicalMailboxConfiguration phys_config, String logical_type) {
    this.tPhysicalMailbox = phys_config;
    this.tLogicalType = logical_type;
    * Retrieve email messages from a mail server for the particular physical mailbox indicated with the thread
    * @throws EmailException if any fatal error occurs with the retrieval or processing of the incoming emails
    private void retrieveMessages () throws EmailException {
    Vector msgVector = new Vector ();
    Vector deleteMsgVector = new Vector ();
    ReceivedMessage [] recMessages;
    MailConfiguration mailConfig = emailChannel.getMailConfiguration();
    long maxReceivedEmailSize = mailConfig.getMaximumReceiveSize();
    //Anish for Bug 20366 for Nationwide Patch 06
    maximumsizeofinbox = mailConfig.getMaximumsizeofinbox();
    // Synchronize on the mailbox object for the mailbox from which we
    // are going to retrieve messages. We don't want more than one
    // thread connected to a mailbox at a time, but we don't want to
    // prevent multiple different threads from being connected to
    // multiple different mailboxes simultaneously.
    synchronized (mailbox) {
    boolean throwingException = false;
    Folder folder = null;
    try {
    /* Fix for 8399 - use the getReceiveMailServer call instead of the
    * getMailServer call
    // Connect to the server for receiving mail.
    mailbox.connect (mailConfig.getReceiveMailServer(),
    tPhysicalMailbox.getMailboxName(),
    tPhysicalMailbox.getMailboxPassword());
    // We are only interested in the "INBOX" folder.
    folder = mailbox.getFolder ("INBOX");
    // Open with write permissions as well, so we can delete messages from the server
    folder.open (Folder.READ_WRITE);
    // Anish for Bug 20366 for Nationwide Patch 06
    //int numMessages = folder.getMessageCount ();
    int numMessages1 = folder.getMessageCount ();
    int numMessages = 0;
    //log.info("Anish123 " + maximumsizeofinbox);
    if (maximumsizeofinbox < 0)
    numMessages = numMessages1;
    else
              if (numMessages1 > maximumsizeofinbox) {
              numMessages = maximumsizeofinbox;
              //log.info("Anish try 1 " + numMessages1);
              else {
              numMessages = numMessages1;
              //log.info("Anish try 2 " + numMessages);
    //     log.info("Anish try 4 " + numMessages);
    // End by anish
    if (numMessages > 0) { // There are messages to retrieve
    Message [] messagesRaw = folder.getMessages ();
    // We need to cast the messages to MIME message objects so
    // that we can access some MIME message-specific functionality.
    MimeMessage [] mimeMessages = new MimeMessage [numMessages];
    for (int i = 0; i < numMessages; i++) {
    mimeMessages = (MimeMessage) messagesRaw [i];
    // We can only get messages totalling maxReceivedMessageSize bytes.
    // Calculate how many messages we may get and still stay under the limit.
    int numMessagesToRetrieve = 0;
    int i = 0;
    if( maxReceivedEmailSize > 0) {
    int totalSize = 0;
    numMessagesToRetrieve = 0;
    boolean reachedLimit = false;
    while ((i < numMessages) && !reachedLimit) {
    int messageSize = mimeMessages[i].getSize ();
    int newTotalSize = totalSize + messageSize;
    if (newTotalSize > maxReceivedEmailSize) {
    //if this is the first message then break out and process it
    if( i == 0 ) {
    i++;
    totalSize = newTotalSize;
    reachedLimit = true;
    else {
    totalSize = newTotalSize;
    i++;
    numMessagesToRetrieve = i;
    i = 0;
    else {
    numMessagesToRetrieve = mimeMessages.length;
    while( i < numMessagesToRetrieve )
    boolean gotMessage = false;
    String uniqueID = null;
    if( numMessagesToRetrieve > 0 ) {
    // Get the ID for the message
    uniqueID = getUniqueID (mimeMessages[i], folder);
    //By Anurag for Req#2907 to add Debugging Logs start
    log.info("MessageId of the: " + (i+1) + " th message is " + uniqueID);
    //By Anurag for Req#2907 to add Debugging Logs End
    // Check if we have previoiusly retrieved this message.
    Object value = messagesOnServer.get (uniqueID);
    gotMessage = (value != null);
    if (!gotMessage) { // Make sure message is filled in.
    boolean processMessage = true;
    try {
    if(secureEmailEnabled) {
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    mimeMessages[i].writeTo(os);
    InternetAddress[] senders = (InternetAddress[])mimeMessages[i].getFrom();
    InternetAddress[] recipients = (InternetAddress[])mimeMessages[i].getRecipients (Message.RecipientType.TO);
    Exception lastException = null;
    Vault v = null;
    for (int countRecipients = 0; countRecipients < recipients.length; countRecipients++) {
    lastException = null;
    v = null;
    // try to get the recipient's address from the Vault hash table
    log.info("Trying to get Vault for address: " + recipients[countRecipients].getAddress ());
    v = SecureEmailHelper.getVault (recipients[countRecipients].getAddress ());
    // we can't decrypt if we don't have a private key from the vault!
    if (v == null) {
    log.info("The PFX file for the email account: " + recipients[countRecipients].getAddress () + " is not found or invalid. Please correct.");
    lastException = new EmailException(EmailException.REASON_UNKNOWN, "The PFX file for the email account: " + recipients[countRecipients].getAddress () + " is not found or invalid. Please correct.");
    else {
    break;
    // if we came out with all exceptions, throw the last one we received.
    if (lastException != null) {
    log.error(lastException.getMessage(), lastException);
    throw lastException;
    SMIMEv2 smimer = new SMIMEv2(v);
    // Set up input and output streams to read an S/MIME message
    byte[] originalMessageBytes = os.toByteArray();
    String origMessStr = new String(originalMessageBytes);
    // The SMIMEv2 can't handle extra characters.
    // Noticed that messages contained an "+OK", which was causing problems
    // removed the entire line
    if(origMessStr.startsWith("+OK")) {
    int index = origMessStr.indexOf("\n");
    origMessStr = origMessStr.substring(index+1);
    byte[] revMessageStr = origMessStr.getBytes();
    ByteArrayInputStream input_source = new ByteArrayInputStream(revMessageStr);
    ByteArrayOutputStream output_sink = null;
    boolean smimeRecognized=true;
    boolean wasSigned=false;
    boolean wasEncrypted=false;
    // Making changes to reflect Baltimore's suggestion about layers
    ByteArrayInputStream newMessage = null;
    boolean done=false;
    // According to Baltimore, there can be two layers of encryption
    // inner and outer. It could be encrypted & signed, with it being either
    // encrypted on the outer layer and signed on the inner, or vice versa.
    // We want to ensure that this loop breaks out after either
    // 1. there were 2 layers sign/encrypted or encrypted/signed
    // 2. there was an error
    int layers=0;
    while(!done && layers < 2) {
    output_sink = new ByteArrayOutputStream();
    layers++;
         try {
    // This step must be don't before any cryptographic operations. It lets the SMIMEv2 class
    // figure out what it has as an input and where to place the output
    smimer.attachStreams(input_source, true, output_sink, false, false);
    catch (JSMTException jse) {
    // This is common since unencrypted and unsigned data cannot perform this function
    // Ideally, Baltimore says to use the type SMIMEv2.TYPE_DATA, but it never gets this
    // far since this fails.
    // We will skip the attempts to decrypt/verify the signature, since we know we won't
    // be able to interpret what type of message it is.
    smimeRecognized=false;
    // Will only be one layer
    done=true;
         log.debug("SMIME recognized: " + smimeRecognized);
    if(smimeRecognized) {
    // Get the S/MIME message type
    int nextdata = smimer.getMessageType();
    log.info("SMIME message type: " + nextdata);
    if (nextdata == smimer.TYPE_SIGNED) { // Signed message
    wasSigned=true;
    boolean matchedSender = false;
    // Didn't know you could have multiple "from" in an email address
    // Right now, only one of the "froms" has to have a certificate
    for(int s=0; s < senders.length; s++) {
    // get the sender's address
    String from_sender = senders[s].getAddress();
    try {
    // retrieve the certificates from the LDAP
    JCRYPTO_X509Certificate[] senderCerts = null;
    senderCerts = SecureEmailHelper.getCertificatesFromLDAP(from_sender);
    if(senderCerts!=null) {
    // verify() needs to take in a chain of certificates
    com.baltimore.jsmt.pkcs7.CertificateChain cc= new com.baltimore.jsmt.pkcs7.CertificateChain();
    // create certificate chain
    for(int k=0; k < senderCerts.length; k++) {
    cc.addCertificate(senderCerts[k]);
    // verify the Certificate Chain against the message's certs
    if(smimer.verify(cc)) {
    // found a match, the message was verified
    matchedSender=true;
    break;
    else
    log.error("Could not verify the sender" + from_sender);
    done=true;
    catch(NamingException ne) {
    log.error("There was a problem connecting to the LDAP for " + from_sender,ne);
    done=true;
    // if none of the senders matched, we need to not process
    // the email message, since it will be unreadable
    if(!matchedSender) {
    StringBuffer sendString = new StringBuffer();
    for(int s=0; s < senders.length; s++) {
    String from_sender = senders[s].getAddress();
    sendString.append(" : " );
    sendString.append(from_sender);
    processMessage = false;
    log.error("Could not find certificate for any of the senders" + sendString.toString());
    done=true;
    else if (nextdata == smimer.TYPE_ENVELOPED) { // Encrypted message
    log.debug("SMIME Encrypted message!");
    wasEncrypted = true;
    try {
    log.debug("SMIME Decrypting message...");
    // Decrypts the message
    smimer.openEnvelope();
    catch (JSMTException jse) {
    // Could not decrypt message
    log.error("Could not decrypt message: " + jse.getMessage (), jse);
    processMessage = false;
    done=true;
    else {
    log.debug("Unrecognized type");
    // doesn't seem to get here since Baltimore toolkit doesn't accept
    // nonencrypted, nonsigned emails (it should though). Keep here for future
    // releases of the toolkit
    done = true;
    // Now that we have output_sink,
    // retrieve the bytes
    byte[] processedBytes = output_sink.toByteArray();
    newMessage = new ByteArrayInputStream(processedBytes);
    input_source = new ByteArrayInputStream(processedBytes);
    else {
    // only for the first time around, revert to original
    if(layers==1) {
    // Keep original message
    newMessage = new ByteArrayInputStream(revMessageStr);
    log.debug("wasSigned: " + wasSigned + " wasEncrypted: " + wasEncrypted);
    // create the mime message again
    mimeMessages[i] = new MimeMessage(emailChannel.getSession(),newMessage);
    mimeMessages[i].setFrom (senders[0]);
    mimeMessages[i].setRecipients (Message.RecipientType.TO, recipients);
    // decrypted/verified data is automatically written to output_sink
    input_source.close();
    output_sink.close();
    // If the message wasn't signed, we can still process the message
    // if the settings allow the server to process unsigned messages
    // If not, set the flag to not process this message
    if(!tPhysicalMailbox.getAcceptUnsignedEmail() && !wasSigned) {
         log.info("Server configuration does not allow unsigned emails.");
    processMessage = false;
    // If the message wasn't encrytped, we can still process the message
    // if the settings allow the server to process unencrypted messages
    // If not, set the flag to not process this message
    if(!tPhysicalMailbox.getAcceptUnencryptedEmail() && !wasEncrypted) {
    log.info("Server configuration does not allow unencrypted emails.");
    processMessage = false;
    if(processMessage) {
    MimeMessage m = mimeMessages[i];
    if( maxReceivedEmailSize > 0 && m.getSize() > maxReceivedEmailSize ) {
    try {
    m = constructDummyMsg( m, m.getSize() );
    catch (Exception e) {
    // Add message to a list of messages to be deleted after
    // finished retrieving messages.
    deleteMsgVector.addElement (uniqueID);
    ReceivedMessage receivedMessage =
    new ReceivedMessage (m, uniqueID);
    msgVector.addElement (receivedMessage);
    else {
    log.info("Email could not be processed.");
    deleteMsgVector.addElement (uniqueID);
    catch (EmailException ee) {
    log.error("Email Exception", ee);
    deleteMsgVector.addElement (uniqueID);
    } // mail socket hang fix
    catch (javax.mail.MessagingException e) {
    String message = e.getMessage();
    // if it's a socket hang issue due to network outage, we want to logout and refetch the messages.
    if (message.equals(SOCKET_READ_ERROR)) {
    log.error("Socket timed out. Closing the connection", e);
    messagesOnServer.clear();
    throw new EmailException(

  • GoDaddy exchange account sent emails not appearing in sent folder in Mac Mail

    The problem: I set up my business email address (GoDaddy exchange account) as a new email account in Mac Mail. A few days later I noticed that sent emails were no longer appearing in my sent folder for this account.
    The solution: there was a conflict with the Gmail account that I also set up in Mac Mail a few days after I set up my business email. I have deleted my gmail account from Mac Mail and so far so good - sent emails are appearing again in the Sent folder in Mac Mail.
    Note:
    - Emails sent from webmail (Office 365 Outlook) did appear in the Sent folder.
    - GoDaddy thought there was a conflict in the name of the Sent folders (called Sent Items in webmail interface), but said it was a problem Apple should solve.

    Send Apple feedback. They won't answer, but at least will know there is a problem. If enough people send feedback, it may get the problem solved sooner.
    Mail Feedback

  • Notes folder disappeared from mail icloud in browser

    It just disappeared from icloud in browser but it shows in my devise.
    "Sync notes" is swich on.
    It always works till tooday. I did nothing to get this
    I need to appeare the notes folder in my mail icloud (browser) just like it was

    I've had reserev coppy of my important Notes - just in case
    I think its some Apples problem. Probably they start testing of theirs new icloud-beta, where notes and reminders will be on the main panel (like mail, contacts, calendar).

  • Problems with mail in mountain lion

    I installed mountain lion and since doing so I cannot get past the migrating data window when I try to open mail.  I have tried deleting the envelope index (although I can't remove it from the trash as it continually says it is in use).  I have also tried moving the smartmailboxes.plist and backup files to my desktop but still no joy.  Can anyone suggest what to do next?
    Dan

    Please follow these directions to delete the Mail "sandbox" folder.
    Back up all data.
    Quit Mail.
    Triple-click the line below to select it:
    ~/Library/Containers/com.apple.mail
    Right-click or control-click the highlighted line and select
    Services ▹ Reveal
    from the contextual menu. A Finder window should open with a folder named "com.apple.mail" selected. If it does, move the selected folder — not just its contents — to the Desktop. Leave the Finder window open for now.
    Relaunch Mail and test. If the problem is resolved, you'll have to recreate some of your Mail settings. You can then delete the folder you moved and close the Finder window. If you still have the problem, quit Mail again and put the folder back where it was, overwriting the one that may have been created in its place. Post your results.
    Caution: If you change any of the contents of the sandbox, but leave the folder itself in place, Mail may crash or not launch at all. Deleting the whole sandbox will cause it to be rebuilt automatically.

  • How can I change colour or design to the folder icons in Mail ?

    How can I change colour or design to the folder icons in Mail ?

    Apple doesn’t routinely monitor the discussions.
    Send Apple feedback. They won't answer, but at least will know there is a problem. If enough people send feedback, it may get the problem solved sooner.
    Mail/Provide Mail Feedback

Maybe you are looking for