Bug 273221

Summary: DMA does not correctly honor the addresees with the same invocation as sendmail
Product: Base System Reporter: Glen Barber <gjb>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Only Me    
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

Description Glen Barber freebsd_committer freebsd_triage 2023-08-19 00:22:14 UTC
In main as DMA had become the default MTA, there is a difference in its handling of command-line arguments.

Consider a situation where /usr/sbin/sendmail is a link to /usr/sbin/mailwrapper, and /etc/mail/mailer.conf is set to use /usr/libexec/dma given the following simple script:

#!/bin/sh
body="Hello world"
subject="Hello"
emailsentfrom="$USER"
emailgoesto="$USER1 $USER2"

printf "From: ${emailsentfrom}\nTo: ${emaiilgoesto}\n \
  Subject: "${subject}"\n\n${body}\n\n" \
  | /usr/sbin/sendmail -oi -f ${emailsentfrom} ${emailgoesto}

With sendmail, "${emailgoesto}" would properly expand to whomever $USER1 and $USER2 are, comma-separated, which is expected.

With DMA, "${emailgoesto}" is not comma-separated, and are verbatim the expanded values "$USER1 $USER2", which is not expected.
Comment 1 Glen Barber freebsd_committer freebsd_triage 2023-08-19 00:24:03 UTC
(In reply to Glen Barber from comment #0)
Correction to the printf part of the script:

printf "From: ${emailsentfrom}\nTo: ${emaiilgoesto}\n \
  Subject: ${subject}\n\n${body}\n\n" \
  | /usr/sbin/sendmail -oi -f ${emailsentfrom} ${emailgoesto}

There is only one pair of double-quotes.