davidmoten / subethasmtp

SubEtha SMTP is a Java library for receiving SMTP mail
Other
149 stars 40 forks source link

Add custom success return on data command #10

Closed diegosalvi closed 5 years ago

diegosalvi commented 5 years ago

Added the capability to return a custom message as data result different from "250 OK" (Example: return "250 OK. Message equeued as xxxx").

This patch breaks public interfaces. If not acceptable I can change it to support older interface and older custom implementations using default interface methods (but it will neel Java8 compatibility... BTW Java8 itself is EOL)

codecov-io commented 5 years ago

Codecov Report

Merging #10 into master will increase coverage by 0.63%. The diff coverage is 87.8%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #10      +/-   ##
============================================
+ Coverage     64.79%   65.42%   +0.63%     
- Complexity      310      322      +12     
============================================
  Files            59       60       +1     
  Lines          1778     1822      +44     
  Branches        170      177       +7     
============================================
+ Hits           1152     1192      +40     
- Misses          539      542       +3     
- Partials         87       88       +1
Impacted Files Coverage Δ Complexity Δ
.../java/org/subethamail/smtp/internal/Constants.java 100% <ø> (ø) 1 <0> (ø) :arrow_down:
...ail/smtp/helper/SmarterMessageListenerAdapter.java 0% <0%> (ø) 0 <0> (ø) :arrow_down:
...org/subethamail/smtp/examples/BasicSMTPServer.java 84.37% <100%> (ø) 2 <0> (ø) :arrow_down:
...mail/smtp/helper/SimpleMessageListenerAdapter.java 95.45% <100%> (ø) 3 <0> (ø) :arrow_down:
...hamail/smtp/helper/BasicMessageHandlerFactory.java 81.25% <100%> (-0.57%) 2 <0> (ø)
...subethamail/smtp/internal/command/DataCommand.java 85.29% <60%> (-5.03%) 5 <0> (ø)
...thamail/smtp/internal/util/SMTPResponseHelper.java 93.75% <93.75%> (ø) 11 <11> (?)
...n/java/org/subethamail/smtp/server/SMTPServer.java 74.19% <0%> (+1.24%) 28% <0%> (+1%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f712cfb...2869702. Read the comment docs.

diegosalvi commented 5 years ago

On second thought testcases for too short and too long "codes" were missing, added

davidmoten commented 5 years ago

Thanks, if you are using Eclipse use EclEmma to check coverage.

diegosalvi commented 5 years ago

Pushed a new commit which address remaining problems.

CI fails due to: [ERROR] Failed to execute goal on project subethasmtp: Could not resolve dependencies for project com.github.davidmoten:subethasmtp:jar:4.0.2-SNAPSHOT: Could not transfer artifact com.github.davidmoten:guava-mini:jar:0.1.2 from/to central (http://repo.maven.apache.org/maven2): Access denied to: http://repo.maven.apache.org/maven2/com/github/davidmoten/guava-mini/0.1.2/guava-mini-0.1.2.jar , ReasonPhrase:Forbidden. -> [Help 1]

It should be restarted I presume

davidmoten commented 5 years ago

travis looks to be misbehaving. I'm happy to merge anyway and I'll check build locally.