11 Replies Latest reply on Feb 14, 2007 12:47 PM by OliBBommel

    CFMail and Message-Id

      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?


        • 1. Re: CFMail and Message-Id
          carolarouge Level 1
          Does anyone have an idea?
          • 2. Re: CFMail and Message-Id
            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.

            • 3. Re: CFMail and Message-Id
              carolarouge Level 1

              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!
              • 4. Re: CFMail and Message-Id
                dlasley Level 1
                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-A0C1C9BF66FC 9CF1

                • 5. Re: CFMail and Message-Id
                  carolarouge Level 1
                  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.
                  • 6. Re: CFMail and Message-Id
                    carolarouge Level 1
                    Oh, by the way, my name is Jean Moniatte, I was the guy who asked Steven more info (the link you gave)
                    • 7. Re: CFMail and Message-Id
                      dlasley Level 1
                      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.

                      • 8. CFMail and Message-Id
                        ksmith Level 1
                        In CFMX7 you can set mail.host as a java property by updating your JVM arguments with:

                        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:
                        sysObj = CreateObject("java", "java.lang.System");
                        sysObj.setProperty("mail.host", "kensmith.adobe.com");

                        <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.
                        • 9. Re: CFMail and Message-Id

                          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

                          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.

                          • 10. Re: CFMail and Message-Id
                            ksmith Level 1
                            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.

                            # 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
                            • 11. CFMail and Message-Id
                              OliBBommel Level 1
                              OK I will try this

                              both sollutions works fine by us now THNX