Scala, IMAP, SearchTerm, AndTerm, FromStringTerm, SentDateTerm, FlagTerm, and FetchProfile

If you're looking for a simple Scala IMAP client tutorial/example, please follow that link, but if you're interested in some Scala source code that demonstrates IMAP searching with Scala, JavaMail, SearchTerm, AndTerm, FromStringTerm, SentDateTerm, FlagTerm, and FetchProfile, this source code may be for you.

In short, here's what the following Scala IMAP client does:

Ruby mail - find all unique email addresses in your inbox

Here's a sample Ruby mail program that I created that finds and prints all of the unique email addresses in my IMAP inbox. Hopefully the source code is readable enough that it doesn't need much description. The only hard part is trying to figure out how to get the email address from the Envelope, and that's only because the documentation is hard to find.

Ruby mail program

Here's my Ruby IMAP mail program source code:

Ruby mail example program - how to move IMAP email messages I've already read

Here's a Ruby mail program that I use to read my inbox, and move mail messages from a group of people that I have read to an IMAP folder that I have setup specifically for those people. The beauty of this is that I don't move the email messages I haven't read yet -- I just move the messages I have read.

Ruby mail example - search an IMAP mail server

Here is a Ruby mail program that I use to search my IMAP mailbox with combinations of search criteria. It is a mixture of several different Ruby-based approaches I found on the Internet for searching email systems.

Note that you don't need all the comments at the front as I've shown. It's just that I can't remember all the crazy flags that can be used, and at this time I'm not going to take the time to write a better mail system interface, although IMHO a better interface is surely needed.

Java mail IMAP list example - List all the email addresses in an IMAP mailbox

Java Mail (JavaMail) IMAP FAQ: Can you show me how to get a list of all the email addresses in an IMAP mailbox using the Java Mail API (JavaMail API)?

Sure. Here's the source code for a Java mail (JavaMail) program that extracts all of the "from" fields out of a specified mailbox. This works for both POP3 and IMAP mailboxes.

Before going to the code, note the cool use of a TreeSet (java.util.TreeSet) in this example. Based on our offline discussion, you mentioned that you really want is this: