Mail server configuration [solved]

I have been assisting with the migration of a Lucee 5.x based site from one hosting provider to another and mostly this has been trouble-free. I am not a Lucee expert, so please forgive my perhaps simple question.

When the site attempts to send an email, an exception is thrown indicating that no smtp servers have been configured. With the site having been migrated, I had expected the configuration to have been moved over.

I am not sure how to access the Luceee Administration page to check, so I added the mail server information to Application.cfc for the only context that I see to contain:

this.mails =[ {
             host: ""
            ,port: 587
            ,username: "xxx@xxx"
            ,password: "xxx"
            ,ssl: false
            ,tls: true
            ,lifeTimespan: CreateTimeSpan( 0, 0, 1, 0 )
            ,idleTimespan: CreateTimeSpan( 0, 0, 0, 10 )
        } ];

The above text is within the “component” section. This is based on a forum post I found here. I also tried setting “mails” to “mailservers” as I found another post that suggested this be used. Neither has made no difference. I appreciate that the cfmail tag could be modified to include the necessary information, but I would prefer to have this in the global configuration.

I noticed that lucee-web.xml.cfm has an empty mail tag and am not sure if this is relevant?

So, can someone point me in the right direction with regard to accessing the Administration page? Also, is there a way of configuring the mail server settings without accessing this page? Where are the configuration settings actually stored and is it possible to change them manually on a global basis?

Thanks in advance.

You Need to store the SSL certificate for the smtp server in question on the local machine or inside the context of your application server (tomcat) so that you can connect.

Thanks for taking the time to reply, Terry. The OS certificate store already has this information present. I am able to use an application like mailx to send emails. The error message shown says nothing about certificate validation, it specifically says that no mail servers have been configured.

I am more specifically asking where the SMTP server information is set up, in the first instance.

Incidentally, modifying the cfmail tag itself works just fine. I am able to send emails. So, I just need to know how to set up the default mail server for the application.

Assuming yours is a standard Tomcat installation the server wide admin UI should be accessible at:


I use

this.mailservers = [ { server details etc } ];

in each app’s Application.cfc and it’s working fine as the default (nothing defined in the admin UI). It’s a local, locked down mail server though so just a simple connection on port 25.

1 Like

Thanks Julian. Your feedback does confirm that what I have done should have worked. The installation appears to be slightly non-standard and I am wondering if this is related to the issue, since I have also tried as you suggested and the mail server info is not returned.

I have manged to navigate to the page in question. I do not know the password, but will see what I can do to find out what it is.

Having dug around the source files it definitely looks as though I am working on a Lucee 5.x installation but is there an easy way to confirm this? If for some reason the version is re 5.0, that would explain why the Application.cfm change does not work.

I have access to the pages now. Thanks Julian. Still would love to know why the Application.cfc did not work, but I am going to try just setting the defaults in the admin page.

Edit: Corrected type “cfm” to “cfc”

dump( server.lucee.version );

1 Like

Is that a typo? It would need to be Application.cfc

Yes, it’s a typo :slight_smile:

This is what the file looks like (with details masked for security):

component { = "lucee_context#server.lucee.version#";

        this.mailservers =[ {
             host: "xxxxx"
            ,port: 587
            ,username: "xxxxxxx"
            ,password: "xxxxxxx"
            ,ssl: false
            ,tls: true
            ,lifeTimespan: CreateTimeSpan( 0, 0, 1, 0 )
            ,idleTimespan: CreateTimeSpan( 0, 0, 0, 10 )
        } ];


Connecting to the admin panel shows that I am running, for your info.

Which version are you running? It would need to be or later.

Should be working then. Might be worth filing a bug.

Having logged into the admin panel, it mentions that some patches are available, so I’ll see about installing them first and then do as you suggest. Did the above file look OK? Is there a way of having Lucee ignore or use the Application.cfc file? I wonder if it is disabled.

My version number above is incorrect. I need to read more carefully. It is but it notes that the update is available to the version I mentioned. I’ll try this first.

Yes. Updating has had no effect. The error reported is:

lucee.runtime.exp.NativeException: no SMTP Server defined
 	at lucee.runtime.tag.Mail.doEndTag(
 	at messageposter_cfm$
 	at lucee.runtime.PageContextImpl._doInclude(
 	at lucee.runtime.PageContextImpl._doInclude(
 	at lucee.runtime.listener.ClassicAppListener._onRequest(
 	at lucee.runtime.listener.MixedAppListener.onRequest(
 	at lucee.runtime.PageContextImpl.execute(
 	at lucee.runtime.PageContextImpl._execute(
 	at lucee.runtime.PageContextImpl.executeCFML(
 	at lucee.runtime.engine.Request.exe(
 	at lucee.runtime.engine.CFMLEngineImpl._service(
 	at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(
 	at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(
 	at lucee.loader.servlet.CFMLServlet.service(
 	at javax.servlet.http.HttpServlet.service(
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(
 	at org.apache.tomcat.websocket.server.WsFilter.doFilter(
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(
 	at org.apache.catalina.core.StandardWrapperValve.invoke(
 	at org.apache.catalina.core.StandardContextValve.invoke(
 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
 	at org.apache.catalina.core.StandardHostValve.invoke(
 	at org.apache.catalina.valves.ErrorReportValve.invoke(
 	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(
 	at org.apache.catalina.core.StandardEngineValve.invoke(
 	at org.apache.catalina.connector.CoyoteAdapter.service(
 	at org.apache.coyote.http11.AbstractHttp11Processor.process(
 	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
 	at java.util.concurrent.ThreadPoolExecutor.runWorker(
 	at java.util.concurrent.ThreadPoolExecutor$
 	at org.apache.tomcat.util.threads.TaskThread$
 Caused by: no SMTP Server defined

I wonder if the Application.cfc is being ignored or not being picked up. Where is the default usually located? The one I am working with is here: /webapps/ROOT/WEB-INF/lucee/context/Application.cfc

Try adding

dump( this );abort;

to your Application.cfc, below your this.mailservers definition and see if works.

1 Like

@mdsystems, Where is your Application.cfc located?

/webapps/ROOT/WEB-INF/lucee/context/Application.cfc is the only file I can locate.

And adding what Julian suggests does nothing, so I think it’s safe to conclude that it is not being referenced. How do I go about ensuring that it is referenced?

Please move the Application.cfc under the /webapps/root folder. Hope, this will work.

1 Like