Package javax.mail

Examples of javax.mail.FetchProfile


      if (DebugFile.trace) DebugFile.writeln("Folder.getMessages("+String.valueOf(iTotalCount)+")");

      Message[] aMsgsObj = oFldr.getMessages();

      FetchProfile oFtchPrfl = new FetchProfile();
      oFtchPrfl.add(FetchProfile.Item.ENVELOPE);
      oFtchPrfl.add(FetchProfile.Item.CONTENT_INFO);
      oFtchPrfl.add(FetchProfile.Item.FLAGS);
      oFtchPrfl.add("X-Priority");
      oFtchPrfl.add("X-Spam-Flag");

      if (DebugFile.trace) {
        DebugFile.writeln("Folder.fetch(Message[], ENVELOPE & CONTENT_INFO & FLAGS)");
        oChMeter.start();
      }
View Full Code Here


         // Attributes & Flags for all messages ..
         Message[] msgs = folder.getMessages();

         // Use a suitable FetchProfile
         FetchProfile fp = new FetchProfile();
         fp.add(FetchProfile.Item.ENVELOPE);
         fp.add(FetchProfile.Item.FLAGS);
         fp.add("X-Mailer");
         folder.fetch(msgs, fp);

         for (int i = 0; i < msgs.length; i++) {
            int level = 0;
            System.out.println("\n=========MESSAGE #" + (i + 1) + ":=================");
View Full Code Here

            addResult(aFolder);

            Message[] messages = aFolder.getMessages();

            // Use a suitable FetchProfile
            FetchProfile fp = new FetchProfile();
            fp.add(FetchProfile.Item.ENVELOPE);
            fp.add(FetchProfile.Item.FLAGS);
            fp.add("X-Mailer");
            aFolder.fetch(messages, fp);

            // add all messages to the result
            addResult(messages);
View Full Code Here

  private static void fetchHeaderInfo(RewriteContext hr,Message[] msgs,
                                      EmailConnection tmpEmailConn,
                                      String headerlist) throws MessagingException {

    Properties props = hr.request.props;
    FetchProfile fp = new FetchProfile();
    StringBuffer msgindex = new StringBuffer();
    String connHandle = getConnHandle(hr);
    StringTokenizer headerNames;
    String msgNum;
    long startmillis,endmillis;

    /* Build the prefetch profile */

    startmillis = System.currentTimeMillis();

    if (headerlist != null) {
      headerNames = new StringTokenizer(headerlist,", ");

      fp.add(FetchProfile.Item.FLAGS);

      while (headerNames.hasMoreTokens()) {
        fp.add(headerNames.nextToken());
      }
    } else {
      hr.request.log(Server.LOG_DIAGNOSTIC,connHandle,"no header list specified" +
                     " - retrieving all headers");

      fp.add(FetchProfile.Item.FLAGS);
      fp.add(FetchProfile.Item.ENVELOPE);
      fp.add(FetchProfile.Item.CONTENT_INFO);
    }

    /* Do a prefetch of the header/envelope information */

    tmpEmailConn.currentFolder.getFolder().fetch(msgs,fp);
View Full Code Here

     * @param folder   the folder to fetch messages from
     * @param messages the messages to fetch
     * @throws MessagingException in case of JavMail errors
     */
    protected void fetchMessages(Folder folder, Message[] messages) throws MessagingException {
        FetchProfile contentsProfile = new FetchProfile();
        contentsProfile.add(FetchProfile.Item.ENVELOPE);
        contentsProfile.add(FetchProfile.Item.CONTENT_INFO);
        contentsProfile.add(FetchProfile.Item.FLAGS);
        folder.fetch(messages, contentsProfile);
    }
View Full Code Here

  {
    if (_holdsMessages)
    {
      if (_messageListModel == null)
      {
        FetchProfile fetchProfile = new FetchProfile();
        fetchProfile.add(FetchProfile.Item.ENVELOPE);
        fetchProfile.add(FetchProfile.Item.FLAGS);
        _messageListModel = new MessageDataModel(_folder,
                                                 fetchProfile,
                                                 _MESSAGE_LOAD_BLOCK_SIZE);
      }
View Full Code Here

            addResult(aFolder);

            Message[] messages = aFolder.getMessages();

            // Use a suitable FetchProfile
            FetchProfile fp = new FetchProfile();
            fp.add(FetchProfile.Item.ENVELOPE);
            fp.add(FetchProfile.Item.FLAGS);
            fp.add("X-Mailer");
            aFolder.fetch(messages, fp);

            // add all messages to the result
            addResult(messages);
View Full Code Here

            addResult(aFolder);

            Message[] messages = aFolder.getMessages();

            // Use a suitable FetchProfile
            FetchProfile fp = new FetchProfile();
            fp.add(FetchProfile.Item.ENVELOPE);
            fp.add(FetchProfile.Item.FLAGS);
            fp.add("X-Mailer");
            aFolder.fetch(messages, fp);

            // add all messages to the result
            addResult(messages);
View Full Code Here

                return;
            }

            // get all messages
            Message[] messages = folder.search(new FlagTerm(new Flags(Flags.Flag.SEEN), false));
            FetchProfile profile = new FetchProfile();
            profile.add(FetchProfile.Item.ENVELOPE);
            profile.add(FetchProfile.Item.FLAGS);
            profile.add("X-Mailer");
            folder.fetch(messages, profile);

            // process each message
            for (Message message: messages) {
                // process each un-read message
View Full Code Here

 
  private void prefetchMessages( Folder folder, Message[] msgList ) throws MessagingException
  {
    // Prefetch all the key information and headers
   
    FetchProfile fp = new FetchProfile();
    fp.add( FetchProfile.Item.ENVELOPE );
   
        for (String PREFETCH_HEADER : PREFETCH_HEADERS) {
            fp.add(PREFETCH_HEADER);
        }
    folder.fetch( msgList, fp );
  }
View Full Code Here

TOP

Related Classes of javax.mail.FetchProfile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.