-
-
Notifications
You must be signed in to change notification settings - Fork 273
Simple Java Mail should include CLI support #142
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
Comments
I don't owe you anything, so I'm not sure why I deserve this flippant comment? I'm just doing my best here and I depend on user feedback for improving this library all the time.
I don't know of a use case that would need this. The point of the library is to add an abstract layer on top of the RFC related classes in the underlying Java Mail framework. Without Simple Java Mail, you deal with RFC's, with Simple Java Mail you get a simple API. That's what make Simple Java Mail 'so simple' as you put it. Now I'm willing to look beyond the obvious use cases for a library like this, but you will have to come up with a little bit than half of a one-liner. Why do you want this, just |
My comment was not intended to be flippant. The use case is so simple, it doesn't warrant writing an essay. As far as you owing me, I never brought it up, so I'll chalk it up to you having a bad day, or fragile ego. If the above makes sense, I'll be happy to send a PR. |
@asarkar Please calm down, your tone does sound offensive. Even with your response, your use case is not clear to me. |
Not yet, but I feel a PR is going to make more sense to me at this point. I'm not averse to having CLI capabilities in Simple Java Mail, though. I'll give it serious consideration. |
As always, the devil is in the details, so let me ask a couple of clarifying questions. What I was initially thinking is a way for a user to specify a properties file that the code would use to send emails. However, if they want to specify only a few properties, creating a file is overkill, and they should be able to do that using command line options. Which brings me to the next question. Spring Boot property binder already has this feature, but Boot isn’t used in this project, just Spring. So, what is really the Spring support then? Surely, I can create a few beans myself without any support from the library. It seems to me that there are 3 logical modules here.
If Spring Boot binder were packaged and distributed separately, 2 and 3 could be the same. But that’s not the case. |
That is starting to look like an essay @asarkar ;) The properties part is simpler than that, actually. The way the included Spring support class translates properties to the configuration module can be reused to populate properties coming from CLI. I'm looking into some small but clean CLI libraries currently (args4j, JSAP, Jcommander) for this. The interesting part is specifying body of the email and referring to files for embedding / attaching. Until now this was deferred to the library user. Ideally I would like the CLI api to mirror the builder api. In fact, perhaps it would be better to translate all the CLI properties to builder calls so that the same validation and configuration is triggered. I need to sit on this for a bit. |
As the first step, I propose the following:
With the above simple change, and addition of a class with |
I have a pretty good idea of how I'm going to approach this now. I won't be taking PR on this though, it's in the heart of the library and I want to take care of this properly including backwards compatibility. I'll start work in this asap. |
I’m not sure why you can’t accept PR, because until you and the author reaches an agreement, the code won’t be merged. That said, I’m happy to do something else with my time. This has been a good discussion, thanks for indulging me. |
Closing in favor of #156. |
Finished implementing comprehensive CLI support in the development branch. Will be part of the 6.0.0 release. |
Hi @asarkar, it's been a while. I'm happy to tell you that CLI support has finally been released in 6.0.0-rc1. Also, I should thank you. You triggered my journey to a new major version (as in Maven semantic versioning major) with your 'complaint' about missing CLI support. There was some... scope creep, but I finally put a new version out, including renewed website simplejavamail.org. |
6.0.0 has released as well, finally. |
I'd like to download the jar, put a properties file on the classpath, and run
java -jar simple-java-mail.jar
. If you made the API so simple, why do I need to go through the exercise of setting up a project for a single line of code?The text was updated successfully, but these errors were encountered: