Bug 291310 - /usr/libexec/dma breaks messages formatted with cr+lf lines
Summary: /usr/libexec/dma breaks messages formatted with cr+lf lines
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-30 20:30 UTC by titus m
Modified: 2025-12-06 15:37 UTC (History)
1 user (show)

See Also:


Attachments
patch to fix the above (1.33 KB, text/plain)
2025-11-30 20:30 UTC, titus m
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description titus m 2025-11-30 20:30:06 UTC
Created attachment 265740 [details]
patch to fix the above

When piping a message thru dma -t and the message has cr+lf at the end of lines it will break when forwarding it to a smtp host
the reason is that dma will remove \n at the end of the line and append \r\n
however when the original message already has \r\n it will end with \r\r\n at the end of every line

more info at https://forums.freebsd.org/threads/sending-email-using-php-mail-function-fails-via-dma-8.100466/

sendmail (receiving smpt) will complain as follows
Nov 30 22:12:44 ns sm-mta[91531]: 5AUHLtwN039474: to=xxx@xxx.xx, delay=02:50:49, xdelay=00:00:00, mailer=esmtp, pri=1140782, relay=xxxx.xx.xx [xx.xx.x.xxx], dsn=4.0.0, reply=421 4.5.0 Bare carriage return (CR) not allowed, stat=Deferred: 421 4.5.0 Bare carriage return (CR) not allowed

proposed patch in the attachment
Comment 1 Wayne Sierke 2025-12-06 15:37:46 UTC
I was able to replicate this on a dragonflybsd install with its dma(8) configured to use a sendmail SMARTHOST on FreeBSD 14.3R

It produced the same error when attempting to send a simple message using php::mail() function.

So this patch could go to dragonfly as well.