a_cwrite_save1(): FIX: ensure pre-v15 MBOX separation "in between" messages..
commitf5db11fed0ad78abf9721093dd330ee9197cc202
authorSteffen Nurpmeso <steffen@sdaoden.eu>
Wed, 7 Aug 2019 00:02:17 +0000 (7 02:02 +0200)
committerSteffen Nurpmeso <steffen@sdaoden.eu>
Wed, 7 Aug 2019 00:03:39 +0000 (7 02:03 +0200)
treeed9144e2be9293b91f3847048fe8c1fbbcbf3d05
parentf744cf699a59fddc1a141badea91e161bb1459dd
a_cwrite_save1(): FIX: ensure pre-v15 MBOX separation "in between" messages..

since messages will be written date sorted when doing eg "copy * TARGET",
and we do not care about the validity of the source, only the target,
it can be that a last entry in source MBOX is taken "as-is", without
a necessary separating line that is, and that thus the follow up
entry will be corrupted.

What a mess.
As a temporary workaround, ensure that the target mailbox is validated
after writing each and every message.

P.S.: we already have such a "add trailing \n" hack, in send.c:sendpart(),
but only for those cases where we are going to the display.
We cannot overload that occurrence, though, since it could put that \n
after each MIME part.
Model-View-Controller, and objects, this is where we MUST go to!!!

P.P.S.: test follows in a separate commit
src/mx/cmd-write.c