nodemailer / wildduck

Opinionated email server
https://wildduck.email/
European Union Public License 1.2
1.92k stars 268 forks source link

Should `asctime` pad with leading 0 for the day? #722

Closed titanism closed 3 months ago

titanism commented 3 months ago

e.g. https://github.com/nodemailer/wildduck/blob/49bd5015c188079e3a265c0873178e805f84ca2e/lib/mbox-stream.js#L192

-    res.push((day.length < 2 ? ' ' : '') + day);
+    res.push((day.length < 2 ? '0' : '') + day);

To mirror other implementations such as Dovecot/Thunderbird, e.g. https://github.com/thunderbird/import-export-tools-ng/commit/39474c6397139f3f9586e27b282844c58b6b83b2

titanism commented 3 months ago

Dovecot tests show it doesn't have trailing 0, so probably unnecessary.

https://github.com/dovecot/core/blob/8235c782aa3a125ffc2d979708e2252a0ad616d6/src/lib-mail/test-mbox-from.c#L22

andris9 commented 3 months ago

Asctime uses space-padding instead of zero-padding.