Coder Social home page Coder Social logo

java-gmail-imap's People

Contributors

markmclaren avatar

Watchers

 avatar

java-gmail-imap's Issues

com.google.code.javax.mail.internet.MimeMessage.getContent() returns javax.mail.internet.MimeMultipart

What steps will reproduce the problem?
1. getContent Returns javax.mail.internet.MimeMultipart instead of 
com.google.code.javax.mail.internet.MimeMultipart

IMAPMessage(MimeMessage).getDataHandler() line: 1388    
IMAPMessage.getDataHandler() line: 681  
IMAPMessage(MimeMessage).getContent() line: 1419    

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.

It appears that getDataHander() is returning:
javax.activation.DataHandler

and MimeMessage has this import:

import javax.activation.*;


I'm happy if this is the expected behavior, just have to adapt code accordingly.

Original issue reported on code.google.com by [email protected] on 30 Sep 2011 at 11:15

Multipart ClassCast Exception

What steps will reproduce the problem?

1. Open up gmail connection
2. Try to view a multipart messsage

java.lang.ClassCastException: com.google.code.com.sun.mail.imap.IMAPInputStream 
cannot be cast to com.google.code.javax.mail.Multipart

Using trunk build

I am trying to better understand the problem and see if I can fix myself.


FYI: If I instead view the stream this is what I get:

Content Typemultipart/ALTERNATIVE; 
    boundary="----_=_NextPart_001_01C87ECD.9FF943C2"
Read: This is a multi-part message in MIME format.

------_=_NextPart_001_01C87ECD.9FF943C2
Content-Type: text/plain;
    charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

... contents of text/plain part ...

------_=_NextPart_001_01C87ECD.9FF943C2
Content-Type: text/html;
    charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

... contents of text/html part ...

------_=_NextPart_001_01C87ECD.9FF943C2--



Original issue reported on code.google.com by [email protected] on 18 Oct 2011 at 10:03

gimap oauth error

use lib version 
 * gimap-1.4.6
 * javax.mail-1.4.6
(https://maven.java.net/content/repositories/snapshots/ <-- Anywhere in the 
snapshot can not be found)

according http://code.google.com/p/google-mail-oauth2-tools/ link.

          Properties props = new Properties();
      props.put("mail.store.protocol", "gimaps");
      props.put("mail.gimaps.sasl.enable", "true");
      props.put("mail.gimaps.sasl.mechanisms", "XOAUTH2");
      //mail." + name + ".sasl.authorizationid
      props.put(OAuth2SaslClientFactory.OAUTH_TOKEN_PROP, oauthToken);

      Session session = Session.getDefaultInstance(props, null);
      session.setDebug(debug);
      GmailSSLStore store = (GmailSSLStore) session.getStore("gimaps");
      store.connect(host, port, userEmail, "");

The following error occurs.

java.lang.NoSuchMethodException: 
com.sun.mail.imap.protocol.IMAPSaslAuthenticator.<init>(com.sun.mail.imap.protoc
ol.IMAPProtocol, java.lang.String, java.util.Properties, boolean, 
java.io.PrintStream, java.lang.String) 




Original issue reported on code.google.com by [email protected] on 20 Feb 2013 at 12:03

Cannot connect to gmail

I've installed the latest version of you great lib in my code and want to 
connect to my gmail account. I have to have mail.jar in my code for others 
features and use your code for gmail access.

But it doesn't work correctly, I can't create an IMAPStore for gmail.

The problem is due to incorrect classname in provider creation. Your code is 
using javax.mail.Session for example instead of 
com.google.code.javax.mail.Session.

Here's the patch I've done to fix this problem. Note that I've only checked 
that patch for email retriving (with google id) on IMAP (with TLS or SSL) but 
no other function.

When could you release a new version of your lib with that patch (or a better 
one) ?

Regards,

Ludovic SMADJA


### Eclipse Workspace Patch 1.0
#P java-gmail-ext
Index: src/main/java/com/google/code/com/sun/mail/handlers/multipart_mixed.java
===================================================================
--- 
src/main/java/com/google/code/com/sun/mail/handlers/multipart_mixed.java    (revisi
on 9)
+++ 
src/main/java/com/google/code/com/sun/mail/handlers/multipart_mixed.java    (workin
g copy)
@@ -49,7 +49,7 @@

 public class multipart_mixed implements DataContentHandler {
     private ActivationDataFlavor myDF = new ActivationDataFlavor(
-       javax.mail.internet.MimeMultipart.class,
+       MimeMultipart.class,
        "multipart/mixed", 
        "Multipart");

Index: src/main/java/com/google/code/javax/mail/Session.java
===================================================================
--- src/main/java/com/google/code/javax/mail/Session.java   (revision 9)
+++ src/main/java/com/google/code/javax/mail/Session.java   (working copy)
@@ -787,7 +787,7 @@

    // construct an instance of the class
    try {
-       Class[] c = {javax.mail.Session.class, javax.mail.URLName.class};
+       Class[] c = {Session.class, URLName.class};
        Constructor cons = serviceClass.getConstructor(c);

        Object[] o = {this, url};
Index: src/main/java/com/google/code/com/sun/mail/handlers/message_rfc822.java
===================================================================
--- 
src/main/java/com/google/code/com/sun/mail/handlers/message_rfc822.java (revisio
n 9)
+++ 
src/main/java/com/google/code/com/sun/mail/handlers/message_rfc822.java (working
 copy)
@@ -56,7 +56,7 @@
 public class message_rfc822 implements DataContentHandler {

     ActivationDataFlavor ourDataFlavor = new ActivationDataFlavor(
-   javax.mail.Message.class,
+   Message.class,
    "message/rfc822", 
    "Message");

Index: src/main/java/com/google/code/com/sun/mail/pop3/POP3Store.java
===================================================================
--- src/main/java/com/google/code/com/sun/mail/pop3/POP3Store.java  (revision 9)
+++ src/main/java/com/google/code/com/sun/mail/pop3/POP3Store.java  (working 
copy)
@@ -153,7 +153,7 @@
            messageClass = Class.forName(s);
        }

-       Class[] c = {javax.mail.Folder.class, int.class};
+       Class[] c = {Folder.class, int.class};
        messageConstructor = messageClass.getConstructor(c);
        } catch (Exception ex) {
        if (debug)

Original issue reported on code.google.com by [email protected] on 1 Sep 2011 at 3:33

Q: Standard Message-Id header search w/ GMAil IMAP?

Do you guys know anything about the standard Message-Id header search w/ GMAil 
IMAP?

http://stackoverflow.com/questions/9589583/imap-search-header-command-failing-wh
en-search-text-contains-exclamation-mark

GMAil treats the ids very strangely as if it expects some kind of a regex.

Thank you

Original issue reported on code.google.com by [email protected] on 5 Dec 2012 at 1:24

Unable to search using UTF-8 text

What steps will reproduce the problem?
1. Create a email with UTF-8 characters in the subject (I'm using Korean)
2. SearchTerm searchTerm = new GmailRawSearchTerm("\"" + subject + "\"");
3. Message[] ms = folder.search(searchTerm);

What is the expected output? What do you see instead?
Expect to find the message.   None are found

What version of the product are you using? On what operating system?
java-gmail-imap-1.4.4-gm-ext-0.5.jar
Windows 7

Please provide any additional information below.

I found this post: 
https://groups.google.com/forum/#!msg/google-mail-xoauth-tools/5B_lwWFYbDw/zVkjq
3Ds6EEJ
.. which gives an example of sending the command: 
search charset utf-8 X-GM-RAW

So, I implemented my own version of GmailRawSearchTerm that returns "charset 
utf-8 X-GM-RAW" for getSearchAttribute(), but that resulted in:  BAD Could not 
parse command

Original issue reported on code.google.com by [email protected] on 11 Oct 2012 at 9:20

NoSuchProviderException: imap

1) What steps will reproduce the problem?

   Properties props = System.getProperties();
   props.setProperty("mail.store.protocol", "imaps");
   try {   Session session = Session.getDefaultInstance(props, null);
   URLName urlName = new       
           URLName("imap://[email protected]:[email protected]");
   Store store2 = session.getStore(urlName);

2) What is the expected output? What do you see instead?

   com.google.code.javax.mail.NoSuchProviderException: imap
    at com.google.code.javax.mail.Session.getService(Session.java:798)
    at com.google.code.javax.mail.Session.getStore(Session.java:578)
    at com.google.code.javax.mail.Session.getStore(Session.java:540)
    at com.google.code.javax.mail.Session$getStore.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
    at ustodo.mail.T110923_Imap_3_GoogleCode_Tests.test1(T110923_Imap_3_GoogleCode_Tests.groovy:33)

3) What version of the product are you using? On what operating system?
1.4.4    Mac OS/X 10.6/7

4) Please provide any additional information below.

Sorry I have no additional info ... is there sample code I could reference? 

Thank you!!!!



Original issue reported on code.google.com by [email protected] on 22 Sep 2011 at 10:03

Class problem

What steps will reproduce the problem?
1. created java project in eclipse and brought in source code
2. compiler error:
Description Resource    Path    Location    Type
javax.mail cannot be resolved to a 
type    MimeUtility.java    /javamail-gmail/src/com/google/code/javax/mail/internet li
ne 1239 Java Problem


Note, I also saw an error when I tried to use it in a program where it failed 
to load that class.

What is the expected output? What do you see instead?
I just changed:
        InputStream is = 
            javax.mail.internet.MimeUtility.class.getResourceAsStream(
to:
        InputStream is = 
            com.google.code.javax.mail.internet.MimeUtility.class.getResourceAsStream(


What version of the product are you using? On what operating system?

Mac 10.7

Code checked out at revision 12
Path: .
URL: http://java-gmail-imap.googlecode.com/svn
Repository Root: http://java-gmail-imap.googlecode.com/svn
Repository UUID: c400526f-0b74-0b6f-9afc-588b30180218
Revision: 12
Node Kind: directory
Schedule: normal
Last Changed Author: [email protected]
Last Changed Rev: 12
Last Changed Date: 2011-09-22 15:15:59 -0700 (Thu, 22 Sep 2011)


Please provide any additional information below.

Here was the stack trace I got:

java.lang.NoClassDefFoundError: javax/mail/internet/MimeUtility
    at com.google.code.javax.mail.internet.MimeUtility.<clinit>(MimeUtility.java:1238)
    at com.google.code.com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:123)
    at com.google.code.com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:632)
    at com.google.code.javax.mail.Service.connect(Service.java:295)
    at com.sevogle.common.imap.ImapAgentImpl.initializeImapConnection(ImapAgentImpl.java:404)
    at com.sevogle.common.imap.ImapAgentImpl.startupImap(ImapAgentImpl.java:144)
    at com.sevogle.common.imap.ImapAgentImpl.start(ImapAgentImpl.java:107)
    at com.sevogle.hatter.connector.gmail.GmailProcessor.startAgent(GmailProcessor.java:231)
    at com.sevogle.hatter.connector.gmail.GmailProcessor.updateAgentState(GmailProcessor.java:181)
    at com.sevogle.hatter.connector.gmail.GmailProcessor.onExtensionUpdated(GmailProcessor.java:77)
    at com.sevogle.common.extension.impl.MessageChannelProcessorImpl.updateExtension(MessageChannelProcessorImpl.java:256)
    at com.sevogle.common.extension.impl.MessageChannelProcessorImpl$ExtensionUpdated.doWork(MessageChannelProcessorImpl.java:391)
    at com.sevogle.common.extension.impl.MessageChannelProcessorImpl$WorkRunner.run(MessageChannelProcessorImpl.java:317)
    at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.ClassNotFoundException: javax.mail.internet.MimeUtility
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 14 more

(sorry if this was intentional and you are supposed to have javamail also 
available for this.)

Original issue reported on code.google.com by [email protected] on 30 Sep 2011 at 7:37

Location of source code for 1.4.4-gm-ext-0.5 version?

I would like the source code for the 1.4.4-gm-ext-0.5 version so I can add that 
as a maven sources jar to my maven build environment. 

I tried to find this in the SVN source link but the trunk there has a much 
older version.  I am wondering where I can find the code that made the 0.5 jar.

Original issue reported on code.google.com by [email protected] on 18 Apr 2012 at 1:53

Possible issue/concern regarding the fetching of x-gm-labels

Hello Mark,

While I was coding for my project, using java-gmail-imap, I came across an 
issue which, in my opinion, is important.

The issue can be easily reproduced as I explain below:

1. Fetch x-gm-labels for an email.
2. Change this email's labels using some other client (the gmail web client is, 
of course, the obvious way)
3. Re-fetch x-gm-labels for the email.
4. No changes appear to have happened to the email's labels.

I traced this error and I discovered that actually no FETCH command is sent to 
the gmail server in step 3.
This happens because FetchProfileCondition.test(IMAPMessage m) called from 
Utility.toMessageSet() during the execution of IMAPMessage.fetch returns false.

This actually happens because the condition in the 'if' below...

1035    if (needXGmLabels && m.getGoogleMessageLabels() == null)
1036         return true;

... is always false for any message in the messageCache for which we have 
already fetched x-gm-labels. 

A simple solution is to remove the m.getGoogleMessageLabels() == null 
condition. By doing this, everything works fine. 

My opinion is that because x-gm-labels is an attribute that COULD change by 
another client during a session (unlike headers, envelope, size, UID, 
x-gm-msgid etc.) the m.getGoogleMessageLabels() == null condition should be 
removed.

I'm looking forward to hearing your opinion on this.

Best wishes,
Stefanos

Original issue reported on code.google.com by [email protected] on 26 Nov 2011 at 7:36

Conflicts arise when both javamail.jar and java-gmail-imap.jar used in the same project

What version of the product are you using? On what operating system?
java-gmail-imap-1.4.4-gm-ext-0.3.jar, Windows XP

Please provide any additional information below.

I created a project named MailHandler which uses java-gmail-imap.jar to import 
gmail messages and to send messages to gmail. Some other external libraries i'm 
using (gdata or apache library jar) in the same project uses 
javax.mail.MessagingException class. For that, i included javamail.jar in the 
same project. After that, sending messages functionality is not working.

How can this issue be resolved?

Original issue reported on code.google.com by [email protected] on 2 Jan 2012 at 8:50

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.