1

Here is my server set up:

  • Web Server: ColdFusion 10 u10 64-bit, Windows Server 2008 R2, multiple public/private IP addresses.
  • Mail server: Is a different Windows 2008 R2 server.

Keeping it simple for this question, I have two web sites (this is just theory; using private IPs in example).

  • Site 1: 10.10.10.1
  • Site 2: 10.10.10.2

I'm sending mail using the cfmail tag from Site 1 (10.10.10.1), but when I look at the mail headers of the sent emails and the SMTP log on the mail server, it says that the mail was sent from Site 2 (10.10.10.2).

I did some google searches regarding this issue and came up with this bugbase report. The bug doesn't appear to have been fixed. However, I was wondering if there were any work-arounds. I want the mail that is sent from "Site 1" to have that sites IP address in the email header.

Mike Causer
  • 8,196
  • 2
  • 43
  • 63
Scott Jibben
  • 2,229
  • 1
  • 14
  • 22
  • That is more of an SMTP/TCPIP issue. Coldfusion just generates the message and connects to your SMTP server. Your SMTP server adds all the tags and stamps the IP Address. If you connect to your remote server and open a web browser and lookup the IP through dslreports.com/whois that will most likely be the same IP used for mail, cfftp, cfhttp, etc.... Coldfusion doesn't read the IP address that is bound through IIS (at least to my knowledge and experience). – steve Jun 05 '13 at 12:24
  • @steve, thank you but I'm not sure that is right either. I tried dslreports.com/whois and it returns with the primary IP address of the server. The SMTP connections that I'm seeing are not the primary IP address but for a specific bound IP address on the server. It does appear that CF doesn't use the IP address from the site that uses cfmail. I think that it should... In theory if you were hosting ibm.com and compaq.com. Would you want to see that cfmail for ibm.com that has compaq.com as the sender in the email header? – Scott Jibben Jun 05 '13 at 15:13
  • Take this scenario, you have a shared hosting server with 50 sites, all on their own IP address in IIS, running coldfusion and using cfmail with the default SMTP server entered in to the administrator. Each of those messages will have the same exact header except for the to/from/subject. Coldfusion/to my experience does not look at the IP address from IIS binding. The first "IP stamp" will come from the default IP of the SMTP server. What SMTP server are you running? I have a setup myself, such as the one described in the comment. – steve Jun 05 '13 at 15:31

1 Answers1

0

Have you tried specifing the mailserver similar to the below?

 <cfmail 
to="<<<email>>>"
from="<<<fromEmail>>>"
subject="Some Subject"
type="html"
server="server to send from (ip)" 
port="port for mail server">
        body=" <<<content here>>>"

By default Coldfusion will use the email server configured in the admin console. By defining mail servers in the cfmail tag this should be overwritten.

JanR
  • 6,052
  • 3
  • 23
  • 30