This project is just a parent POM for all other Java projects in "jcabi family".
See www.jcabi.com website for more details.
Object-Oriented Email Sending Java SDK
Home Page: http://email.jcabi.com
License: Other
This project is just a parent POM for all other Java projects in "jcabi family".
See www.jcabi.com website for more details.
Please, publish a new release 1.7 (or higher). Don't forget to update us here regularly (at least once a week), as explained in this article.
@dmarkov Looks like we need to add .gitattributes to force EOL of the repo.
Currently Travis build does not work for Java 6 on Travis (log from master branch), as Qulice requires at least Java 7:
Caused by: java.lang.UnsupportedClassVersionError: com/puppycrawl/tools/checkstyle/api/CheckstyleException : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:401)
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:254)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
at com.qulice.maven.DefaultValidatorsProvider.external(DefaultValidatorsProvider.java:66)
at com.qulice.maven.CheckMojo.run(CheckMojo.java:82)
at com.qulice.maven.CheckMojo.doExecute(CheckMojo.java:59)
at com.qulice.maven.AbstractQuliceMojo.execute(AbstractQuliceMojo.java:175)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
... 20 more
Let's update project to Java 7 and remove failing Travis build.
Moreover, let's do typical Java 6 - > Java 7 migration steps: use diamond operator, try-with-resources, etc.
Currently the method
private boolean intersect(final Address[] first, final Address[] second, final String msg)
Is really huge and bluntly implemented.
It can be refactored to contain only a couple lines using Collections.retainAll()
.
I tried it and the tests passed fine.
private boolean intersect(final Address[] first, final Address[] second,
final String msg) {
Collection<Address> firstCollection = new ArrayList<Address>(Arrays.asList(first));
firstCollection.retainAll(Arrays.asList(second));
boolean intersects = !firstCollection.isEmpty();
if(intersects) {
Logger.info(
this,
"Address(es) %s exist in both %s",
firstCollection.toString(),msg
);
}
return intersects;
}
Currently for all parts used harcoded charset UTF-8
, but sometimes I want to use another charset.
Copyright sections still feature 2014 as a year.
Below are execution logs:
ip-192-168-3-104:jcabi-email roman$ mvn qulice:check -Pqulice
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jcabi-email 2.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- qulice-maven-plugin:0.10:check (default-cli) @ jcabi-email ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.136s
[INFO] Finished at: Tue Jan 13 15:10:51 MSK 2015
[INFO] Final Memory: 11M/113M
[INFO] ------------------------------------------------------------------------
[ERROR] Internal error: java.lang.NullPointerException -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException
at org.apache.maven.lifecycle.internal.BuilderCommon.handleBuildError(BuilderCommon.java:128)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:95)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.NullPointerException
at org.codehaus.plexus.component.configurator.converters.composite.CollectionConverter.fromChildren(CollectionConverter.java:157)
at org.codehaus.plexus.component.configurator.converters.composite.CollectionConverter.fromConfiguration(CollectionConverter.java:112)
at org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:289)
at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:161)
at org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:56)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields(DefaultMavenPluginManager.java:567)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:529)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
... 16 more
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException
ip-192-168-3-104:jcabi-email roman$ mvn -version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 17:51:28+0400)
Maven home: /Users/roman/apache-maven-3.0.5
Java version: 1.8.0_25, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre
Default locale: ru_RU, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.5", arch: "x86_64", family: "mac"
Following your example:
Postman postman = new Postman.Default(
new SMTP("smtp.gmail.com", 465, user, pass)
);
I get
javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1
And telnet smtp.gmail.com 465
works just fine.
I cannot specify more than one to, bcc, or cc address when constructing an Envelope
.
Each implementation of Stamp
(StRecipient
, StCC
, StBCC
) calls message.setReceipient()
which effectively overwrites all previous recipients. They should instead call addRecipient()
.
mvn qulice:check -Pqulice
Line does not match expected header line of ' * BSD License'. (HeaderCheck)
messages.This is a known bug of qulice configuration in parent-0.31 (jcabi/jcabi-parent#19), accessed via jcabi-0.16. Suggested action is waiting until jcabi/jcabi#297 fix is released and upgrading jcabi version.
/**
* Guava cache.
*/
@SuppressWarnings("PMD.UnusedPrivateField")
private static final Cache<Envelope, Message> CACHE = CacheBuilder.newBuilder()
.expireAfterWrite(1L, TimeUnit.HOURS).build();
This constant is in use. The @SuppressWarnings
annotation is not needed.
Would be nice to have a new ctor Envelope.MIME(envelope)
. Its argument should be of type Envelope
.
Let's create a new class StHeader
, which will add a header to the email message
.
There is no estimate in the project yet. We have to create one as explained here
We have to return back the default ctor of SMTP, which was removed in #34
[ERROR] \src\test\java\com\jcabi\email\enclosure\EnPlainTest.java[2]: Line
does not correspond to the expected header line ' * BSD License'. (HeaderCheck)
[ERROR] \src\test\java\com\jcabi\email\enclosure\package-info.java[1]: Header
is missing - the file has not enough lines. (HeaderCheck)
Please make sure that mvn qulice:check -Pqulice
runs without errors on files, which were not changed.
Part of the solution: Include <license>file:${basedir}/LICENSE.txt</license>
in the configuration of the qulice-maven-plugin
plugin in pom.xml
.
./jcabi-email>mvn qulice:check -Pqulice
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.qulice:qulice-maven-plugin:0.13:check (default-cli) on project jcabi-email: Failure: The provided XML C:\javaworkspace\jcabi-email\src\site\site.xml is not well formatted, it should look like this:
[ERROR] <!--
[ERROR] * Copyright (c) 2014-2015, jcabi.com
[ERROR] * All rights reserved.
[ERROR] *
[ERROR] * Redistribution and use in source and binary forms, with or without
[ERROR] * modification, are permitted provided that the following conditions
[ERROR] * are met: 1) Redistributions of source code must retain the above
[ERROR] * copyright notice, this list of conditions and the following
[ERROR] * disclaimer. 2) Redistributions in binary form must reproduce the above
[ERROR] * copyright notice, this list of conditions and the following
[ERROR] * disclaimer in the documentation and/or other materials provided
[ERROR] * with the distribution. 3) Neither the name of the jcabi.com nor
[ERROR] * the names of its contributors may be used to endorse or promote
[ERROR] * products derived from this software without specific prior written
[ERROR] * permission.
[ERROR] *
[ERROR] * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
[ERROR] * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
[ERROR] * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
[ERROR] * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
[ERROR] * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
[ERROR] * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
[ERROR] * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
[ERROR] * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
[ERROR] * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
[ERROR] * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
[ERROR] * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
[ERROR] * OF THE POSSIBILITY OF SUCH DAMAGE.
[ERROR] --><project xmlns="http://maven.apache.org/DECORATION/1.3.0"
[ERROR] xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
[ERROR] xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0 http://maven.apache.org/xsd/decoration-1.3.0.xsd"
[ERROR] name="jcabi-email">
[ERROR] <skin>
[ERROR] <groupId>com.jcabi</groupId>
[ERROR] <artifactId>jcabi-maven-skin</artifactId>
[ERROR] <version>1.5.1</version>
[ERROR] </skin>
[ERROR] <bannerLeft>
[ERROR] <name>jcabi</name>
[ERROR] <src>http://img.jcabi.com/logo-square.svg</src>
[ERROR] <href>http://www.jcabi.com/</href>
[ERROR] <width>64</width>
[ERROR] <height>64</height>
[ERROR] </bannerLeft>
[ERROR] <googleAnalyticsAccountId>UA-1963507-23</googleAnalyticsAccountId>
[ERROR] <body>
[ERROR] <head>
[ERROR] <link href="http://img.jcabi.com/favicon.ico" rel="shortcut icon"/>
[ERROR] <link href="https://plus.google.com/u/0/114792568016408327418?rel=author"
[ERROR] rel="author"/>
[ERROR] </head>
[ERROR] <menu name="Overview">
[ERROR] <item name="Introduction" href="./index.html"/>
[ERROR] <item name="JavaDoc ${project.version}"
[ERROR] href="./apidocs-${project.version}/index.html"/>
[ERROR] <item name="Test coverage" href="./cobertura/index.html"/>
[ERROR] <item name="Release History" href="https://github.com/jcabi/jcabi-email/releases"/>
[ERROR] </menu>
[ERROR] <menu ref="reports"/>
[ERROR] </body>
[ERROR] </project>
[ERROR] patch:
[ERROR] --- before
[ERROR] +++ after
[ERROR] @@ -1,6 +1,5 @@
[ERROR] -<?xml version="1.0"?>
[ERROR] <!--
[ERROR] * Copyright (c) 2014-2015, jcabi.com
[ERROR] * All rights reserved.
[ERROR] *
[ERROR] * Redistribution and use in source and binary forms, with or without
[ERROR] @@ -25,15 +24,14 @@
[ERROR] * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
[ERROR] * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
[ERROR] * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
[ERROR] * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
[ERROR] * OF THE POSSIBILITY OF SUCH DAMAGE.
[ERROR] - -->
[ERROR] -<project xmlns="http://maven.apache.org/DECORATION/1.3.0"
[ERROR] - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
[ERROR] - xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0 http://maven.apache.org/xsd/decoration-1.3.0.xsd"
[ERROR] - name="jcabi-email">
[ERROR] + --><project xmlns="http://maven.apache.org/DECORATION/1.3.0"
[ERROR] + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
[ERROR] + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0 http://maven.apache.org/xsd/decoration-1.3.0.xsd"
[ERROR] + name="jcabi-email">
[ERROR] <skin>
[ERROR] <groupId>com.jcabi</groupId>
[ERROR] <artifactId>jcabi-maven-skin</artifactId>
[ERROR] <version>1.5.1</version>
[ERROR] </skin>
[ERROR] @@ -46,17 +44,18 @@
[ERROR] </bannerLeft>
[ERROR] <googleAnalyticsAccountId>UA-1963507-23</googleAnalyticsAccountId>
[ERROR] <body>
[ERROR] <head>
[ERROR] <link href="http://img.jcabi.com/favicon.ico" rel="shortcut icon"/>
[ERROR] - <link href="https://plus.google.com/u/0/114792568016408327418?rel=author" rel="author"/>
[ERROR] + <link href="https://plus.google.com/u/0/114792568016408327418?rel=author"
[ERROR] + rel="author"/>
[ERROR] </head>
[ERROR] <menu name="Overview">
[ERROR] <item name="Introduction" href="./index.html"/>
[ERROR] - <item name="JavaDoc ${project.version}" href="./apidocs-${project.version}/index.html"/>
[ERROR] + <item name="JavaDoc ${project.version}"
[ERROR] + href="./apidocs-${project.version}/index.html"/>
[ERROR] <item name="Test coverage" href="./cobertura/index.html"/>
[ERROR] <item name="Release History" href="https://github.com/jcabi/jcabi-email/releases"/>
[ERROR] </menu>
[ERROR] <menu ref="reports"/>
[ERROR] </body>
[ERROR] </project>
[ERROR] -
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
java.lang.NullPointerException
at java.util.Arrays$ArrayList.<init>(Arrays.java:2842)
at java.util.Arrays.asList(Arrays.java:2828)
at com.jcabi.email.Postman$1.send(Postman.java:88)
Email subject can't be NULL
Does a 1.8 release exist? I'm hoping to use this library for a project, but need the StReplyTo
class added in 1.8.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.github/workflows/codecov.yml
actions/checkout v4
actions/setup-java v4
actions/cache v3
codecov/codecov-action v4.0.0-beta.3
ubuntu 22.04
.github/workflows/mvn.yml
actions/checkout v4
actions/setup-java v4
actions/cache v3
.github/workflows/pdd.yml
actions/checkout v4
ubuntu 22.04
.github/workflows/xcop.yml
actions/checkout v4
ubuntu 22.04
pom.xml
com.jcabi:jcabi 1.38.0
com.sun.activation:javax.activation 1.2.0
javax.activation:activation 1.1.1
com.sun.mail:javax.mail 1.6.2
com.icegreen:greenmail 1.5.0
org.slf4j:slf4j-reload4j 2.0.13
log4j:log4j 1.2.17
Review our existing source code and all other technical artifacts and report at least 8 bugs. More about such reviews you can read here. The task will be closed once we have that bugs reported and classified. Don't forget to add itr
tag to each of them.
I found in source code:
SMTP.java
@Override
public Transport connect() throws IOException {
final Properties props = new Properties();
props.setProperty("mail.smtp.auth", "true");
final Session session = Session.getInstance(props);
try {
final Transport transport = session.getTransport("smtp");
transport.connect(this.host, this.port, this.user, this.password);
Logger.info(
this, "sending email through %s:%s as %s...",
this.host, this.port, this.user
);
return transport;
} catch (final MessagingException ex) {
throw new IOException(ex);
}
}
How can I add one more property to session?
Hi,
I tried to use jcabi-mail and I found this issue:
When i tried to do this:
Postman postman = new Postman.Default(
new SMTP("smtp.googlemail.com", 465, "username", "password"));`
I got this:
Error:(55, 47) java: constructor SMTP in class com.jcabi.email.wire.SMTP cannot be applied to given types;
required: javax.mail.Session
found: java.lang.String,int,java.lang.String,java.lang.String
reason: actual and formal argument lists differ in length.
Because the constructor for STMP is this:
` /**`
` * Public ctor.`
` * @param sess Session.`
` */`
` public SMTP(final Session sess) {`
` this.session = sess;`
` }`
Please, i need your support.
Thanks!
I'm doing this:
postman.send(
new Envelope.MIME().with(
new EnHTML("<html><body>привет</body></html>")
)
);
When this email arrives, the text is broken. Looks like we're doing something wrong with unicode. Let's try to reproduce this and fix.
Puzzle 36-3609fbd6
in src/main/java/com/jcabi/email/Protocol.java:100-104
has to be resolved: Write unit test for email sending with SMTPS protocol using Greenmail mock server (see http://www.icegreen.com/greenmail/ for Greenmail docs and example code). SMTPS was implemented in ticket #33 but was not unit tested since the previous mock server (Dumbster) did not support SSL.... The puzzle was created by amihaiemil on 26-Apr-2016.
If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code.
Working on Netbout I created a class StReplyTo similar to existing StSender, StRecipient etc.
Right place for this class is here. So let's move it from Netbout to here.
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.