BoxLang: Our new JVM Dynamic Language made by Ortus! Check it out: https://www.boxlang.io

Error when no smtp defined

Description

Currently, the

to

command of

cfconfig mailserver

supports writing directly to a cfconfig file, however the

from

does not allow the usage of the file and must be pointed to a server home directory. When attempting to use a file, the following error message is displayed:

> cfconfig mailserver list from=./.engine/cfconfig-development.json ERROR (5.0.0-RC.1+00123) The CF Home directory for the server doesn't exist. [/Users/jonclausen/Sites/mysite/.engine/cfconfig-development.json]

If attempting to provision a cfconfig before a server is first started, this does not allow the pruning of the previous configuration via

cfconfig mailserver delete

, which is necessary because each

cfconfig mailserver set ...

command appends a new mailserver to the array.

Activity

Show:

Brad WoodMarch 16, 2020 at 7:04 PM

Like I said, the host name for the mail server is pretty much required. There’s no reason not to have it. I did however add some validation to prevent the ugly error message.

Brad WoodMarch 16, 2020 at 5:59 PM
Edited

The to and from params are working when pointing at a JSON file for me:

> cfconfig mailserver save smtp=localhost port=123 to=myConfig.json mail server [localhost] saved. > cfconfig mailserver list from=myConfig.json Mail Server 1 Host: localhost Port: 123

It will, however, blow up if the there is no smtp key in the configuration:

That is correct. The smtp host is the “primary key” if you will of a mail server connection. The one thing that is required. So it is working as designed that the field is required. We can add a better validation message if we need to address it. How did you add the invalid configuration?

 

Jon ClausenMarch 15, 2020 at 1:58 PM

Update: I was hasty on this one as it looks like I fumble-fingered the path in the commandbox shell. It does attempt to parse the file.

It will, however, blow up if the there is no smtp key in the configuration:

key [SMTP] doesn't exist /modules/commandbox-cfconfig/commands/cfconfig/mailserver/list.cfc: line 77 75: // The only guaranteed piece of info is virtual 76: print.boldLine( 'Mail Server #i#' ); 77: print.boldLine( 'Host: #mailserver.smtp#' ); 78: if( !isNull( mailserver.port ) ) { print.indentedLine( 'Port: #mailserver.port#' ); } 79: if( !isNull( mailserver.username ) ) { print.indentedLine( 'Username: #mailserver.username#' ); } called from /system/services/CommandService.cfc: line 343 called from /system/services/CommandService.cfc: line 139 called from /system/Shell.cfc: line 771 called from /system/Shell.cfc: line 591 called from /system/Bootstrap.cfm: line 154

This issue can be deleted or converted to address the issue above.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Priority

Sentry

Created March 15, 2020 at 1:53 PM
Updated March 16, 2020 at 7:04 PM
Resolved March 16, 2020 at 7:03 PM

Flag notifications