Giter Club home page Giter Club logo

Comments (42)

davidmoten avatar davidmoten commented on June 30, 2024 3

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.

davidmoten avatar davidmoten commented on June 30, 2024 1

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

bigjosh avatar bigjosh commented on June 30, 2024 1

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.

davidmoten avatar davidmoten commented on June 30, 2024 1

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

from subethasmtp.

davidmoten avatar davidmoten commented on June 30, 2024 1

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

lookfirst avatar lookfirst commented on June 30, 2024 1

@davidmoten Sorry about that!

from subethasmtp.

lookfirst avatar lookfirst commented on June 30, 2024 1

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.

arichiardi avatar arichiardi commented on June 30, 2024

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.

arichiardi avatar arichiardi commented on June 30, 2024

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.

dagnelies avatar dagnelies commented on June 30, 2024

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.

lookfirst avatar lookfirst commented on June 30, 2024

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.

arichiardi avatar arichiardi commented on June 30, 2024

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.

dminkovsky avatar dminkovsky commented on June 30, 2024

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

from subethasmtp.

bigjosh avatar bigjosh commented on June 30, 2024

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.

dminkovsky avatar dminkovsky commented on June 30, 2024

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

from subethasmtp.

bigjosh avatar bigjosh commented on June 30, 2024

Depends on your definition of soon... :)

Certainly hope to in the next few months...

from subethasmtp.

dminkovsky avatar dminkovsky commented on June 30, 2024

I'd like to have it up and world-facing by the end of this month šŸ˜Ø

from subethasmtp.

bigjosh avatar bigjosh commented on June 30, 2024

from subethasmtp.

davidmoten avatar davidmoten commented on June 30, 2024

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.

vivekanandasofware avatar vivekanandasofware commented on June 30, 2024

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.

davidmoten avatar davidmoten commented on June 30, 2024

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.

vivekanandasofware avatar vivekanandasofware commented on June 30, 2024

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.

drurenia avatar drurenia commented on June 30, 2024

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

from subethasmtp.

bigjosh avatar bigjosh commented on June 30, 2024

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

from subethasmtp.

davidmoten avatar davidmoten commented on June 30, 2024

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

from subethasmtp.

drurenia avatar drurenia commented on June 30, 2024

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

from subethasmtp.

REME-AlarmTILT avatar REME-AlarmTILT commented on June 30, 2024

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

from subethasmtp.

amanteaux avatar amanteaux commented on June 30, 2024

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.

quirem avatar quirem commented on June 30, 2024

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.

lookfirst avatar lookfirst commented on June 30, 2024

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

quirem avatar quirem commented on June 30, 2024

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.

quirem avatar quirem commented on June 30, 2024

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

from subethasmtp.

quirem avatar quirem commented on June 30, 2024

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.

lookfirst avatar lookfirst commented on June 30, 2024

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

lookfirst avatar lookfirst commented on June 30, 2024

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.

ssill2 avatar ssill2 commented on June 30, 2024

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.

ssill2 avatar ssill2 commented on June 30, 2024

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

from subethasmtp.

davidmoten avatar davidmoten commented on June 30, 2024

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.

ssill2 avatar ssill2 commented on June 30, 2024

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.

ssill2 avatar ssill2 commented on June 30, 2024

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.

ssill2 avatar ssill2 commented on June 30, 2024

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

from subethasmtp.

lookfirst avatar lookfirst commented on June 30, 2024

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.