#983916 dma can't send mail with long lines

Package:
dma
Source:
dma
Description:
lightweight mail transport agent
Submitter:
Graham Cobb
Date:
2022-05-21 04:21:03 UTC
Severity:
normal
#983916#5
Date:
2021-03-03 10:16:24 UTC
From:
To:
I am using dma on a few standalone systems for handling reports from
various system daemons.

One of those daemons is logwatch. On one system, logwatch is reporting on some
log lines which happen to be very long (1060 characters). When one of those
log lines is included, logwatch gets an error sending the mail:

/etc/cron.daily/00logwatch:
sendmail: bad mail input format: from root (uid 0) (envelope-from root@<redacted>)
run-parts: /etc/cron.daily/00logwatch exited with return code 141

logwatch uses "sendmail -t", and I can reproduce the error from the command line.
Sending an email using "sendmail -t" (when sendmail is actually dma) with a 1060
byte line gets that error.

I realise dma is not intended to be a fully flexible mail system, but it would be useful
if it could handle routine system reports.

#983916#10
Date:
2021-03-10 10:29:42 UTC
From:
To:
Workround, for anyone else hitting this problem... sed can be used to do a
simple line wrap. I use:

sed 's/\(.\{800\}\)/&\n---/g'

which wraps lines at 800 bytes and adds '---' to the start of the next line.

In particular, for logwatch (which seems to be the only problem on my system)
I have created /etc/logwatch/conf/logwatch.conf containing:

mailer="tee /tmp/last-logwatch | sed 's/\(.\{800\}\)/&\n---/g' | sendmail -t"

It would still be nice if dma could handle the long lines itself, of course.

#983916#15
Date:
2022-05-21 04:19:54 UTC
From:
To:
FYI, there is a long discussion on this issue at

https://github.com/corecode/dma/issues/18

Much of it centers around RFC2822's "Each line of characters MUST be no
more than 998 characters" verbiage.