Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the status of this project? #84

Open
Randgalt opened this issue Jul 7, 2016 · 42 comments
Open

What is the status of this project? #84

Randgalt opened this issue Jul 7, 2016 · 42 comments

Comments

@Randgalt
Copy link

Randgalt commented Jul 7, 2016

I need an embeddable SMTP server for a new project I'm working on. Is this library stable and being maintained? The versions on maven central are 10 years old.

@arichiardi
Copy link

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!

@arichiardi
Copy link

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.

@dagnelies
Copy link

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.

@lookfirst
Copy link
Contributor

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.

@arichiardi
Copy link

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 :)))

@dminkovsky
Copy link

If someone starts a fork they want to maintain publicly, please post here.

@bigjosh
Copy link

bigjosh commented Jan 7, 2017

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!

@dminkovsky
Copy link

Awesome, thanks. I plan to give this thing a shot in production soon. What about you?

@bigjosh
Copy link

bigjosh commented Jan 7, 2017

Depends on your definition of soon... :)

Certainly hope to in the next few months...

@dminkovsky
Copy link

I'd like to have it up and world-facing by the end of this month 😨

@bigjosh
Copy link

bigjosh commented Jan 10, 2017 via email

@davidmoten
Copy link

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.

@vivekanandasofware
Copy link

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

@davidmoten
Copy link

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).

@vivekanandasofware
Copy link

vivekanandasofware commented Jun 5, 2017

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.

@davidmoten
Copy link

@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.

@drurenia
Copy link

drurenia commented Mar 8, 2018

Well, this was a little bit confusing. Which repository is the new "official" and maintained one @davidmoten's or @bigjosh's?

@bigjosh
Copy link

bigjosh commented Mar 8, 2018

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.

@davidmoten
Copy link

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.

@bigjosh
Copy link

bigjosh commented Mar 8, 2018

I agree with @davidmoten! I might switch to that fork as well! :)

@davidmoten
Copy link

Thanks @bigjosh, and for giving me a good jumping off place with your mavenisation work!

@drurenia
Copy link

drurenia commented Mar 9, 2018

Great! I will switch to your fork.
Thank you @davidmoten and @bigjosh!

@REME-AlarmTILT
Copy link

Thank you @davidmoten and @bigjosh for the nice work. I will switch to the new fork.

@amanteaux
Copy link

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?

@davidmoten
Copy link

davidmoten commented May 21, 2018

@amanteaux thanks, I've enabled issues on the fork.

@quirem
Copy link

quirem commented May 28, 2019

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 ?

@lookfirst
Copy link
Contributor

@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.

@quirem
Copy link

quirem commented May 28, 2019

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);

@quirem
Copy link

quirem commented May 28, 2019

Data received is a standard email, not sure this is relevant to copy / paste the entire mail received....

@quirem
Copy link

quirem commented May 28, 2019

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

@lookfirst
Copy link
Contributor

@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.

@lookfirst
Copy link
Contributor

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.

@davidmoten
Copy link

@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).

@lookfirst
Copy link
Contributor

@davidmoten Sorry about that!

@ssill2
Copy link

ssill2 commented May 3, 2022

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

@ssill2
Copy link

ssill2 commented May 3, 2022

the current current version does work in java 17. I can confirm this

@davidmoten
Copy link

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.

@ssill2
Copy link

ssill2 commented May 4, 2022

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.

@ssill2
Copy link

ssill2 commented May 4, 2022

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!

@ssill2
Copy link

ssill2 commented May 4, 2022

it works flawlessly on java17. So no need to open a ticket at this point. Yay

@lookfirst
Copy link
Contributor

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.

@lookfirst
Copy link
Contributor

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests