[
https://issues.apache.org/jira/browse/GERONIMO-6551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15106827#comment-15106827
]
Romain Manni-Bucau commented on GERONIMO-6551:
----------------------------------------------
you can have a try with "official" javamail implementation which has hacks for
yahoo but seems yahoo is really broken:
https://java.net/projects/javamail/pages/Yahoo
I tried registering a custom IMAPStore:
{code}
public class YahooIMAPStore extends IMAPSSLStore {
public YahooIMAPStore(final Session session, final URLName urlName) {
super(session, urlName);
// recreate the pool
try {
connectionPool.close();
} catch (final MessagingException e) {
// no-op
}
connectionPool = new IMAPConnectionPool(this, props) {
@Override
protected IMAPConnection createPoolConnection() throws
MessagingException {
final IMAPConnection connection = new IMAPConnection(props,
this) {
@Override
protected boolean login() throws MessagingException {
// this is what we want to override!
try {
outputStream.write(" id (\"GUID\"
\"1\")\r\n".getBytes());
outputStream.flush();
// not sexy but it is the idea, in practise
should be done like in sendCommand(xxx)
while (!new
String(reader.readData()).contains("OK completed")) {
}
} catch (final IOException e) {
throw new MessagingException(e.getMessage(), e);
}
return super.login();
}
};
//
// now it is a simple copy of createPoolConnection()
//
if (!connection.protocolConnect(host, port, authid, realm,
username, password)) {
// we only add live connections to the pool. Sever the
connections and
// allow it to go free.
connection.closeServerConnection();
return null;
}
// add this to the master list. We do NOT add this to the
// available queue because we're handing this out.
synchronized(this) {
// uh oh, we closed up shop while we were doing
this...clean it up a
// get out of here
if (closed) {
connection.close();
throw new StoreClosedException(store, "No Store
connections available");
}
poolConnections.add(connection);
}
// return that connection
return connection;
}
};
}
}
{code}
with META-INF/javamail.providers containing
{code}protocol=imaps; type=store; class=org.rmannibucau.test.YahooIMAPStore;
vendor=rmannibucau; version=0.1-alpha{code}
but it doesnt really help
> Unable to get message from MessageIDTerm for Yahoo IMAP profile
> ---------------------------------------------------------------
>
> Key: GERONIMO-6551
> URL: https://issues.apache.org/jira/browse/GERONIMO-6551
> Project: Geronimo
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: mail
> Environment: TomEE
> Reporter: aurelien leboulanger
>
> I am trying to get IMAP message from message ID with Yahoo IMAP server
> imap.mail.yahoo.com, inbox.search() is returning null.
> {code:java}
> Message[] msgs = null;
> MessageIDTerm[] searArr = new MessageIDTerm[]{new MessageIDTerm((String)
> strMessageID)};
> if (inbox != null && inbox.isOpen()) {
> msgs = inbox.search(searArr[0]);
> }
> for (int i = 0; i < msgs.length; i++) {
> System.out.println("Message: " + msgs[i]);
> }
> {code}
> I also try to use HeaderTerm for the search without more success.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)