CFMAIL Logging

Can anyone please tell me if there is a log file of the emails that are sent using cfmail?

No problem if there isn’t as I can keep my own.

Thanks

There is a log called ‘mail’ under Settings > Logging in the Lucee admin. You will need to set its log level to ‘Info’ to log each email successfully sent.

Hope that helps.

1 Like

Thanks. I didn’t know about that.

No matter what I set the log level to, I can’t get anything into the mail.log file apart from the header row.

remoteclient.log will give you this data

1 Like

I also don’t cannot find any mail logs, despite setting logging to debug, and trace. Looking in the \lucee\tomcat\logs folder, where other log files are being written to as I sit and watch. Tying to debug a connection to my SmarterMail server to see why regular client apps can connect and send from the correctly configured IP, but CFMAIL somehow always sends from the second IP number configured on the server. Is CF Mail not acting like a regular client app using SMTP?

There is no remoteclient.log either, which is set to info.

Check you check the web context’s logs folder? The exact location of this will depend on how your server is setup, but by default it’s usually /WEB-INF/lucee off your web root.

Found a mail.log file in \lucee\tomcat\lucee-server\context\logs but it’s empty.

Do I need to restart?

That’s the server context, not the web context. Lucee has a near-identical logs folder for the servlet context and then for EACH web context (web root/site). Like I said above, the web context is normally inside the web root.

Found it. Thanks. Though, neither Trace nor Debug setting works. Still shows just “INFO” in the logs. Trying to debug how CFMAIL connects to my SmarterMail server.

Does CFMAIL connect like a regular email client, or does it use a different method?

Cfmail uses SMTP, it’s using javax mail underneath

5.3.9 improves mail logging a little

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

Interestingly, there is some detailed javax Mail logging available via that library which we could enable when log level is set to trace

updates

try passing in the -Dmail.debug=true to the jvm JavaMail FAQ

I’ll be fixing this ticket for 6.0 [LDEV-3754] - Lucee

1 Like

Thanks. I am also getting this error, a lot.

26-Apr-2022 22:56:01.478 WARNING [Thread-387578] javax.mail.Session.loadResource expected resource not found: /META-INF/javamail.default.address.map

yeah, it’s a known issue [LDEV-3130] - Lucee

So, do I need to create a blank javamail.default.address.map file in each /META-INF/ folder on my server? I have 350+ sites on the one server. I guess I could write a batch file, or update my send email script to create a blank file there if it doesn’t already exist.

You could, or you could just spin up hmailserver and point its logs to an sql table.

its free, runs on windows and surprisingly stable.

1 Like

hmailserver works wonderfully!!! But the warning javamail.default.address.map won’t disappear by using it. However, as you said, these warnings can be ignored and you have better deliverabilty control and better automatization with hmailserver.

2 Likes

We are using a licensed copy of SmarterMail for our bulk email server (needed to pay because we send from two domain names, so it can’t be free) and it’s been working alright.

The one issue I do have with SM (and I know this is off topic) is that you can’t differentiate between authenticated and unauthenticated traffic. It’s all SMTP. I want the bulk email server to disregard all email that comes to it from elsewhere, and ONLY accept authenticated emails initiated by my CFM servers. Can hmailserver do that? I can’t seem to be able to figure out how to do it with SM. Thanks.

well if the incoming ports a firewalled, nothing else can reach it to use it?

Yes it can. You can set connection and delivery rules for specific IP ranges, which can be the entire internet or just your local network or machine.

https://www.hmailserver.com/documentation/v5.6/?page=reference_iprange

We’ve been using hMailServer for quite a few years now and I’ve come to really like it.