We are using Godaddy email server. We are trying fetch emails using IMAP protocol . Following are my sample IMAP commands
a select inbox
a UID SEARCH FROM "user1@server.com"
Results are getting fine for above commands something like below
* SEARCH 501 505 342 229 191
a OK SEARCH done.
If I write equivalent Java code for above commands , I'm getting empty results. Following is Java code.
IMAPFolder inbox = store.getFolder("INBOX");
SearchTerm fromTerm = new FromTerm(new InternetAddress("user1@server.com"));
Message[] messages = inbox.search(fromTerm);
The generated IMAP command for above Java code is
a SEARCH FROM user1@server.com ALL
but UID is missing in above java generated command so I'm getting empty results . How to include UID while using with Java
Thanks
The UID tag in the SEARCH command indicates that UIDs should be returned instead of message sequence numbers. Since JavaMail primarily works with message sequence numbers, it doesn't support UID SEARCH. It uses the returned message sequence numbers to map to the corresponding Message objects. Nonetheless, the messages should be "found" independently of whether their UIDs or their message sequence numbers are returned. If the server is only returning results for UID SEARCH, the server is broken and you should report this server bug to GoDaddy.