3
EWS error with eM Client
Problem reported by echoDreamz - 10/6/2018 at 5:19 PM
Not A Problem
5:26:31 PM REMOVED [Exchange Web Services]  Sending email: Fw: Court Docs
 5:26:31 PM   MailClient.Storage.Application.OperationException: Sending email failed due to the following error: The expected XML node type was Element, but the actual type is EndElement. ---> Microsoft.Exchange.WebServices.Data.ServiceXmlDeserializationException: The expected XML node type was Element, but the actual type is EndElement.
 5:26:31 PM    at Microsoft.Exchange.WebServices.Data.EwsXmlReader.Read(XmlNodeType nodeType)
 5:26:31 PM    at Microsoft.Exchange.WebServices.Data.EwsXmlReader.InternalReadElement(XmlNamespace xmlNamespace, String localName, XmlNodeType nodeType)
 5:26:31 PM    at Microsoft.Exchange.WebServices.Data.ServiceResponse.LoadFromXml(EwsServiceXmlReader reader, String xmlElementName)
 5:26:31 PM    at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.ParseResponse(EwsServiceXmlReader reader)
 5:26:31 PM    at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ReadResponse(EwsServiceXmlReader ewsXmlReader)
 5:26:31 PM    at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponseXml(Stream responseStream)
 5:26:31 PM    at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponse(IEwsHttpWebResponse response)
 5:26:31 PM    at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
 5:26:31 PM    at Microsoft.Exchange.WebServices.Data.ExchangeService.FindItems[TItem](IEnumerable`1 parentFolderIds, SearchFilter searchFilter, String queryString, ViewBase view, Grouping groupBy, ServiceErrorHandling errorHandlingMode)
 5:26:31 PM    at Microsoft.Exchange.WebServices.Data.ExchangeService.FindItems(FolderId parentFolderId, SearchFilter searchFilter, ViewBase view)
 5:26:31 PM    at MailClient.Protocols.Exchange.ExchangeMailSynchronizer.<>c__DisplayClass18_0.<SendAsync>b__0(WorkerStatus status, CancellationToken cancellationToken)
 5:26:31 PM    at MailClient.Protocols.Exchange.ExchangeGenericCommand.Execute(WorkerStatus status)
 5:26:31 PM    --- End of inner exception stack trace ---
 5:26:31 PM    at MailClient.Protocols.Exchange.ExchangeGenericCommand.Execute(WorkerStatus status)
 5:26:31 PM    at MailClient.Commands.Command.Process(WorkerStatus status)
 5:26:31 PM REMOVED [Exchange Web Services]  Sending email: Fw: Court Docs
Receiving errors when trying to forward an email with an attachment. Already contacted eM Client, they of course dumped it to SmarterMail. Running 16.3.6843.

12 Replies

Reply to Thread
0
echoDreamz Replied
[2018.10.06] 17:25:27 [10.10.10.4]REMOVED - Error processing request: Unexpected end of file has occurred. The following elements are not closed: t:MimeContent, t:Message, m:Items, m:CreateItem, soap:Body, soap:Envelope. Line 13, position 12508478.
The error from the EWS logs in SM.
0
Larry Duran Replied
Employee Post
Hey Chris, do you know how big the attachment was and the file type?  I just tried a simple test (forwarded a 22kb txt file) and didn't see the errors in my eM Client.
Larry Duran Software Developer SmarterTools Inc. www.smartertools.com
0
echoDreamz Replied
Larry, it was ~11MB.
0
echoDreamz Replied
This is with the latest build of eM Client as well
0
Larry Duran Replied
Employee Post
Hey Chris, this feels like an IIS request limit that we're running into.  I tried sending an email with a larger attachment and my web server returned a 404.  From that point forward when I tried a sync on my eM Client account I was seeing similar XML errors like you reported.

I altered my Web.config file to increases some request sizes and that fixed the issue for me.  Can you alter your Web.config file so it contains the following values (the Web.config is normally located under 'c:\Program Files (x86)\SmarterMail\MRS\Web.config').
  • Look for the maxRequestLength located under system.web -> httpRuntime and increase that value to what you feel would be an appropriate size.  In my test environment I increased it to 1gb (maxRequestLength="1000000000") but you may want something smaller.
  • Under the security -> requestFiltering section can you change it to the following (you can make this the same size value you specified in the step above).
<security>
  <requestFiltering allowDoubleEscaping="true">
    <requestLimits maxAllowedContentLength="1000000000" />
  </requestFiltering>
</security>

You'll probably need to perform an iisreset from a CMD prompt for these values to take.  Once that's done try to forward that email again and see if it works this time.
Larry Duran Software Developer SmarterTools Inc. www.smartertools.com
0
echoDreamz Replied
Nope, our max allowed content length is set to 524288000 bytes, which is about 520MB.
0
Larry Duran Replied
Employee Post
Is it set in both instances that I have listed in my post above?
Larry Duran Software Developer SmarterTools Inc. www.smartertools.com
0
echoDreamz Replied
Yes, SM is set to 100MB, it appears that SM defaults to this value...

<httpRuntime targetFramework="4.5" executionTimeout="9999" maxRequestLength="102400" />
Note that I can easily upload 25MB files through the web interface. To messages as well as the file storage. After restarting IIS though just for giggles, I had them retry forwarding the message and it worked. So not sure if restarting IIS fixed some issue or what.
0
Larry Duran Replied
Employee Post
Hey Chris,

Ok that's good to hear that it is working after an IIS restart.  To just clarify, our web API goes through a different layer than our EWS protocol, which is why one is limited to the IIS setting and the other is not.  That's why it would work using web mail.
Larry Duran Software Developer SmarterTools Inc. www.smartertools.com
0
echoDreamz Replied
Yeah, though both settings were well over 8MB. I did see our IIS worker process was using just a hair over 4GB of RAM. Not sure what was up, forwarded the mail numerous times without issues. Will try again in a week or 2 once IIS has had time to run longer.
0
Larry Duran Replied
Employee Post
Good idea.  If the process does creep up again we can take a look and see if it's SmarterMail causing the issue.  Keep us posted if you find anything.
Larry Duran Software Developer SmarterTools Inc. www.smartertools.com
0
Matt Petty Replied
Employee Post
Our uploader for files also does chunking which can allow multiple gig files to be uploaded as uploads are "chunked" into 2-5mb chunks that get recombined by SmarterMail into one singular file. This is to allows resumable uploads to be performed on the server as well as giving the ability for massive files bypassing any request limits.
Matt Petty Senior Software Developer SmarterTools Inc. www.smartertools.com

Reply to Thread