summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-10-10 10:16:18 +0200
committerErich Eckner <git@eckner.net>2019-10-10 10:16:18 +0200
commit8feae882e53e453bc7e8a290a66c4ebcb984e501 (patch)
treee78434a63be35dd324d030ee73faddd6b1c5e362
parente7e4f9c576041ed21efca1febd2d25f2bce8557c (diff)
downloadsendmailadvanced-8feae882e53e453bc7e8a290a66c4ebcb984e501.tar.xz
sendmailadvanced.in: auto-insert spacing lines for headers/footers (will mangle successing linebreaks in header-/footer-output, too)
-rwxr-xr-xsendmailadvanced.in22
1 files 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
(