• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFMail and Message-Id

New Here ,
May 10, 2006 May 10, 2006

Copy link to clipboard

Copied

All the emails sent from my server (Win 2k3, CFMX7) using CFMAIL have a Message-Id that looks like:
Message-ID: <xxx.xxx.JavaMail.SYSTEM@serverName>,
where serverName is the local name of my server. It is recommended to have a fully qualified domain name instead:
Message-ID: <xxx.xxx.JavaMail.SYSTEM@serverName.domainName.com>

I have tried to add a Message-ID to my emails using CFMAILPARAM, but it did not work. Does anyone know where CF picks up the machine name, and how to make it use a FQDN?

Thanks



TOPICS
Advanced techniques

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Feb 13, 2007 Feb 13, 2007
In CFMX7 you can set mail.host as a java property by updating your JVM arguments with:
-Dmail.host=machine.server.com
ie.:
-Dmail.host=ksmith.adobe.com

Set this in your jvm.config or from the cfadmin java settings page. Restart cfmx.

My mail creates message-IDs now as:
Message-id: <11031144.1171396887328.JavaMail.kensmith@kensmith.adobe.com>

It also appears to work if you set the system property on the template before calling CFMail:
<cfscript>
sysObj = CreateObject("java", "java.lang.Syst...

Votes

Translate

Translate
New Here ,
May 11, 2006 May 11, 2006

Copy link to clipboard

Copied

Does anyone have an idea?
Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 11, 2006 May 11, 2006

Copy link to clipboard

Copied

What you are seeing is usually more a SMTP issue than anything else, in particular the MX (no, not ColdFusion MX) record for your mailhost.

This thread may help a little: http://forum.java.sun.com/thread.jspa?threadID=688541&messageID=4036606

If you are running SMTP and CF on the same system, you may have a lot of fun ahead. If not, it should be a pretty straightforward fix.

&laz;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 11, 2006 May 11, 2006

Copy link to clipboard

Copied

Hey,

thanks a lot for the reply. I actually found that thread earlier too, but I could not think of a way to overwrite the mail.host value from CF the same way the posted does it in his Java code. I really think that it is related to the setup of the server, not sure why my MX record would be causing that (they have to do with inbound mail only).
I have tried as well to change the JavaMail settings in CFusionMX7\runtime\servers\coldfusion\SERVER-INF\jrun.xml, but it had no effect on the emails being sent from the server. Another solution would be to send the message to a SMTP server that has the ability to rewrite the headers. Do you by any chance know of one?

Thanks again!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 12, 2006 May 12, 2006

Copy link to clipboard

Copied

The only reason I can think of off the top of my head as to the missing domain information is if your ColdFusion host server does not see itself as part of the domain, similar to what would happen in the older Windows95/WindowsNT world when a PC was in "Workgroup". Even then I am not sure ColdFusion could be the cause, because ultimately the SMTP system is the one that assigns that information - ColdFusion merely spools the message you want to send and tosses it over the wall to whatever hostname/address you specified in your mail server settings.

Sendmail can do a lot of things to messages, but I would have to research header modification. I think it goes back to what you are running for SMTP - any particulars you can provide about that system would be helpful.

One possible stab in the dark, check out the 2nd-to-last post in this thread re: the system32\drivers\etc\yhosts file:
http://www.talkingtree.com/blog/index.cfm?mode=entry&entry=278BC7AC-50DA-0559-A0C1C9BF66FC9CF1

&laz;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 13, 2006 May 13, 2006

Copy link to clipboard

Copied

Hey,
thanks once more for the reply. Looks like Google is directing us to the same pages again! I tried the chnages in the host files as recommended in the thread you mention, but it did not change anything.

My servers are not part of a domain, but I remember reading someone who had similar issues on a server that was a domain controller. It might be a good idea to still try, but I am afraid to potentially loose a lot of time for no result.

The SMTP server I connect to is hosted on another server, and runs an IIS SMTP Virtual Server. It has the ability to "masquerade" a domain name, but the setting did not have any effect on my outgoing messages. It think that it has mostly to do with changing the sender's email address, and not the headers of the message itself.

Thanks again, I will keep looking and let you know here if I find something that works. I was surprised to not find more info on this on the web, it must be a pretty common problem. Maybe people do not care as soon as the emails are being sent. It would be nice to send them with correct headers.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 13, 2006 May 13, 2006

Copy link to clipboard

Copied

Oh, by the way, my name is Jean Moniatte, I was the guy who asked Steven more info (the link you gave)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 15, 2006 May 15, 2006

Copy link to clipboard

Copied

Well, I guess my pointing to your own post hardly helps the situation!

I will admit upfront that I am not a Microsoft expert, as my SA experience is 60% Linux, 20% Solaris, 10% FreeBSD, and 10% Windows. That said, here is the one relatively similar Windows-based configuration that I worked with:

Development Windows 2000 Server running Apache and ColdFusion 5
Production Windows 2000 Server running Apache and ColdFusion 5
Utility Windows 2000 Server running DNS and SMTP
(and a couple of other boxes)

In that configuration, we did not use a domain controller, and everything was set up in a workgroup configuration. I set the computer names manually (My Computer -> Properties -> Computer Name -> Change ... -> server.domain.com in the first box) for all three systems and joined them to an internal workgroup just for administrative purposes.

The ColdFusion servers (both Enterprise versions) were set up to go to mailhost.domain.com, and mailhost was an alias of the SMTP system in DNS. I set the administrator email address to be the same value as the default from address in most of the apps (which was a catch-all for the domain, essentially) and made that address an allowed relayer in the SMTP server. I told the SMTP server to supress the hostname in the mail message so the final "from" address looked like "user@domain.com".

When either ColdFusion system sent mail, the message headers showed a translation from "user@development.domain.com" to "user@domain.com" on the SMTP server, which was exactly what we wanted.

My concern is that the versions of everything I used are too old to be relevant to the issues you face - I will check the release notes for both Windows and ColdFusion and see if anything related to SMTP is of glaring relevance.

&laz;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 13, 2007 Feb 13, 2007

Copy link to clipboard

Copied

In CFMX7 you can set mail.host as a java property by updating your JVM arguments with:
-Dmail.host=machine.server.com
ie.:
-Dmail.host=ksmith.adobe.com

Set this in your jvm.config or from the cfadmin java settings page. Restart cfmx.

My mail creates message-IDs now as:
Message-id: <11031144.1171396887328.JavaMail.kensmith@kensmith.adobe.com>

It also appears to work if you set the system property on the template before calling CFMail:
<cfscript>
sysObj = CreateObject("java", "java.lang.System");
sysObj.setProperty("mail.host", "kensmith.adobe.com");
</cfscript>

<CFMail ...

NOTE: As java.lang.System should imply - you are updating a system property. Therefore all users of cfmail will use this mail.host. If you are going to use several mail hosts, you will need to use named cflocks around this code, so you do not have multiple changes to mail host while it is in use. If you only want a single mail.host, this will work fine as is.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 14, 2007 Feb 14, 2007

Copy link to clipboard

Copied

Hi,

I have change the jvm.config file and it looks like this now:

# Arguments to VM
java.args=-server -Xmx512m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=128m -XX:+UseParallelGC -DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS -Dcoldfusion.rootDir={application.home}/../ -Dcoldfusion.classPath={application.home}/lib/updates,
{application.home}/lib,{application.home}/gateway/lib/,{application.home}/wwwroot/WEB-INF/cfform/jars -Dcoldfusion.libPath={application.home}/lib
-Dmail.host=iis.matchingpool.nl

Then restarted the service, but the message ID doesn't change ??
Message-ID: <2612772.1171441971666.JavaMail.Administrator@iis>

Our config is CFMX7 on windows 2003 r2 server with IIS.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 14, 2007 Feb 14, 2007

Copy link to clipboard

Copied

Put the argument near the beginning. Make sure there are no extra spaces or any carriage returns in the list of args. This works for me and several customers.

Try:
# Arguments to VM
java.args=-server -Xmx512m -Dmail.host=iis.matchingpool.nl
-Dsun.io.useCanonCaches=false -XX:MaxPermSize=128m -XX:+UseParallelGC -DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS -Dcoldfusion.rootDir={application.home}/../ -Dcoldfusion.classPath={application.home}/lib/updates,
{application.home}/lib,{application.home}/gateway/lib/,{application.home}/wwwroot/WEB-INF/cfform/jars -Dcoldfusion.libPath={application.home}/lib

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 14, 2007 Feb 14, 2007

Copy link to clipboard

Copied

LATEST
OK I will try this

both sollutions works fine by us now THNX

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation