CFMAIL - spooling to memory, a good idea?

Sorry, think I might’ve mis tagged this before… Apologies for the repost - delete if you want.

We’re currently trying to convert our app to Lucee from ACF. It’s all going swimmingly. However, I’ve come up against a difference in CFMAIL between the two that I’d like to get help with.

As I understand it, when you use CFMAIL to send an email, the process is asynchronous and the mail ends up as a ‘Task’ which you can see (if you’re fast enough) in the Web Server Admin page. I also understand that anything that fails to send ends up as a failed Task and a .tsk file is created in WEB-INFO/lucee/remote-client/open (good name for a folder!).

However, sometimes a server crashes… or a server needs to be restarted (or at least the Lucee service needs to be restarted). I’m concerned that if the server just dies that any CFMAIL sent to the Task queue but not yet sent just gets lost. It’s in memory, the memory allocation is suddenly dropped, what happens to the in-memory stuff? Bearing in mind we send a mixture of mass mails and, more importantly, invoices, you can imagine this is a bit alarming! If it were ACF, files get created in the Mail Spool folder and just get sent when the server comes up again. Lucee doesn’t seem to be able to cope with this eventuality… or am I wrong?

My current thinking is that instead of relying on the Task queue, and risking losing emails, I need to implement some kind of queuing system of my own and turn off Spooling and just send the emails synchronously.

I’d be very interested to hear your thoughts. It’s possible (given my inexperience with Lucee) that I’m over-reacting or missing the point, but I guess I just need some advice! :slight_smile:

Hope someone can help,

Mike Horne

Doesn’t the .tsk file also get created immediately with Lucee @micstriit ?

If you have a lot of mail consider sending you mail to a queuing services like AWS SQS. The process it “out of band”. This way you can scale your servers better under load.

– Bill