Comments (42)
My fork was built from josh's and a big cleanup of the code was performed, nice clean builder patterns used, full round-trip SSL tests added, docs updated, is published to Maven Central and is in use in production. A summary of changes is here: https://github.com/davidmoten/subethasmtp#fork-of-a-fork. One restriction with my fork is it requires Java 8 (but this could be relaxed if really needed). I think you'd be mad to miss the changes put in place in my fork but it's up to you.
from subethasmtp.
@vivekanandasofware I believe the software as is supports pure SSL by overriding the method SMTPServer.createServerSocket
so that an SSLServerSocket
is returned. From a discoverability perspective this can be improved upon so my fork which has a builder for SMTPServer
now includes multiple methods to set the server socket factory. I've also included a full roundtrip unit test PureSSLTest.java
in my fork demonstrating usage.
In short:
SSLContext ssContext = ...
SMTPServer server = SMTPServer //
.port(PORT) //
.hostName(SERVER_HOSTNAME) //
.messageHandlerFactory(mhf) //
.serverSocketFactory(sslContext) //
.build();
I've released 4.0-RC3 to Maven Central:
<dependency>
<groupId>com.github.davidmoten</groupId>
<artifactId>subethasmtp</artifactId>
<version>4.0-RC3</version>
</dependency>
Fork is at https://github.com/davidmoten/subethasmtp.
from subethasmtp.
I am not using my fork in production at the moment, but the code is clean and could be a good jumping off place for further development.
from subethasmtp.
@amanteaux thanks, I've enabled issues on the fork.
from subethasmtp.
@lookfirst This issue should be reopened ( too bad people used it as a random chat forum but the essentials still exist above that chat and are still valid).
from subethasmtp.
@davidmoten Sorry about that!
from subethasmtp.
Good to see this codebase living on. =) Both Jeff and I are still around developing code, but not so much in this space any longer.
from subethasmtp.
I would be interested in knowing this as well, the last commit was in March 2015 but there are many forks which moved forward a bit. I my case, I would like to contribute the respawning of the server (stop and then start again), does it make sense to PR this project?
Maybe @stickfigure @lookfirst can shed some light on the future of it. It surely is a very useful project and worth maintaining!
from subethasmtp.
It looks like it might be worth switching to a fork. If somebody volunteers I might be of help as well. At the moment @bigjosh and @rvdbdvr are the best candidates.
from subethasmtp.
I don't have the expertise, but I encourage this, since this appears to be the only viable java SMTP server. Apache james appears dead too.
from subethasmtp.
I wouldn't say this project is dead, it is just mostly complete. It isn't like SMTP has changed much in the last 10 years. The original authors are all onto other projects and the other commits look like there is a few probably good ones, but mostly just dependency upgrades. If you have the itch, we welcome you to scratch it. =) Submit some PR's.
from subethasmtp.
Fiuu, I was afraid this will never get answers. There a couple of things that can be worked on and I just wanted to be sure that if I push a PR there is somebody still looking at it and that can handle releases. I have on Pr in the pipes for instance :)))
from subethasmtp.
If someone starts a fork they want to maintain publicly, please post here.
from subethasmtp.
Been a little busy lately, but I hope to be keeping this fork up-to-date. I will certainly promptly accept any issues or beneficial PRs in the meantime!
from subethasmtp.
Awesome, thanks. I plan to give this thing a shot in production soon. What about you?
from subethasmtp.
Depends on your definition of soon... :)
Certainly hope to in the next few months...
from subethasmtp.
I'd like to have it up and world-facing by the end of this month šØ
from subethasmtp.
from subethasmtp.
Just a heads up that I've contributed some improvements (got tests working and some other minor stuff) to the fork by @bigjosh. I'm interested in using a Maven Central released artifact so my fork of @bigjosh has been released to Maven Central under com.github.davidmoten:subethasmtp
. I think the main fork of this project should be a clean maven build so the @bigjosh managed project seems like a good place if he's still motivated. In the meantime I'll be paying the project some attention and making releases to Maven Central for the next month or so assuming my production use case goes ahead. https://github.com/davidmoten/subethasmtp.
from subethasmtp.
Hi @bigjosh iam trying to secure my sMTP Server.
startTLS simplyworks fine.
But pure SSL usage has a problem, my client isn't able to send messages and throws back an error saying:
com.hp.usage.connector.framework.NoFreeConnectionException: com.hp.usage.connector.framework.ConnectionTimedoutException: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 587;
nested exception is:
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at com.hp.usage.connector.framework.DefaultConnectionPool.getConnection(DefaultConnectionPool.java:106)
at com.hp.usage.connector.EndPoint.getConnection(EndPoint.java:111)
at com.hp.usage.connector.PrimarySecondaryEndPointSelector.getConnection(PrimarySecondaryEndPointSelector.java:77)
at com.hp.usage.connector.AbstractEndPointSelector.execute(AbstractEndPointSelector.java:49)
at com.hp.usage.connector.framework.TaskWrapper.call(TaskWrapper.java:37)
at com.hp.usage.connector.framework.Connector.submit(Connector.java:33)
at com.hp.usage.connector.ClientService.execute(ClientService.java:36)
at com.hp.usage.connector.ClientService.execute(ClientService.java:47)
at com.hp.usage.lookup.SynchronousLookupRule.applyRule(SynchronousLookupRule.java:70)
at com.hp.siu.collector.rules.AdornmentRule.applyRule(AdornmentRule.java:266)
at com.hp.siu.collector.rules.RuleChain.applyRule(RuleChain.java:221)
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:498)
at com.hp.usage.servicekernel.ServiceReferenceImpl.invoke(ServiceReferenceImpl.java:147)
at com.hp.siu.sessionserver.RuleChainReference.applyRule(RuleChainReference.java:61)
at com.hp.siu.sessionserver.CorbaConnector.invokeRuleChain(CorbaConnector.java:376)
at com.hp.siu.sessionserver.CorbaConnector.sendRequest(CorbaConnector.java:239)
at com.hp.siu.corba.TransactionManagerPOA._invoke(TransactionManagerPOA.java:51)
at org.jacorb.poa.RequestProcessor.invokeOperation(RequestProcessor.java:402)
at org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:726)
at org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:884)
Caused by: com.hp.usage.connector.framework.ConnectionTimedoutException: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 587;
nested exception is:
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at com.hp.usage.smtp.client.SMTPClientConnection.initializeConnection(SMTPClientConnection.java:212)
at com.hp.usage.smtp.client.SMTPClientConnection.(SMTPClientConnection.java:99)
at com.hp.usage.smtp.client.SMTPClientConnectionFactory.createConnection(SMTPClientConnectionFactory.java:12)
at com.hp.usage.connector.framework.DefaultConnectionPool.newConnection(DefaultConnectionPool.java:162)
at com.hp.usage.connector.framework.DefaultConnectionPool.getConnection(DefaultConnectionPool.java:104)
... 22 more
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 587;
nested exception is:
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1972)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:642)
at javax.mail.Service.connect(Service.java:295)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:125)
at com.hp.usage.smtp.client.SMTPClientConnection.connectSmtpTransport(SMTPClientConnection.java:219)
at com.hp.usage.smtp.client.SMTPClientConnection.initializeConnection(SMTPClientConnection.java:185)
... 26 more
Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:710)
at sun.security.ssl.InputRecord.read(InputRecord.java:527)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:548)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:352)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:233)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1938)
... 32 more
Any hints on what could be wrong or is that Subetha doesnt support pure SSL connections
from subethasmtp.
An update of changes in my fork:
https://github.com/davidmoten/subethasmtp#fork-of-a-fork
Re pure SSL support I haven't seen any documentation that this is supposed to be supported beyond the startTLS command.
@vivekanandasofware My fork has a full unit test of a startTLS session. If you think pure SSL support is important I'm happy to have a chat about it (and add unit tested support).
from subethasmtp.
Thank you @davidmoten .
As i mentioned we have a need to support fully secured connection apart from startTLS which is a delayed securing mechanism compared to SSL which requires secure conenction initially. I thought if startTLS is supported pure SSL would also be supported. Any hints on how to get SSL connection working would be appreciated. I dont know if a code change is required in Subetha to do this.
from subethasmtp.
Well, this was a little bit confusing. Which repository is the new "official" and maintained one @davidmoten's or @bigjosh's?
from subethasmtp.
I agree with @davidmoten! I might switch to that fork as well! :)
from subethasmtp.
Thanks @bigjosh, and for giving me a good jumping off place with your mavenisation work!
from subethasmtp.
Great! I will switch to your fork.
Thank you @davidmoten and @bigjosh!
from subethasmtp.
Thank you @davidmoten and @bigjosh for the nice work. I will switch to the new fork.
from subethasmtp.
Thanks @davidmoten!
I think there is an issue with your fork (and also the original subethasmtp).
But the issues are disabled on your fork (I guess that is the default with forks on Github).
What do you prefer: should I open the issue on the original repository or do you want to enable the issues on you fork?
from subethasmtp.
Dear all,
I'm testing the MessageHandlerFactory proposed as an example in the projet(which is working fine) but the MessageHandler is receiving the incoming email as an InputStream.
I would need to manage this content in an more simpler manner than grabbing sub part of InputStream to extract attachments and different fields.
How can I convert it in a MIME or SMTP Java Object ?
from subethasmtp.
@quirem It really depends on what the data is that you're receiving. Most likely MIME, which you will need to use javax.mail
to do the parsing/decoding for you.
from subethasmtp.
Yes I tried to create a MimeMessage
from javax.mail
but Constructor requires a Session whereas I do not have such. the result is a null Object
MimeMessage msg = new MimeMessage(session, data);
from subethasmtp.
Data received is a standard email, not sure this is relevant to copy / paste the entire mail received....
from subethasmtp.
I tried to do the following:
`Properties props = System.getProperties();
Session session = Session.getInstance(props, null);
SMTPMessage smtp = new SMTPMessage(session, data);
System.out.println("SMTP Content: "+smtp.getContent());
System.out.println("SMTP Subject: "+smtp.getSubject());
MimeMessage msg = new MimeMessage(session, data);
System.out.println("Content: "+msg.getContent());
System.out.println("Subject: "+msg.getSubject());`
but both smtp or Mime Objects are empty, seems that InputStream received from my Postfix server is not well formated to be considered as a MIME Message
from subethasmtp.
@quirem Hey, I'm super sorry you're having issues, but this issue tracker and particularly this issue isn't a good place to do support. You're sending emails to a whole bunch of people who probably don't care about this. If you have questions about using javax.mail, I suggest you take a look at stackoverflow. If you'd like examples on using subethasmtp you might check out https://github.com/voodoodyne/subetha for a full usecase.
from subethasmtp.
I'm going to close this issue to prevent further comments here. I think we've already seen other forks of this project generated. Sorry to everyone on it for the trouble.
from subethasmtp.
Is there a roadmap regarding java 11 and java 17. I just recently went through the process of upgrading one of my apps from java 11 to java 17. There are a number of changes around going away from javax.* classes to using jakarta.*.
See
https://eclipse-ee4j.github.io/mail/docs/JavaMail-2.0-changes.txt
from subethasmtp.
the current current version does work in java 17. I can confirm this
from subethasmtp.
re Java 11+ support, raise an issue at https://github.com/davidmoten/subethasmtp which is an actively maintained fork with regular updates being pushed to Maven Central (it's a production artifact at my workplace).
My fork was built from josh's and a big cleanup of the code was performed, nice clean builder patterns used, full round-trip SSL tests added, docs updated, is published to Maven Central and is in use in production. A summary of changes is here: https://github.com/davidmoten/subethasmtp#fork-of-a-fork. One restriction with my fork is it requires Java 8+ (but this could be relaxed if really needed). I think you'd be mad to miss the changes put in place in my fork but it's up to you.
from subethasmtp.
cool I might just do that! Thanks!
re Java 11+ support, raise an issue at https://github.com/davidmoten/subethasmtp which is an actively maintained fork with regular updates being pushed to Maven Central (it's a production artifact at my workplace).
My fork was built from josh's and a big cleanup of the code was performed, nice clean builder patterns used, full round-trip SSL tests added, docs updated, is published to Maven Central and is in use in production. A summary of changes is here: https://github.com/davidmoten/subethasmtp#fork-of-a-fork. One restriction with my fork is it requires Java 8+ (but this could be relaxed if really needed). I think you'd be mad to miss the changes put in place in my fork but it's up to you.
from subethasmtp.
I had to make some changes to code, as you would expect, to go from 3.1.7 to 6.0.1, but I'm going to give this a try today and see if everything functions as you'd expect on java17. if not I'll open a ticket on that fork. Thanks for the suggestion!
from subethasmtp.
it works flawlessly on java17. So no need to open a ticket at this point. Yay
from subethasmtp.
@davidmoten Maybe you can submit a PR to the README that at the top of the file, links to your project with a little blurb?
from subethasmtp.
Related Issues (20)
- SMTP Smuggling, malformed line ending support in subethasmtp?
- Restart of the SMTPServer by calling stop-start HOT 3
- migration vers github or bitbucket ? HOT 2
- If client supplies message size with no max size configured it is rejected.
- Sending Emails to other Receivers? HOT 1
- Wait for incoming email
- Using a shell script to test the SMTP server
- TLS WantClientAuth not supported (Patch)
- Is wiser sending acknoledgement to the mail sender
- JMX monitoring of Number of Sessionthreads HOT 2
- Downloadable latest jar HOT 1
- can i send mail from '[email protected]' to '[email protected]' HOT 1
- TooMuchDataException in DATA command returns 421 code? HOT 2
- Hostname resolution causes issues with Graal HOT 1
- Attachment Download HOT 2
- Get client IP in AuthenticationHandlerFactory HOT 1
- Still alive? HOT 2
- Support nested brackets in EmailUtils.extractEmailAddress HOT 1
- Reforwarding the incoming email to another smtp server HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from subethasmtp.