Admin registered mail server incorrectly overrides application defined mail server


Lucee version: (not available to choose above).

Scenario: A mail server is registered in the Server admin (or Web admin). A different mail server is defined in my Application.cfc using this.mailservers

Expected behaviour: if I call cfmail in my application without specifying a server, the mail server defined in Application.cfc should be used.

Actual behaviour: calling cfmail without specifying a server results in the mail server registered in the admin to be used - i.e. it incorrectly overrides the Application.cfc mail server setting.

Steps to reproduce:

1. Set up 2 mail servers one listening on port 25 the other on port 587 (I use smtp4dev which allows multiple instances)
2. Add the port 25 server to the Lucee admin
3. Create an Application.cfc with the port 587 server defined as follows:

Create a template in the application with the following code:

4. Execute the template and note which server receives the email (for me it is the port 25 server defined in the Admin)
5. Now delete the port 25 server in the admin
6. Execute the template again and note which server receives the email (for me it is the port 587 server defined in the Application.cfc)




Julian Halliwell
September 26, 2020, 1:54 PM

Either admin. Tested in both, same result.

Have added a screenshot of my 2 dev mail server instances. The one on port 587 should have received both test emails.

Zac Spitzer
September 26, 2020, 2:57 PM
Julian Halliwell
September 26, 2020, 3:14 PM

Yes. And the app defined config works fine if I remove the admin registered server.

Pothys - MitrahSoft
October 9, 2020, 10:44 AM

Yes, I replicated the issue as per the reporter said. Actually, if we set a mail server in admin, lucee considered this as first preference. will confirm this.

Michael Offner
October 9, 2020, 1:30 PM

application.cfc should always come first


Pothys - MitrahSoft


Julian Halliwell




Fix versions


Affects versions