开发者

Coldfusion uses wrong (cached?) variables at random

开发者 https://www.devze.com 2023-03-16 18:58 出处:网络
We have a dedicated server running CentOS and Coldfusion 8. All cfmail email is routed through Google with cfmail and smtp.

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 开发者_StackOverflow社区'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>


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...


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消