Good evening,

I have realised that with Fastmail, the INTERNALDATE fails to parse on 1-digit
days (i.e. at the beginning of each month) when "CopyArrivalDate" is set to
"yes". I tried with GMail and Migadu and both are fine, only Fastmail fails.

Here is an example of the isync verbose output when it fails:

> * 66 FETCH (UID 74 INTERNALDATE " 5-Dec-2023 08:02:58 -0500" BODY[] {53866}

See how the date starts with a white space (" 5-Dec"). I believe this string is
parse by this line [1] in isync:

```
if (!(end = strptime( str, "%e-%b-%Y %H:%M:%S ", &datetime )))
```

Here is another sample header I get from Postfix running on Fastmail's side:

> Received: from mx5 ([15.102.1.34])
>  by compute1.internal (LMTPProxy); Fri, 05 Jan 2024 16:48:38 -0500
> Received: from mx5.messagingengine.com (localhost [127.0.0.1])
> by mailmx.nyi.internal (Postfix) with ESMTP id DACD72720075
> for <m...@mydomain.com>; Fri,  5 Jan 2024 16:48:37 -0500 (EST)

Note how the date is once "Fri, 05" and once "Fri,  5" (with two white spaces).
I believe it is fine for Postfix to have two white spaces here, according to RFC
5322 [2].

I contacted the Postfix mailing list and they said that they may change the
second white space for a "0" for Postfix 3.9. Still, having multiple white
spaces is fine as per the specs, and therefore I believe that isync should not
fail in that case.

If you agree with that, I would be willing to try patching it myself, or at
least I could test a patch with my setup (it is easy for me to reproduce on
single-digit days).

What do you think?

Best Regards,
Jonas Vautherin

[1]: https://sourceforge.net/p/isync/isync/ci/1.4/tree/src/drv_imap.c#l1052
[2]: https://www.rfc-editor.org/rfc/rfc5322#section-3.3


_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to