From 8feae882e53e453bc7e8a290a66c4ebcb984e501 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 10 Oct 2019 10:16:18 +0200 Subject: sendmailadvanced.in: auto-insert spacing lines for headers/footers (will mangle successing linebreaks in header-/footer-output, too) --- sendmailadvanced.in | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/sendmailadvanced.in b/sendmailadvanced.in index 5e5a58e..b3433b4 100755 --- a/sendmailadvanced.in +++ b/sendmailadvanced.in @@ -228,11 +228,29 @@ fi ( for hookParam in "${hooks[@]}"; do "#ETCDIR#/sendmailadvanced.hooks/${hookParam}" head - done + echo + done \ + | sed ' + /^$/ { + :a + N + s@^\n$@@ + ta + } + ' cat for hookParam in "${hooks[@]}"; do "#ETCDIR#/sendmailadvanced.hooks/${hookParam}" foot - done + echo + done \ + | sed ' + /^$/ { + :a + N + s@^\n$@@ + ta + } + ' ) | \ if ${encrypt}; then ( -- cgit v1.2.3-70-g09d2