When using ColdFusion MX 6.x/7.x Enterprise Edition, the Mail Settings page of the ColdFusion Administrator has a configurable setting for Mail Delivery Threads which defaults to 10 threads. When sending mail at high volumes via the CFMAIL tag, its possible that two mail threads could generate identical Message-ID numbers for distinct mail messages when sending mail to the SMTP server, and the probability of this is more likely on fast processors.

The Message-ID header is shown as an optional parameter in RFC 822 (Standard for the Format of ARPA Internet Text Messages). RFC 2822 (which obsoletes 822) states:

Though optional, every message SHOULD have a "Message-ID:" field...
The "Message-ID:" field contains a single unique message identifier.


It has been reported that the Microsoft Exchange mail server will not deliver messages having a Message-ID value the same as the Message-ID value from another email message, although Sendmail and Postfix will deliver all messages regardless of redundant Message ID values.

Network packet trace of SMTP connectionThe CFMAIL tag is implemented at its core with Sun's JavaMail API version 1.3.2 in the current release of ColdFusion. This version of JavaMail has a bug where the class used to generate the Message IDs is not synchronized so its possible that it can be called concurrently. Since the algorithm to generate Message IDs is at least partially based on the current timestamp in milliseconds, concurrent access to the class in question can result in duplicate Message IDs returned to distinct calls.

The problem has been fixed in JavaMail 1.3.3. ColdFusion bug 59811 is logged to include a fixed version of JavaMail. While it is possible to replace the cf_root/lib/mail.jar with the mail.jar from JavaMail 1.3.3, this has not been tested by ColdFusion QA so it is not recommended at this time. The current suggested solution to this problem is to limit the number of Mail Delivery Threads to just 1, eliminating the possibility of concurrent access to the Message ID generator. This will reduce the rate at which mail messages can be sent from ColdFusion Enterprise to be equivalent to that which can sent by ColdFusion Standard Edition.