From s.arcus at open-t.co.uk Thu Oct 2 14:51:38 2025 From: s.arcus at open-t.co.uk (Sebastian Arcus) Date: Thu, 2 Oct 2025 15:51:38 +0100 Subject: [imp] Update - certain emails blocking ActiveSync on iPhones In-Reply-To: <20211012235922.Horde.inLrBzvft7kAC-IzkuMqbw2@tarn.theupstairsroom.com> References: <20211012195432.Horde.Esf0uUCcsSKdKQdKdMfPdBv@tarn.theupstairsroom.com> <20211012235922.Horde.inLrBzvft7kAC-IzkuMqbw2@tarn.theupstairsroom.com> Message-ID: <33d1b179-db14-4997-316e-e7a263391dff@open-t.co.uk> On 13/10/2021 00:59, Michael J Rubinsky wrote: > > Quoting Sebastian Arcus : > >> On 12/10/2021 20:54, Michael J Rubinsky wrote: >>> >>> Quoting Sebastian Arcus : >>> >>>> Further to my thread from a few weeks ago, this has started >>>> happening on a second iPhone at the same site. Emails on this iPhone >>>> have stopped syncing completely 4 days ago. >>>> >>>> This time, after the hints from Michael J Rubinsky, I've taken a >>>> closer look at the inbox of the affected account on a computer, and >>>> the email immediately after the last message which has synced >>>> successfully on the phone has the following subject line: >>>> >>>> <><> Site Inspection Report, Marshalswick, St Albans >>>> >>>> There were 7 emails with this subject line - part of a thread. After >>>> moving them away from the inbox to another folder, the sync resumed >>>> instantly on the iPhone. >>>> >>>> Is it possible that some characters in the subject line above trip >>>> Horde, or the ActiveSync protocol somewhere? If I reconfigure the >>>> iPhone to use imap, it syncs all messages of any type, without >>>> complaints - so the issue seems to be somewhere between ActiveSync, >>>> Horde and the Mail app on the phone. >>> >>> It could be anything to do with those emails, could be some memory >>> limit being hit...could be lots of things. Unfortunately debugging >>> EAS stuff is tough. I really can't look more into it without either a >>> FULL activesync log - showing all the data, or copies of the emails >>> so I can try to replicate the issue locally.  There are tons of >>> things that can trip up activesync clients and we try to catch most >>> of them (things like email headers with the wrong charset etc..). >>> Also, what version of PHP are you using? >> >> I have just sent you one of the emails suspected to cause the >> ActiveSync issue. >> >> For the log - do I turn on ActiveSync logging per device - and send >> you the log for this particular iPhone - or do you want a log >> containing all the devices talking to the server? > > Use per device logging and I only need that one device's log during the > time it issued a sync and retrieved the results that are failing.  If > your version of horde has the option to enable "detailed" instead of > "protocol" logging for the activesync log, please enable that too (I > can't remember which version I introduced that in :) > >> >> This server has PHP 7.3.10 >> >> >>>> >>>> Last time when this happened I also tried the Outlook app using >>>> ActiveSync / Exchange on the iPhone - and that was even worse. It >>>> refused to download any email. It kept on saying "There is no email >>>> here" when checking the inbox. >>>> >>>> I thought maybe the above sheds a bit more light on this issue. >>>> Please let me know if any further details are needed. I can collect >>>> some debug logs, or forward the troublesome email in full if that >>>> helps. >>> >>> Indeed, a copy of the email as well as a full log would be very >>> helpful. You can forward them directly to my email address. I >>> probably won't have time to look at them for another week or so >>> though... In case it helps someone out there save some time and energy chasing this issue: I know this issue was reported a long time ago, but it took me that long to figure out what was happening. Or at least I'm kind of certain I found the cause. Just a quick recap - iPhones connected over ActiveSync to Horde back-end. On occasion an iPhone would be stuck in an endless loop of attempting to re-sync the Inbox and stumbling around the same point in the list, then starting again the sync from the bottom, and again, and again. On most of my installs the, php.ini option "max_execution_time" was set to 30 or 60 seconds - which was the default that came with it. This worked ok for many years, as the phones would only have to download whatever new emails were added since the last sync - which is not that much. And newly setup accounts would normally be empty - so the first sync didn't take long. But on occasion an existing account might, for some reason or another, trigger a re-sync from the client/phone end. Even if the phone is setup only to sync the previous 30 days worth of emails only, on a busy account this could be a considerable number of emails - many with attachments. During the course of this re-sync attempt, the "max_execution_time" limit would be reached, the sync is killed off from the server end, and the phone attempts to start all over again from the bottom of the list. And again and again. All being equal - the connection speed, server speed etc. - the sync would always appear to stumble approximately around the same email in the Inbox - so it looked suspiciously like one of the emails was breaking the sync. I have increased the max_execution_time to 600/900 seconds on my installs, and this seems to have cured the issue. I've started doing this about a year ago, and there are no more problems. I hope the above helps someone - at least it has worked for me