问题描述
我们的CF服务器偶尔停止处理邮件。这是有问题的,因为我们的许多客户依赖它。
我们在网上找到了在无法递送的文件夹中提及零字节文件的建议,所以我创建了一个任务,每三分钟删除一个。
我正在寻找诊断和修复此问题的建议。
- CF 8标准
- Win2k3
>
- 队列失败时邮件日志中没有错误
- 我们没有尝试运行
- 假脱机文件夹中的任何文件似乎都不是问题。
- 我们不使用附件。
已添加2:
$ b $ b
已添加3:
我们最后做的是:
我写了两个计划任务。第一个检查是否查看队列文件夹中是否有任何短于 n 个邮件(当前设置为30)的邮件。第二天在低使用期间每晚重置队列。
不幸的是,我们从来没有真正发现队列为什么会脱轨,但它似乎只发生在我们使用Exchange - 我们尝试过的其他邮件伺服器没有这个问题。
编辑:我被要求张贴我的程式码,找到旧邮件时重新启动的邮件:
< cfdirectory action =listdirectory =c:\coldfusion8 \mail\spool\name =spoolsort =datelastmodified>
< cfset restart = 0>
< cfif datediff('n',spool.datelastmodified,now())gt 30>
< cfset restart = 1>
< / cfif>
< cfif restart>
< cfset sFactory = CreateObject(java,coldfusion.server.ServiceFactory)>
< cfset MailSpoolService = sFactory.mailSpoolService>
< cfset MailSpoolService.stop()>
< cfset MailSpoolService.start()>
< / cfif>
Our CF server occasionally stops processing mail. This is problematic, as many of our clients depend on it.
We found suggestions online that mention zero-byte files in the undeliverable folder, so I created a task that removes them every three minutes. However, the stoppage has occurred again.
I am looking for suggestions for diagnosing and fixing this issue.
- CF 8 standard
- Win2k3
Added:
- There are no errors in the mail log at the time the queue fails
- We have not tried to run this without using the queue, due to the large amount of mail we send
Added 2:
- It does not seem to be a problem with any of the files in the spool folder. When we restart the mail queue, they all seem to process correctly.
Added 3:
- We are not using attachments.
What we ended up doing:
I wrote two scheduled tasks. The first checked to see if there were any messages in the queue folder older than n minues (currently set to 30). The second reset the queue every night during low usage.
Unfortunately, we never really discovered why the queue would come off the rails, but it only seems to happen when we use Exchange -- other mail servers we've tried do not have this issue.
Edit: I was asked to post my code, so here's the one to restart when old mail is found:
<cfdirectory action="list" directory="c:\coldfusion8\mail\spool\" name="spool" sort="datelastmodified">
<cfset restart = 0>
<cfif datediff('n', spool.datelastmodified, now()) gt 30>
<cfset restart = 1>
</cfif>
<cfif restart>
<cfset sFactory = CreateObject("java","coldfusion.server.ServiceFactory")>
<cfset MailSpoolService = sFactory.mailSpoolService>
<cfset MailSpoolService.stop()>
<cfset MailSpoolService.start()>
</cfif>
这篇关于ColdFusion邮件队列停止处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!