.CFConfig.json default mail servers

I’m having issues setting a server wide default mail server in Lucee 6.2.1.122

I thought from Configuration - CFConfig.json :: Lucee Documentation the way to do this was to have a node in /opt/lucee/server/lucee-server/context/.CFConfig.json like

"mailServers": [
    {
      "smtp": "localhost",
      "username": "",
      "password": "",
      "port": 25,
      "tls": false,
      "ssl": false,
      "life": 300000,
      "idle": 60000,
      "reuseConnection": true
    }
  ]

but our applications are erroring on email sending with no SMTP Server defined

what does the admin do?

We don’t actually have the admin enabled anywhere :slight_smile:

And I can’t see to access it via docker run lucee/lucee:6.2.1.122-nginx - gives me a 404 for the good old fashion “http://localhost/lucee/admin/server.cfm” and http://localhost/lucee/admin.cfm (it does have the expected ‘’ Welcome to your Lucee Docker Installation! " page at “/” OK.

Where’s the CFConfig documentation ?

docker run -p 8888:8888 lucee/lucee:6.2.1.122-nginx does show a working admin on the alternative port, and when I set a mail server, in server.cfm, I get what looks like the same unless anyone can spot a typo compared to my snippet above ?

  "mailServers": [
    {
      "smtp": "localhost",
      "username": "",
      "password": "",
      "port": 25,
      "tls": false,
      "ssl": false,
      "life": 60000,
      "idle": 10000,
      "reuseConnection": true
    }

And when I do this to create a file to run, then it doesn’t error. Hmmm… Hmmm

echo "<cfmail to='tom@no.where' from='no@where.com' subject='test'  >test</cfmail> " > /var/www/t.cfm

what does getApplicationSettings() show?

Good idea !

Just “mails” with empty array, no other mail-related keys, which is the same in our app as in the plain Docker image

We’re running in “multi” mode so would it matter there’s a WEB-INF/lucee/.CFConfig.json in the webroot of the site as well ? The settings should be merged with the server-side file right ?

but there’s no mailservers defined in it, yeah, so it’s null and thus ignored

Looks like is only defined in the global setting to me… not ruling out something in our build or deployment process being wrong though…

root@1e06a5d6d4d1:..../dev# grep mailS /opt/lucee/server/lucee-server/context/.CFConfig.json 
  "mailSpoolEnable": true,
  "mailSpoolInterval": 5,
  "mailServers": [
root@1e06a5d6d4d1:.../dev# grep mailS WEB-INF/lucee/.CFConfig.json
root@1e06a5d6d4d1:.../dev# 

as per the admin, this probably is returning an empty query too?

<cfadmin 
	action="getMailServers"
	type="#request.adminType#"
	password="#session["password"&request.adminType]#"
	returnVariable="ms">

That’s going to be a total pain to run, because it would mean switching the admin on in the Docker image in our cluster.

The cluster runs all sorts of extra ifs and buts post-deploy that our local environments, or even the production image running locally don’t do.

We just had a chat here, and might take the opportunity to move to single mode, which surely will fix the problem because we’ll be removing all the WEB-INFs.

it’s host: "localhost", not smtp: "localhost"

you owe me a beer!

as the admin clearly shows!

actually this is inconsistent, there is a bug

https://luceeserver.atlassian.net/browse/LDEV-5638

fix is easy, test case as usual takes longer than the bug!

1 Like

The bug I have just fixed is that in application.cfc, this.mailservers didn’t support the smtp alias for host or server, which was confusing as that is what .CFConfig.json uses

Fixed in 6.2.2.50-SNAPSHOT and 7.0.0.253-SNAPSHOT

@thefalken reckon that was the problem you were facing?

1 Like

Sounds 100% like it.

Next time we’re in the same city… beer :slight_smile:

1 Like