Giter VIP home page Giter VIP logo

nioimapclient's Introduction

NioImapClient Build Status

High performance IMAP client in Java based on Netty

Maven Dependency

<dependency>
  <groupId>com.hubspot</groupId>
  <artifactId>NioImapClient</artifactId>
  <version>0.4</version>
</dependency>

Features

  • High performance, designed to handle many concurrent connections.
  • TLS supported out of the box
  • XOAUTH2 support
  • Support for most GMail IMAP extensions
  • Implemented RFCs
    • RFC 3501 (not all commands supported, but its easy to add new ones, PRs always welcome!)
    • RFC 2595 (TLS)
    • RFC 6154 (Special-Use list)

Limitations

  • Many commands are still not implemented (most command related to appending/updating messages are not implemented)
  • Pipelining of commands is not supported. It is hard to tell when the responses to these commands may be ambiguous, if you really need to execute concurrent commands we suggest simply opening multiple connections.
  • The client currently provides no facilities for tracking message sequence numbers, we rely more heavily on UIDs.
  • The server can send arbitrary untagged responses at any time, currently these get attached to the tagged response for the current command, this API needs improvement.

Future plans

(in no particular order)

  • RFC 5465 (NOTIFY)
  • RFC 2177 (IDLE)
  • RFC 2971 (ID)
  • Sequence number tracking
  • Full RFC 3501

Notes For Developers

  • NEVER execute blocking commands on an eventloop thread (i.e. CountDownLatch.await or Future.get)
    • Calls out to unknown functions (i.e. callbacks or event listeners) should always be done on isolated thread pools.
    • Slow but not necessarily blocking operations should also be avoided
  • Attempt to avoid doing long running tasks on event loop threads
  • Use new as sparingly as possible to avoid creating garbage:
    • Share objects when possible
    • Use netty bytebuf allocators when possible
    • Use netty recyclers for objects that can be recycled.

nioimapclient's People

Contributors

axiak avatar b3ross avatar brian5021 avatar cimmyv avatar hs-jenkins-bot avatar hubspot-dan avatar itscharlieb avatar jaredstehler avatar jhaber avatar krishtha avatar mjball avatar stevie400 avatar szabowexler avatar takahiromollenkamp avatar zklapow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nioimapclient's Issues

Unable to build on Fedora 28

Project can't be built on Fedora (and possibly on CentOS/RHEL too) due to compilation error:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] An unknown compilation problem occurred
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.915 s
[INFO] Finished at: 2018-07-18T14:00:24+02:00
[INFO] Final Memory: 36M/510M
[INFO] ------------------------------------------------------------------------

when I run maven using -X it yields root cause (stripped only to relevant part):

-g -target 1.8 -source 1.8 -encoding UTF-8 -bootclasspath /etc/alternatives/jre/jre/lib/rt.jar:/etc/alternatives/jre/jre/lib/jce.jar:/etc/alternatives/jre/../classes/classes.jar
[DEBUG] incrementalBuildHelper#beforeRebuildExecution
[INFO] Compiling 123 source files to /home/rkosegi/git/ezz/NioImapClient/target/classes
Fatal Error: Unable to find package java.lang in classpath or bootclasspath
[DEBUG] incrementalBuildHelper#afterRebuildExecution

Important part is /etc/alternatives/jre/jre/lib/rt.jar (jre is twice in path, actual path should be just /etc/alternatives/jre/lib/rt.jar).

This comes from basepom parent (maven compiler plugin configuration):

<plugin>
  <artifactId>maven-compiler-plugin</artifactId>
  <configuration>
    <compilerArguments children.combine="append">
      <bootclasspath>${project.jdk7.home}/lib/rt.jar:${project.jdk7.home}/jre/lib/jce.jar:${project.jdk7.home}/../classes/classes.jar</bootclasspath>
    </compilerArguments>
  </configuration>
</plugin>

Question here why you configure it that way?

Background Question - Antlr Removal

I am curious what drove you to remove Antlr - performance, overkill for parsing tasks needed, other? Feel free to close when you respond.

Could not download NioImapClient via Maven : Missing artifact

Hi ,
I'm trying to add NioImapClient as a maven dependency.

I tried

<dependency>
  <groupId>com.hubspot</groupId>
  <artifactId>NioImapClient</artifactId>
  <version>0.4-SNAPSHOT</version>
</dependency>

But I get the following error:

Missing artifact com.hubspot:NioImapClient:jar:0.4-SNAPSHOT

Can you please help me fix it ?

Several BODY[...] sections are parsed incorreclty

I'm trying to load a message with BODY[TEXT] and BODY[HEADER]:

imapClient.uidfetch(
   Set.of(106),
   FetchDataItemType.UID,
   new BodyPeekFetchDataItem("TEXT"),
   new BodyPeekFetchDataItem("HEADER")
)

According to the trace logs, everything is fine:

2021-01-06 17:44:29,651 [info] c.h.i.c.I.unknown-client - SEND: A002 UID FETCH 106 (BODY.PEEK[TEXT] BODY.PEEK[HEADER] UID)
...
2021-01-06 17:44:30,345 [info] c.h.i.p.R.unknown-client - RCV(FETCH): (UID 106 BODY[TEXT] {4043}
...
2021-01-06 17:44:30,347 [info] c.h.i.p.R.unknown-client - RCV(FETCH):  BODY[HEADER]
...

Not posting the whole log, because it's quite huge, but it's clear that the server returns both BODY[TEXT] and BODY[HEADER] sections.

However, the resulting ImapMessage object doesn't include text body. getBody returns org.apache.james.mime4j.dom.Multipart with 0 parts.

I debugged the code a bit. Looks like each of the sections is parsed separately, and then the "header" section overwrites the "text" section in the resulting ImapMessage. If I don't query header, there's no issue - the body contains the text.

I don't know if this can be fixed somehow with current ImapMessage implementation. It has only one body property, and it's not clear how to combine all the sections into a single org.apache.james.mime4j.dom.Message, but current behavior definitely looks wrong.

Could find classes ImapClientFactoryConfiguration and ImapClientConfiguration

Consider the following file com.hubspot.imap.ImapClientFactory.java

The constructor requires :

public ImapClientFactory() {
    this(ImapClientFactoryConfiguration.builder().build());
  }

ImapClientFactoryConfiguration class, but it could not be found.

Similary, the same file has the following code:

 public CompletableFuture<ImapClient> connect(ImapClientConfiguration clientConfiguration) {
    return connect("unknown-client", clientConfiguration);
  }

It requires the class ImapClientConfiguration.java. That class could also not be found.

These errors occur in lot of places in the code. These two classes could not be found in the source code. Can you please help me fix this ?

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.