Bug 273221 - DMA does not correctly honor the addresees with the same invocation as sendmail
Summary: DMA does not correctly honor the addresees with the same invocation as sendmail
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-19 00:22 UTC by Glen Barber
Modified: 2023-08-19 00:24 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.