Skip to content

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

Closed

Description

@basinilya

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

Activity

  1. added this to the 7.0.0 milestone on Jul 2, 2021
  2. bbottema commented on Jul 2, 2021

    @bbottema
    Owner

    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.

  3. added a commit that references this issue on Jul 2, 2021
  4. changed the title [-]cli: expected --mailer arguments duplicated 3 times[/-] [+]bug: cli: expected --mailer arguments duplicated 3 times[/+] on Jan 2, 2022
  5. changed the title [-]bug: cli: expected --mailer arguments duplicated 3 times[/-] [+]bug: cli expected --mailer arguments duplicated 3 times[/+] on Jan 2, 2022
  6. bbottema commented on Jan 2, 2022

    @bbottema
    Owner

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions