This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new 6c33300  ensure sources end with a blank line
6c33300 is described below

commit 6c33300d9564e8a99bdeff0a4dab8253aa6412ea
Author: Daniel Gruno <[email protected]>
AuthorDate: Sat Sep 18 09:27:56 2021 -0500

    ensure sources end with a blank line
---
 server/endpoints/mbox.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/server/endpoints/mbox.py b/server/endpoints/mbox.py
index 5493727..44e5475 100644
--- a/server/endpoints/mbox.py
+++ b/server/endpoints/mbox.py
@@ -98,6 +98,9 @@ async def process(
     await response.prepare(request)
     for email in results:
         mboxrd_source = await convert_source(session, email)
+        # Ensure each non-empty source ends with a blank line
+        if not mboxrd_source.endswith("\n\n"):
+            mboxrd_source += "\n"
         try:
             async with server.streamlock:
                 await 
asyncio.wait_for(response.write(mboxrd_source.encode("utf-8")), timeout=5)

Reply via email to