From 2c34348878f40b9a0fe9784baf89d02cb3dac252 Mon Sep 17 00:00:00 2001
From: Mark Sapiro <mark@msapiro.net>
Date: Sat, 4 Mar 2017 13:21:54 -0800
Subject: Ensure added headers and footers have a trailing new-line.

---
 Mailman/Handlers/Decorate.py | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'Mailman')

diff --git a/Mailman/Handlers/Decorate.py b/Mailman/Handlers/Decorate.py
index 69e86d5b..de8b44e6 100644
--- a/Mailman/Handlers/Decorate.py
+++ b/Mailman/Handlers/Decorate.py
@@ -240,4 +240,7 @@ def decorate(mlist, template, what, extradict=None):
     except (ValueError, TypeError), e:
         syslog('error', 'Exception while calculating %s:\n%s', what, e)
         text = template
+    # Ensure text ends with new-line
+    if not text.endswith('\n'):
+        text += '\n'
     return text
-- 
cgit v1.2.3