function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Email Services timing out & bouncing error messages; should retry

We post emails into Salesforce both over the API as well as using Email Services.


In our experience, Email Services is less reliable than the API. In particular, we see error messages like this:


554 Request timed out waiting for connection: [config 200ms, actual 209ms] to ConnPool_2, Num waiting=5, Thread=/sfdc/Soap/classInstance/..., Current OrgId=..., Current UserId=..., Current url=/sfdc/Soap/classInstance/...


If we get an timeout error on the API, we can easily retry the transaction.


But with Email Services, the error above is fatal. Rather than retrying after a timeout, Email Services simply throws up its hands and bounces the message.

The lack of a retry-on-error capability within Email Services seems like a bug.  This is a purely internal-to-salesforce error, out of the hands of the user, and retrying the offending transaction takes work (you have to strip the original email out of the error bounce and then repost it to the Email Services address).  


Note that Email Services *will* requeue a message after "Over Rate Limit" failures, so there is a retry queue available.  Please use it after transient errors like the above!

Best Answer chosen by Admin (Salesforce Developers) 

From SFDC R&D: 

On August 13th, Salesforce rolled out a new inbound mail processing engine ("Core Mail Processor") which automatically retries messages that fail with temporary errors like these.

The new retry logic sounds like exactly what I want.  There may still be intermittent, underlying bugs, but the new retry logic hides them from me and the email gets processed eventually w/o any intervention.  indeed, I have not seen any occurences of this error since the rollout.