Re: [Bug 3159] New: Exim fails to deliver paniclog email when it contains long lines

Jeremy Harris via Exim-dev <[email protected]>
Newsgroups gmane.mail.exim.devel
Message-ID <[email protected]>
On 2025/09/20 11:26 AM, Thomas Hochstein via Exim-dev wrote:
> That's not Exim sending those mails, but a cronjob* from the exim4-base
> Debian package, located at /etc/cron.daily/exim4-base with those lines:
> | if [ "$E4BCD_WATCH_PANICLOG" != "no" ]; then
> |   if [ -s "/var/log/exim4/paniclog" ]; then
> |     if [ -x "/usr/local/lib/exim4/nonzero_paniclog_hook" ]; then
> |       /usr/local/lib/exim4/nonzero_paniclog_hook
> |     fi
> |     if [ -z "$E4BCD_PANICLOG_NOISE" ] || grep -vq "$E4BCD_PANICLOG_NOISE" /var/log/exim4/paniclog; then
> |       log_this "ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken"
> |       if ! printf "Subject: exim paniclog on %s has non-zero size\nTo: %s\n\nexim paniclog /var/log/exim4/paniclog on %s has non-zero size, mail system might be broken. Up to ${E4BCD_PANICLOG_LINES} lines are quoted below.\n\n%s\n" \
> |       "${HOSTNAME}" "${E4BCD_PANICLOG_REPORT_TO}" "${HOSTNAME}" \
> |       "$(if [ -z "$E4BCD_PANICLOG_NOISE" ] ; then tail -n "${E4BCD_PANICLOG_LINES}" /var/log/exim4/paniclog ; else grep -v "$E4BCD_PANICLOG_NOISE" /var/log/exim4/paniclog | tail -n "${E4BCD_PANICLOG_LINES}" ; fi)" \
> |       | exim4 "${E4BCD_PANICLOG_REPORT_TO}"; then
> |         log_this "PANIC: sending out e-mail warning has failed, exim has non-zero return code"

At the very least they could put "  awk '{print substr($0, 0, 998)}'  " into that pipeline.
Or, there exists MIME::QuotedPrint.
-- 
Cheers,
   Jeremy
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.