Package: cron-apt
Version: 0.11.0
Followup-For: Bug #882309

Here we are.

Greetings
Marc
>From a9d3e5528c76642ca46b65d4cfee41a1fc33b54d Mon Sep 17 00:00:00 2001
From: Marc Haber <[email protected]>
Date: Mon, 27 Nov 2017 08:22:43 +0100
Subject: [PATCH 1/3] patch to wrap mail message to avoid long line rejects,
 closes #882309

---
 README        | 6 ++++++
 src/cron-apt  | 1 +
 src/functions | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/README b/README
index c0b52a7..e6a5536 100644
--- a/README
+++ b/README
@@ -144,6 +144,12 @@ MAILTO="root"
   The email address to send mail to.
 
 
+MAILWIDTH="900"
+
+  Maximum characters per line in the outgoing mail message.
+  Wrapping occurs at whitespace.
+
+
 DEBUG="output"
 
   When to log to the cron-apt log file.
diff --git a/src/cron-apt b/src/cron-apt
index eb1356f..95f7692 100755
--- a/src/cron-apt
+++ b/src/cron-apt
@@ -231,6 +231,7 @@ LOG="/var/log/cron-apt/log"
 DIFFONCHANGES="prepend"
 SUBJECTPREFIX="CRON-APT"
 MAILTO="root"
+MAILWIDTH="900"
 # error, always, never
 SYSLOGON="upgrade"
 # error, always
diff --git a/src/functions b/src/functions
index 3df0106..234503b 100644
--- a/src/functions
+++ b/src/functions
@@ -116,7 +116,7 @@ onexit() {
                eval "VAL=\${XHEADER$i}"
            done
            #
-            ( printf "$HDR\n"; echo; cat $MAIL ) | sendmail -t -oi
+            ( printf "$HDR\n"; echo; fold --spaces --width=${MAILWIDTH:-900} 
$MAIL ) | sendmail -t -oi
        else
            echo >&2 "cron-apt was configured to send e-mail, but no sendmail 
binary was found in path."
            echo >&2 "Either set MAILON=never in configuration or install an 
MTA package."
-- 
2.15.0

Reply via email to