hubspot / nioimapclient Goto Github PK
View Code? Open in Web Editor NEWHigh performance, async IMAP client implementation
License: Apache License 2.0
High performance, async IMAP client implementation
License: Apache License 2.0
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 ?
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.
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 ?
I am curious what drove you to remove Antlr - performance, overkill for parsing tasks needed, other? Feel free to close when you respond.
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.