Why is the get action of cfexchangemail never returning?

时光毁灭记忆、已成空白 提交于 2019-12-10 17:31:36

问题


We are running Coldfusion 9.0.1 and have successfully used cfexchangemail to retrieve email for a number of years.

Within the last few days the calls for some users never return. This leads to ColdFusion stacking up active requests which eventually leads to no response for any request.

For other users the calls work successfully.

This is the call:

<cfexchangemail action="get" folder="Inbox " name="weeksMail" connection="testconn1">
    <cfexchangefilter name="maxRows" value=4>
</cfexchangemail>

Has anyone had similar problems?

UPDATE:

I ran some manual queries with a test account that was functioning fine in production. If I remove the maxRows filter I get a very long running request (have yet to see it return). Setting the maxRows to 18 allows the request to complete but only after about 10 seconds. Setting maxRows to 19 seems to get it into non responsive mode.

This seems to indicate a size of message or some kind of corrupt data.

UPDATE 2:

It appears to be a size of email issue. If Inbox has only one email the call will never return if the size is (roughly) about 20kb. A 19kb email can is returned properly.

The question now is: Has this been the case all along and we are only seeing email this large now or did something change? As far as I know nothing has changed on our CF install.

UPDATE 3

Coldfusion 10 has now been tested. We get the same result.

UPDATE 4

I've been able to trigger the problem with a straight WEBDAV hit, which take ColdFusion out of the picture.


回答1:


As per my experience cfexchangemail tag(CF10/CF11) is always slow and sometime you get request timeout error. I ended up using Java EWS Managed API, which is faster than cfexchangemail tag for sure. However, you just need to learn how to use methods return by API.

Here is an example how to create an object of microsoft.exchange.webservices

<cfscript>

    service = createObject("Java", "microsoft.exchange.webservices.data.ExchangeService");
    service.init();

    version = createObject("Java", "microsoft.exchange.webservices.data.ExchangeVersion");
    service.init(version.Exchange2010);

    credentials = createObject("Java", "microsoft.exchange.webservices.data.WebCredentials");

    credentials.init(yourusername, yourpassword);
    service.setCredentials(credentials);

    uri = createObject("Java", "java.net.URI");
    uri.init("outlook webservices url");
    service.setUrl(uri);
    WellKnownFolderName=createObject("Java","microsoft.exchange.webservices.data.WellKnownFolderName");
    result = service.FindItems(service.WellKnownFolderName.Inbox, CreateObject("java", "microsoft.exchange.webservices.data.ItemView").init(100));

    for(item in result.getItems(){
        // ..loop through each field and store their value 
        // in query object or something...
    }

</cfscript>


来源:https://stackoverflow.com/questions/21048664/why-is-the-get-action-of-cfexchangemail-never-returning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!