-1

We have a dedicated server running CentOS and Coldfusion 8.

All cfmail email is routed through Google with cfmail and smtp.

Every now and then, when cfmail is used, the 'FROM' field uses an address from a totally different website.

For instance:

Use form on Site A Get an email: "Subject: On Site A From: siteb@siteb.com"

Where the from is a completely different variable in another set of code on another part of the server- there is no reason it should see this.

On the other side, sometimes sending an email to sitea@sitea.com has email wind up in Site B inbox, a completely different Google account.

What causes this to happen? Some kind of memory/cache issue? Or is there a funky DNS record causing issue?

Example:

Application.cfm (starts with some UDF includes, and then):

<cfinvoke component="#request.componentPath#.variables" method="getGlobal" />

Variables.cfc (a lot of variables defined within, but here is the cfmail vars):

<cffunction name="getGlobal" access="public" output="false" returntype="void">
   <cfscript>
      request.siteEmail = "email@mysite.com";
      request.siteMailServer = "smtp.gmail.com";
      request.siteMailUsername = "root@mysite.com";
      request.siteMailPassword = "[redacted]";
   </cfscript>
</cffunction>
Kevin
  • 13,153
  • 11
  • 60
  • 87
  • Start simply. What kind of `variables`? What code is used for the mail? Any shared scopes involved? – Leigh Jun 29 '11 at 18:49
  • Just in the Application scope. The cfmail tag is calling request vars from Application.cfc, to define the mail server, and authentication credentials. – Kevin Jun 29 '11 at 18:54
  • 2
    Rather than us making assumptions, can you post a minimal example of the Application.cfc's involved, the mail code (and whether any other cfc's are involved)? – Leigh Jun 29 '11 at 18:58
  • 2
    can we see your Application.cfc for both sites? – Sean Kimball Jun 29 '11 at 18:58
  • do your two applications share the same application name? – Sean Coyne Jun 29 '11 at 19:40
  • Any of the CF sites will have this same implementation of the variable scope, and the Application names are all unique. – Kevin Jun 29 '11 at 20:58
  • If the error is reliable enough to recreate on demand, try differing, hard-coded component paths for two sites and try to replicate. This would help narrow the suspects. :) – Nate Jul 09 '11 at 13:01
  • Where does the from come from? How does the cfmail look like? – Bernhard Döbler Mar 12 '19 at 14:00

2 Answers2

2

It sounds like it's possible it could be a var scoping issue, but we can't know for sure until you share some code...

Community
  • 1
  • 1
Adam Tuttle
  • 19,505
  • 17
  • 80
  • 113
0

Looks like you're running multiple sites? there's a setting in the CF caching page in admin to do with caching web server paths:

From http://help.adobe.com/en_US/ColdFusion/9.0/Admin/WSc3ff6d0ea77859461172e0811cbf3638e6-7ffc.html :

Disabling the cacheRealPath attribute To ensure that ColdFusion always returns pages from the correct server, disable Cache Web Server Paths in the Caching page of the ColdFusion Administrator. (When you use the multiserver configuration, set the cacheRealPath attribute to false for the ProxyService in the jrun_root/servers/servername/SERVER-INF/jrun.xml file.)

Might not be it, but it's at least quick to try out.

barnyr
  • 5,678
  • 21
  • 28