Fetch mails for offline usage vs. leight-weight filling of Message object

Hello!
I'm working on a simple mail class having just a send and a fetch method. But I ran into problems with the latter, because I can't return the messages I fetch. The JavaMail documentation says "Folder implementations are expected to provide light-weight Message objects, which get filled on demand.", so obviously my code won't work out.
public static Message[] fetchMails()
   Message messages[] = folder.getMessages();
   folder.close(true);
   store.close();
   return messages;
Messages msg[] = MailAccount.fetchMails();
System.out.println(msg.getSubject()); // error: Folder is not open.So how can I return the messages as an object, which I can work on even if the connection to the server is already closed? Is there any high level solution for this or do I have to use message.writeTo() or create my own container class for email contents?
Tnx in advance!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Could you please give an example for your first advice? folder.getMessages() returns an array of Message objects, but the MimeMessage constructor only takes MimeMessage objects and some InputStreams. Do I have to cast the Message objects somehow?
I try to keep my code as simple as possible (it's just a litte demo appication), so I don't want to go for any third party products. But the MimeMessage thing sounds like a good idea, if it works.
Thanks for your reply so far.

Similar Messages

  • App-V 5.0: howto deploy packages to laptops and make sure they are loaded for offline usage?

    Hi,
    We would like to make sure App-v packages distributed on laptops fully load the (App-V) applications offline.
    This way we can make sure when they are on the road they don't need network to load their applications.
    How this can be done?
    J.
    Jan Hoedt

    Thanks, I do see 2 options indeed: Download content from distribution point and run locally, then stream content from distribution point.
    3 more questions:
    *(not tested yet can check that asap) won't (download from ...) just download when the application is launched?
    *stream content, will it stream each time and not download anything?
    *there is also the option "persist content in client cache", which you can check even if you enable "stream content", that's somewhat confusing, what does that do then?
    J.
    Jan Hoedt
    Jan,
    Note there are two areas of concern here when talking about caching. The CCMcache folder where the application is downloaded to and the ProgramData\App-V folder where the actually
    application is published (think of it as the installation folder) this is commonly referred to as the App-V cache.
    1. As Peter says 'It will download when the application is "installed".'
    2. Stream content means that only the xml files will download to the ccmcache folder and not the rest of the appv file
    - this is seperate to the App-V cache mentioned above (i.e. ProgramData\App-V folder). Content will still be published to the ProgramData\App-V folder and the streaming or offlining of this is controlled by the Stored Content Store. If you enable SCS then
    content published to the ProgramData\App-V folder will be FB0 and no other data will be cached offline, whilst disabling SCS means that the whole app will be offlined to ProgramData\App-V which is what you want to do.
    3. This will keep the data persisting in the ccmcache. 
    Hope this helps.
    Cheers
    Paul | sccmentor.wordpress.com

  • Mail for Mac OS X Lion: where's the message content?

    Suddenly, the panel that shows me message content disappeared (when the program was made smaller -- but not minimized). Now that it's larger, I can't find that extra panel I always had, that let me read a message's actual content.
    And I can't find any in any of the menus that would seem to help.
    Can you?

    Look to the right-hand frame for the Mail main window. That frame border should be a bit thicker than the others, and have a small 'dot' about halfway down. Click and hold on that and drag to the left.

  • Failure to connect to Mail for Exchange on E75

    I cannot synchronize my mail for exchange as I get the following error message:
    "Server requires secure connection. Change Profile > Connection > Secure connection to Yes."
    This path does not exist in the phone menu, however, I have changed through Email > Settings > Mail for Exchange > Mailbox > Advanced Mailbox Settings > Secure Connection to Yes.
    Yet it still gives me the same error message above. I have checked all internal settings with my office's IT department and have updated the phones' software and still nothing has changed! Also I have entered port # 443.
    I need some assistance please. Thanks. 

    Hello there - I too have a problem with exchange on my e75. I could not get my first e75 to work with exchange, I managed to download my emails once, then was never able to do it again.My provider sent me a new phone. Last night I wiped the phone and downloaded the latest firmware as for the last 5 days I had no joy with my settings. Eventually I managed to download my emails - hoorah!
     Sadly my joy was short-lived - today once again, I cannot download my emails, no error massage, nothing - I try send & receive the twurly-wurly thing in the corner spins, then drops out - same as before.
    Any ideas?

  • INBOUND MAIL PROCESSING in SAP for Offline ADOBE FORM Concept

    Hi to all,
    Please can anyone tell me, what INBOUND MAIL PROCESSING in SAP for Offline ADOBE FORM?
    What is concept and how to use it, is any program need to write for that or only need to configure it.
    I have searched the SDN, but only get topic how to configure inbound mail processing.
    I am new to this area; please any one put some light on it.
    I shall be thankful to you for this.
    Regards
    Pavneet Rana

    Hi Pavneet,
    Inbound processing of an offline adobe form consists of several things -
    a) an email id to be created on the server (to accept the mail & process the adobe form - this needs to have the right roles)
    b) the smtp config needs to be done by basis
    c) the abap developer needs to create a handler class that gets called when an email is recd in SAP. This handler class has 3-4 methods (first to read the mail and extract the pdf, convert data in pdf to the abap variable, process the form to do the specific function in sap (which will vary from requirement to another).
    I found this blog very useful when I was getting my adobe form done -
    /people/thomas.jung3/blog/2004/09/09/receiving-e-mail-and-processing-it-with-abap--version-610-and-higher
    Hope this helps.
    Cheers, Liz
    (ps: you might get more help in the adobe form specific forum in sdn)

  • Function use for fetching mail body  in java mail api

    sir,
    plz tell us the function so that we can fetch mails from the specific mailbox to our mailclient in java mail api

    Ok so, i've tracked down the rfc pages for POP3 and SMTP. But these are general guidelines and specifications independent of a programming language. Do you know what java libraries and APIs I should be looking at ? You assume to much.
    There are only two possibilities
    1. Code already exists to do thi.
    2. You are going to have to figure it out yourself.
    If you want the first then I believe I already suggested that you could find already built servers.
    If the second then a significant part of learning how to do it yourself is not only knowing what to use but also knowing what not to use. And you won't find the second if someone tells you.
    I can tell you that you will need to implement the following
    1. Storage. Storing the emails either in files or a database.
    2. Running a server. How do you get a server to run all the time? How do you get it to run when the computer reboots?
    3. How does it keep trying to send/receive when you are not there to push a button? How do you keep it from completely using up the CPU/IO on your box while it is still doing that.
    4. How would you actually make your server available to others? How would it interact with other servers? (This is easy to understand and very hard to do.)
    Yes, it exists and is called the JavaMail APIYep.
    Your steps at this point.
    1. Get that to work with your current email server. You should be able to send email to yourself.
    2. Once it works then go back to determine what additional logging and error notifications you can get from it. For example what happens if you give it the wrong host name, what happens if you use the wrong protocol for a given port.
    Once you have done that then you will have a tool that you can use to test your own email server and the experience to understand some of the problems.

  • Settings for offline approval mail

    Hello,
    I am on SRM 5.5 ( Extended classic scenario).
    Could anyone run me through all the settings required for offline approval mail to be sent ?
    It is not working well for me.
    Could i have a list of all the customisations and settings to be done.
    Thanks in advance,
    Aravind Nair.

    Hello arvind,
      Also refer the foll link...https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/795. [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
      I have a doc for the necessary steps...pls give me ur mail ID where i can send you that....Also most of the steps are given in the note....Pls refer that...
    Regards,
    Disha.
    Pls reward points for helpful answers.

  • Mail for Exchange with error "Body Fetch Message T...

    Hi,
    I am just got the Nokia E71, and had installed the Mail for Exchange version 2.0.5(5), and had set all the required configuration (Exchange Server Name, UserName, Passowrd, Domain). But when I do the SYNC, it got the "System Error" from the log, and I check on the "admin_log1.txt", it show that "Body Fetch Message Too Large" error.
    Any ideal on the error ? I have check the Access Point, there is working fine, as I can us the web browser on the phone, and no proxy setting
    I also check all the Exchange configuration setting with using the Windows Mobile PDA phone to do the SYNC with our company Exchange server, it work fine with all the given configuration.
    Please help.
    Thank You very Much.

    Is Mail for exchange working after the update? I am able to setup my company email, but mails are not getting downloaded. I tried entering a wrong password for my company email (after deleting my profile), just to check if mfe is able to connect properly with my company email server. It is able to identify that the email password i entered was incorrect. Also when I enter the correct password, setup finishes successfully. But its not retrieving any emails. I am sure of the settings, since the same settings were working earlier. Only thing i am doubtful about is the port number. Port number by default comes as 443. Does it need to change? Is MFE working for anyone? My company email is ************@hcl.com. Can you pls suggest?

  • Does anyone have any efficient techniques for saving mail on more than one machine and in the cloud (I need offline access). Trying to avoid endless message copying.

    I've been in an administrative job at my university, in which I needed to be able to access lots of past email conversations.  I ended up saving *everything* religiously, by copying each email or conversation into an "On My Mac" folder on either my home or office machine, flagging it as copied, then unflagging it and moving it to a like folder on the other machine. As a result I'v now got a trillion folders for various aspects of my job, filled with quite a few messages that I probably no longer even need, but they're way too many to go through and delete one by one.  Unfortunately, I haven't made much use of the iCloud folders, but I'm so tired of having to essentially manually sync my stored mail in the manner I just described, that I'm thinking of starting to file everything to iCloud folders.  The downside of that is that obviously if the internet is down and a given folder wasn't refreshed before it went down, I won't have access to the saved mail.
    Moreover, I'm about to step down from the admin post -- within about 6 months a lot of what I saved won't be needed at all, and going forward, I won't need to save nearly the same quantity of messages for later reference.  I'd like to come up with some viable "triage" strategies for limiting the mail I do save.  
    This is really just an open question:  Does anyone have any good mail filing and storage techniques that you'd be willing to share?  I'm especially interested in criteria you use for what you save and don't save, and where/how you save it. 

    Well, the one set up on exchange 2k3 is now working fine, although no changes were made on either the iPhone or the exchange side, so that's fun, but it still is throwing errors when connecting to the other 2 exchange accounts. The common elements are that both non-functioning exchange accounts are google apps for business accounts. So is one of the ones that's working, by the way. The settings on both accounts are the same as the one that's working, and both worked fine before the 8.3 upgrade. I have no issue accessing both of these accounts on my ipad which is currently on 8.2.x. If it's not the iphone OS at fault, I'm at a loss as to what it could be.

  • New release of native RSS Hub app with with support for offline reading and much more

    Hi All,
    I'm pleased to announce a new release of native RSS Hub with with support for offline reading, subscribing to news based on keywords and much more. No online accounts or registration is necessary. This release includes such features as:
    Subscribe to your favourite RSS feeds. Just type in web site address and application will discover feeds automatically
    Add feed directly from the browser
    Subscribe to RSS feeds based on your search criteria
    Download feed content, images and articles for offline reading
    Customize led colors, feed icons and much more
    When application is minimized on home screen dynamic cover will show images and titles of the latest news
    Customize notifications for your subscriptions
    Fetch feeds in background
    Customize font sizes
    Organize your feeds into groups or mark as favourites
    Use out-of-box RSS subscriptions
    Full support for Q10/Q5
    Share news
    And even more!
    Check this out:
    BlackBerry World - RSS Hub

    I use a Withings scale. Yes, it requires the Withings apps but syncing has been pretty seamless. The HealthKit framework is designed to allow applications to share information. At this point, it doesn't appear to be designed to allow devices to share information with the Health app directly. Given the fairly rudimentary nature of the way information is displayed by Health, this makes sense. Health is great for making sure that the weight data from my Withings scale gets synced to My Fitness Pal and Runkeeper. It's far more useful to me to see my weight data in MFP where it is used with the food diary and the movement data from my UP24 to give me a good picture of what I need to be doing. Health just doesn't really compare. It gives you basic graphs and that's about it.
    So, I guess what I'm saying is don't discount the scales that require an app. The Withings app is very nice. It also lets me take my resting pulse every morning (which is sent to Health).
    Submit your feedback directly to Apple using the appropriate link on the Feedback page:
    http://www.apple.com/feedback

  • Mail.app : locally store mails for a given period, leave the rest in gmail

    Hi all,
    My hard drive is filling up at the speed of light.
    In order to free some space, I have moved all music and videos on a NAS.
    I wish I could save some more space by leaving my older mails in the cloud, and just store locally in the mail app a given number of mails, or a given period, or a given space allocation.
    Is there a way to implement any of those solutions?
    Regards,
    Yann

    You are presumably using IMAP for gmail.  Have you seen the Mail > Preferences > Accounts > Gmail > Advanced setting choices for Keep copies of messages for offline viewing?
    All messages and their attachments
    All messages, but omit attachments
    Only messages I've read
    Don't keep copies of any messages
    The first choice is the default.  As long as you always have a good network connection, you could select the last choice.  This wouldn't not be as nice as a time-based setting.
    Keep in mind how cheap hard disks are.  I spent $60 for a 500GB 7200rpm drive for my old MacBook.

  • How do I create DRM Licenses that can be used for Offline Playback?

    [ Background ]
    Typically, a license is acquired from the DRM license server when the client video player encounters a video that is DRM-protected.   However, some use cases call for the ability for end-users to be able to play DRM content when a network connection is not available to the device.
    For example - the user wants to download a video from their home, acquire a license to play the content, and then get onto a train/airplane where a network connection isn't available.  On the train/airplane/etc..., the end user expects to be able to watch their video that they downloaded at home.
    [ DRM Policy Requirements ]
    For this use case to be possible, the DRM license must be acquired when the network connection is available.  In addition, the DRM license must be allowed to persist on the device disk.  For this to be possible, one value must be present in the DRM policy:
    1. Offline License Caching must be set to 1 or higher.  This policy parameter indicates how many minutes a license is allowed to be persisted to disk once it's been acquired by the license server.
    [ Workflow ]
    Now that the content has been packaged with a DRM policy that allows for offline caching (persistance) of a license, the video player simply has to acquire the license before the network connection is lost.  This can be accomplished via the typical API calls that the Video Player Application Developer would use to do a normal DRM license acquisition (DRMManager.loadVoucher()).
    For example, by using the DRMManager ActionScript3 API: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/drm/DRMManage r.html
    For other platforms supported by Adobe Access DRM (iOS, Android, etc...), please refer to the appropriate documentation around playback of DRM content on how to pre-fetch the DRM license.
    [ Workflow - iOS ]
    Enabling offline playback using the Primetime Media Player SDK (PSDK) for iOS requires a bit of self-extraction & instantiation of the DRM Metadata from the m3u8.  The reason for this is that as of PSDK v1.2, the PSDK APIs do not expose an mechanism for extracting the DRM metadata.
    You must manually (outside of the PSDK) get access to the DRM Metadata, instantiate a DRMContentData, and then use the DRMManager class to obtain a license for your content.  Afterwards, you may download your HLS content and stream it to your video player application locally.  Since the DRM license was pre-acquired before playback of the downloaded HLS content, your video player application does not require a network connection to acquire a DRM license.  Below is a code sample of obtaining the DRM Metadata from the m3u8 manifest and then using it with the DRMManager singleton.
    /*          Main entry points, playlistURL is url to a top level m3u8. */
    void PlayContent(NSURL* playlistURL)
              DRMManager* drmManager = [DRMManager sharedManager];
              if ([drmManager isSupportedPlaylist:playlistURL])
      // First we need a handler for any errors that may occur
                        DRMOperationError errorHandler = ^(NSUInteger major, NSUInteger minor, NSError* nsErr)
      /*          report error. */
      /*          Synchronous call to DRM manager to extract DRM metadata out of the playlist. */
                        [_drmManager getUpdatedPlaylist:playlistURL
                                                                                      error:errorHandler
                                                                                    updated:^(NSURL *newPlaylist, DRMMetadata *newMetadata)
                                   (void) newPlaylist; /*          updated URL is not used for this code sample. */
                                   if (newMetadata)
                                                      Assumes we are going to try to satisfy requirements to acquire license on the first policy in the metadata.
                                                      If there are multiple policies in the metadata, only 1 of them need to be satisfied for the license request to
                                                      go through.                                          
                                             DRMPolicy* drmPolicy = NULL;
                                             for (id object in newMetadata.policies) {
                                                       DRMPolicy* drmPolicy = (DRMPolicy*)object;
                                                       break;
                                             if (drmPolicy == NULL)
                                                       /*          report error, this metadata is malformed. DRM metadata must contain at least 1 policy*/
                                             if (drmPolicy.authenticationMethod != ANONYMOUS)
    However, please note that the above only describes the DRM license handling for offline playback.  The actual playback of video using the Primetime client SDK is not officially supported.  You will have to use your own mechanism of saving and playback back HLS content locally within the application.
    Theoretically, it is possible to save the HLS stream to the app, and then embed an HTTP server to the app to stream the HLS content back into the application.  However, the Primetime client SDK doesn't not expose a way to do this directly, since it's not yet supported.
    cheers,
    /Eric.

    no, the headers, here's a picture of the headers on this page. When I use SEO for Firefox, it sees them on every other page but never on my iweb sites.
    Quickpost this image to Myspace, Digg, Facebook, and others!

  • Is the N97 Mail for Exchange or MfE 'provisionable...

    Background info:  I used to carry two phones, the N95 and the E51.  Before MfE 2.0 came out, MfE was not installable on the N95 (or any N series phones).  So I bought the E51 so that I can use MfE to have my corporate mail pushed to me.  Today, I'm the proud owner of the N97, with MfE 2.9.176 installed.  No more carrying 2 phones, and everything is synchronizing just fine.
    Last week, my company announced a new policy regarding mobile devices.  Soon, they will enforce new security policies as available in Exchange 2003 SP2.   This really got me worried, because I spent quite a lot of money in investing in the N97!
    We all know that Nokia states that only the E series devices fully support all security policies of Exchange servers.  (Nokia calls this 'provisionable' versus 'non-provisionable' devices.)  But here's the kicker.  In the Mail for Exchange Guide for Administrators (http://nds1.nokia.com/phones/files/guides/MfE_admin_guide_140709.pdf), in chapter 2, section 2, part 1 titled "Are your devices 'provisionable'?", it states the following:
    Eseries devices are provisionable
    Nseries devices previous to S60 3.0 Feature Pack 2 (FP2) are not provisionable
    Nseries devices after S60 3.0 FP2 may be provisionable
    Supported devices not designated Eseries or Nseries may or may not be provisionable.
    Well, that is kind of some good news.  But it left out key information regarding my N97, specifically S60 5.0.  Does anyone know if the N97 can be categorized together with those Nseries devices "after 3.0 FP2"?  Or can anyone identify specifically what security policies/features are provisionable in the N97 device?  This is important because I need to make the case with the IT management to put me in the exception list, if at all possible.  But I don't want to stir up anything until I know exactly what can or cannot be done with the N97.  This will be greatly appreciated.  Thank you very much.
    John
    John @ Chicago // 5160 (1999.07.20) > 7160 (2001.06.09) > 6340i (2003.04.26) > 6620 (2004.08.24) > 7610b (2005.05.08) > N91 (2006.06.07) > N95-3 (2007.09.28) > N95-3 #2 (2007.12.05) > E51 (2008.03.10) > N97 (2009.06.11) > N97 #2 (2009.09.11-warranty replacement) > N97 #3 (2009.12.10-warranty replacement) > N8 (2010.12.02) > N8 #2 (2010.12.11-retailer replacement) > 808 (2012.12.10) > X2 Dual Sim (2015.01.19-for motorcycle offline maps use only) %gt; 808 #2 (2015.01.26-manufacturer replacement)

    Not only is Nokia's myriad of different web sites each requiring its own login credentials, they also have a myriad of places to go get software.  I have always thought that http://www.businesssoftware.nokia.com will have all the latest enterprise software coming from Nokia, but no, that is not the case.  It turns out that http://europe.nokia.com/get-support-and-software/download-software/mail-for-exchange is the place to get the latest version.  Just select your device, and it'll give you the download link for the latest.
    Just so you know, even http://www.businesssoftware.nokia.com doesn't have N97 listed as a device yet.
    I really hope Nokia takes this consistency issue seriously just like how they're working on the consolidation of logins...
    John @ Chicago // 5160 (1999.07.20) > 7160 (2001.06.09) > 6340i (2003.04.26) > 6620 (2004.08.24) > 7610b (2005.05.08) > N91 (2006.06.07) > N95-3 (2007.09.28) > N95-3 #2 (2007.12.05) > E51 (2008.03.10) > N97 (2009.06.11) > N97 #2 (2009.09.11-warranty replacement) > N97 #3 (2009.12.10-warranty replacement) > N8 (2010.12.02) > N8 #2 (2010.12.11-retailer replacement) > 808 (2012.12.10) > X2 Dual Sim (2015.01.19-for motorcycle offline maps use only) %gt; 808 #2 (2015.01.26-manufacturer replacement)

  • I downloaded Lion and now 3 of my mail addresses are offline and I cannot access or send messages.  Any ideas?

    I downloaded Lion and now 3 of my mail addresses are offline and I cannot access or send messages.  Any ideas?

    If it's because you were using Office 2004, the eight year old version of Office that was written when Intel processors were not used in Macs, then there will be no fix. Lion dropped support for PowerPC applications, as has been widely reported since Lion's release last August.
    You can upgrade Office 2004 to Office 2008 or Office 2011. You can use iWorks 2009 that can open Microsoft files. You can use a number of free applications that are also capable of working with Microsoft documents. You can go back to Snow Leopard, if you have a backup. Or, if you have an external drive or room to add a partition to your current drive, you can install Snow Leopard on it.
    Search these forums for more information. If this is your issue, it's been posted and answered several times a day since August 2011.

  • Mail is offline and will not go online.

    Recently mail went offline and I can't get it to go online. i have a Mobile me account and 3 POP3 Accounts. First i deleted my accounts and re-entered my info, then i deleted the entire library/mail folder with the same result. I also tried to get my mobile me mail with Mozilla Thunderbird and the connection was simply refused. I can still get all my mail through a web browser and my Iphone so my user/pass information is correct. I'm sure someone has the same problem but I can't seem to find anything in 10,000 threads, any ideas?

    Thanks for the input!
    Well connection doctor says:
    1. mail was able to connect to the internet.
    2. Could not connect to the MobileNe IMAP server. Check your network connection and that you entered the correct information in the account prefs section. Also verify that the server supports SSL.
    3. Same for SMTPout: Could not connect to the MobileNe SMTP server. Check your network connection and that you entered the correct information in the account prefs section. Also verify that the server supports SSL.
    I tried connecting with Secure Socket Layer on and off with the same result.
    I know my password is correct since it's the same as the one i'm using for this appleID/support thread. I just tried to take all accounts online, quit and restart mail. Still no change. hmmmmmmmmm. When i hit check mail it plays the sound you get when there's no new messages on the server instead of giving me a unable to connect message.

Maybe you are looking for

  • Scrolling slow in a panel with 300 images

    Hi, I am using a panel which contains about 300 images (small icons). I covered this panel with a scroller, and when scrolling, it's very slow. when there are less images (about 50), it scrolls smoothly. Any suggestions ?   <s:Panel id="src"         

  • Sound Blaster Omni 5.1 - mute speaker and mic with single button push

    Does anyone know if its possible configure the Omni to mute both speakers and the Omni's internal mic with a single button push using the hardware volume/mute button on the Omni. I have a scenario where i need to mute both quickly when a call comes i

  • Can't Edit EPS File

    I am trying to edit an EPS file that another developer sent me but when I open it I see the objects but I can't select them or make edits to it. I attached the file, can someone look at it and see what I am overlooking please?

  • HT204057 My OS X.5.8 doesn't perform backup function to Time Machine

    I don't know why my Time Machine no longer performs the back-up function.  What can I do?

  • How to save input and output in file

    hi ni i have program that has some input and some output i try to save the input and output in file word office or excel like this error extended ideal value wq wp value xq xp 0.857143 0.7 0.6 2 0.5 1 1 thank in advace  best regards m.s lab view  201