Search code examples
coldfusionfirewallcfmail

Prevent ColdFusion from sending email


I'd like to disable all email from being sent on our dev server even if server and credentials are used in the cfmail tag. I'd like the messages to go into the spool as undeliverable so that we can read them.

This is on windows.

EDIT - why? We currently have the mail server set as a dummy in the admin, but we specify a number of servers on various mail tags. Having been burnt once by a developer sending mail accidentally, we'd like to disable it entirely.


Solution

  • You could firewall against port 25 outgoing (make sure and excluded 127.0.0.1 as well if you are relaying locally). You would use iptables or Windows Firewall to stop outgoing port 25 connections. Your messages would be created by CF but the CF spooler, unable to deliver, would bounce them to the undeliverables folder.