voodoodyne / subethasmtp

SubEtha SMTP is a Java library for receiving SMTP mail
Other
343 stars 138 forks source link

What is the status of this project? #84

Open Randgalt opened 8 years ago

Randgalt commented 8 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

bigjosh commented 7 years ago

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 commented 7 years ago

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

bigjosh commented 7 years ago

Depends on your definition of soon... :)

Certainly hope to in the next few months...

dminkovsky commented 7 years ago

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

bigjosh commented 7 years ago

That is sooner than me. I’m looking maybe 6 months.

-josh

From: Dmitry Minkovsky [mailto:notifications@github.com] Sent: Saturday, January 7, 2017 5:20 PM To: voodoodyne/subethasmtp subethasmtp@noreply.github.com Cc: Josh Levine github@junk.josh.com; Mention mention@noreply.github.com Subject: Re: [voodoodyne/subethasmtp] What is the status of this project? (#84)

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/voodoodyne/subethasmtp/issues/84#issuecomment-271114125 , or mute the thread https://github.com/notifications/unsubscribe-auth/AFQ7mVZ6SJntEwRrl-PboCSH9fIPu_Rtks5rQA90gaJpZM4JHkXG . https://github.com/notifications/beacon/AFQ7makompwt5a8DH_26QDuREDbNE-vTks5rQA90gaJpZM4JHkXG.gif

davidmoten commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

@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 commented 6 years ago

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

bigjosh commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

davidmoten commented 6 years ago

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

drurenia commented 6 years ago

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

REME-AlarmTILT commented 6 years ago

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

amanteaux commented 6 years ago

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 commented 6 years ago

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

quirem commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

Yes I tried to create a MimeMessagefromjavax.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 commented 5 years ago

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

quirem commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

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 commented 4 years ago

@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 commented 4 years ago

@davidmoten Sorry about that!

ssill2 commented 2 years ago

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 commented 2 years ago

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

davidmoten commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

lookfirst commented 2 years ago

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 commented 2 years ago

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