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

bug: cli expected --mailer arguments duplicated 3 times #330

Closed
basinilya opened this issue Jul 2, 2021 · 2 comments
Closed

bug: cli expected --mailer arguments duplicated 3 times #330

basinilya opened this issue Jul 2, 2021 · 2 comments

Comments

@basinilya
Copy link

When I try to send via command line and provide --mailer:trustingAllHosts true it fails:

$ ~/cli-module-6.6.1-standalone-cli/bin/sjm send --email:forwarding "C:\progs\outlook-message-parser\src\test\resources\test-messages\attachments.msg" --email:from X basin@acme.com --email:to X basin@acme.com --mailer:withSMTPServer gate1.acme.com 465 "" "" --mailer:trustingAllHosts true --mailer:withTransportStrategy TransportStrategy.SMTP_TLS
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.IllegalArgumentException: provided 0 arguments, but need at least 1
        at org.simplejavamail.internal.util.Preconditions.assumeTrue(Preconditions.java:49)
        at org.simplejavamail.internal.clisupport.CliCommandLineConsumer.consumeCommandLineInput(CliCommandLineConsumer.java:67)
        at org.simplejavamail.internal.clisupport.CliSupport.runCLI(CliSupport.java:44)
        at org.simplejavamail.cli.SimpleJavaMail.main(SimpleJavaMail.java:31)

Debugging shows that it expects 3 instances of --mailer:trustingAllHosts and for the 1st one it successfully reads the input argument, but for the 2nd one it thinks zero arguments were provided

@bbottema bbottema added this to the 7.0.0 milestone Jul 2, 2021
@bbottema
Copy link
Owner

bbottema commented Jul 2, 2021

Thank you for your report, I found and fixed the bug. Unfortunately, I'm in the middle of the 7.0.0 release and it's not easy for me to do intermediary releases (the release pipeline doesn't support it currently). So it might take a while for this fix to become public.

Btw, your last argument should be just SMTP_TLS.

@bbottema bbottema closed this as completed Jul 2, 2021
bbottema added a commit that referenced this issue Jul 2, 2021
…ded. Also fixed broken CLI support with the latest performance upgrade. Also greatly improved the error feedback for failed CLI commands
@bbottema bbottema changed the title cli: expected --mailer arguments duplicated 3 times bug: cli: expected --mailer arguments duplicated 3 times Jan 2, 2022
@bbottema bbottema changed the title bug: cli: expected --mailer arguments duplicated 3 times bug: cli expected --mailer arguments duplicated 3 times Jan 2, 2022
@bbottema
Copy link
Owner

bbottema commented Jan 2, 2022

7.0.0 just released with the fix for this.

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

No branches or pull requests

2 participants