And better documented that dcc doesn't work with sendmail/pipe.
BUG FIXES
---------
+- Fixed bcc to work with sendmail/pipe, and better documented that dcc
+ doesn't work with it [Bug 55700].
- An -attendee switch has been added to mhical(1), for use when more than one
(or zero) attendees match a user's mailbox.
- Fixed inc(1) and %(me) function escape to not obey Local-Mailbox profile
.PP
If a \*(lqBcc:\*(rq field is encountered, its addresses will be used for
delivery, and the \*(lqBcc:\*(rq field will be removed from the message
-sent to sighted recipients. The blind recipients will receive an entirely
-new message with a minimal set of headers. Included in the body of the
-message will be a copy of the message sent to the sighted recipients.
+sent to sighted recipients. The blind recipients will receive an entirely
+new message with a minimal set of headers. The body of this new message
+will contain a copy of the message sent to the sighted recipients, either
+marked up with the indicator text "Blind-Carbon-Copy" or encapsulated
+as a MIME digest.
+.PP
If
.B \-filter
.I filterfile
.B post
will use the MIME rules for encapsulation.
.PP
+If a \*(lqDcc:\*(rq field is encountered and the
+.B sendmail/pipe
+mail transport method is not in use, its addresses will be used for
+delivery, and the \*(lqDcc:\*(rq field will be removed from the message. The
+blind recipients will receive exactly the same message as the sighted
+recipients. *WARNING* Recipients listed in the \*(lqDcc:\*(rq field receive no
+explicit indication that they have received a \*(lqblind copy\*(rq.
+This can cause blind recipients to
+inadvertently reply to all of the sighted recipients of the
+original message, revealing that they received a blind copy.
+On the other hand, since a normal reply to a message sent
+via a \*(lqBcc:\*(rq field
+will generate a reply only to the sender of the original message,
+it takes extra effort in most mailers to reply to the included
+message, and so would usually only be done deliberately, rather
+than by accident.
+.PP
+.B post
+rejects any message that contains a \*(lqDcc:\*(rq field if the
+.B sendmail/pipe
+mail transport method is used.
+.PP
The
.B \-alias
.I aliasfile
If a \*(lqBcc:\*(rq field is encountered, its addresses will be used for
delivery, and the \*(lqBcc:\*(rq field will be removed from the message
sent to sighted recipients. The blind recipients will receive an entirely
-new message with a minimal set of headers. Included in the body of the
-message will be a copy of the message sent to the sighted recipients.
+new message with a minimal set of headers. The body of this new message
+will contain a copy of the message sent to the sighted recipients, either
+marked up with the indicator text "Blind-Carbon-Copy" or encapsulated
+as a MIME digest.
.PP
If a \*(lqDcc:\*(rq field is encountered and the
.B sendmail/pipe
mail transport method is not in use, its addresses will be used for
delivery, and the \*(lqDcc:\*(rq field will be removed from the message. The
-blind recipients will receive the same message sent to the sighted
+blind recipients will receive exactly the same message as the sighted
recipients. *WARNING* Recipients listed in the \*(lqDcc:\*(rq field receive no
explicit indication that they have received a \*(lqblind copy\*(rq.
This can cause blind recipients to
it takes extra effort in most mailers to reply to the included
message, and so would usually only be done deliberately, rather
than by accident.
+.PP
+If the
+.B sendmail/pipe
+mail transport method is used, then messages containing
+a \*(lqDcc:\*(rq field are rejected.
+
.PP
If
.B \-filter
done
else
# sendmail/pipe
-
- #### This will delete any lines in the message body that start with Bcc:!
- sed -e '/^[Bb][Cc][Cc]:/d' | $deliver
+ $deliver
fi
EOF
# check invalid -mts selection
+start_test 'invalid -mts selection'
run_test "send -draft -mts invalid" \
"post: unsupported mts selection \"invalid\"
send: message not delivered to anyone"
test_sendmail ()
{
run_prog send -draft -mts "$1"
+ send_status=$?
shift
# fakesendmail drops the message and any cc's into this mbox.
- mbox="${MH_TEST_DIR}"/Mail/fakesendmail.mbox
- inc -silent -file "$mbox"
- rm -f "$mbox"
+ if [ $send_status -eq 0 ]; then
+ mbox="${MH_TEST_DIR}"/Mail/fakesendmail.mbox
+ inc -silent -file "$mbox"
+ rm -f "$mbox"
+ fi
n=1
for expected in "$@"; do
}
# check -mts sendmail/smtp
+start_test '-mts sendmail/smtp'
cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
From: Mr Nobody <nobody@example.com>
To: Somebody Else <somebody@example.com>
# check -mts sendmail/pipe
# Dots are not stuffed because sendmail/pipe causes sendmail to be
# invoked with -i.
+start_test '-mts sendmail/pipe'
cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
From: Mr Nobody <nobody@example.com>
To: Somebody Else <somebody@example.com>
test_sendmail sendmail/pipe "${testname}.expected"
-# check Bcc
+# check Bcc with sendmail/pipe
+start_test 'Bcc with sendmail/pipe'
cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
From: Mr Nobody <nobody@example.com>
To: Somebody Else <somebody@example.com>
From: Mr Nobody <nobody@example.com>
Date:
Subject: Test
+BCC: bcc@example.com
------- Blind-Carbon-Copy
test_sendmail sendmail/pipe "${testname}.expected1" "${testname}.expected2"
+# check Dcc with sendmail/pipe: it is unsupported
+start_test 'Dcc with sendmail/pipe'
+cat > "${MH_TEST_DIR}/Mail/draft" <<EOF
+From: nobody@example.com
+Dcc: dcc@example.com
+
+.
+EOF
+
+cat > "${testname}.expected1" <<EOF
+post: Dcc header is not supported with sendmail/pipe
+post: re-format message and try again
+send: message not delivered to anyone
+EOF
+
+! test_sendmail sendmail/pipe 2>"${testname}.actual1"
+check "${testname}.actual1" "${testname}.expected1"
+
rm -f ${MHMTSCONF}
+finish_test
exit ${failed:-0}
badmsg = true;
return;
}
+ if (hdr->flags & HDCC && sm_mts == MTS_SENDMAIL_PIPE)
+ {
+ inform("Dcc header is not supported with sendmail/pipe");
+ badmsg = true;
+ return;
+ }
msgflags |= (hdr->set & ~(MVIS | MINV));
if (hdr->flags & HSUB)
if (mp->m_mbox == NULL || ((flags & HTRY) && !insert (mp)))
return 0;
- if (sm_mts != MTS_SENDMAIL_PIPE &&
- ((flags & (HBCC | HDCC | HEFM)) || mp->m_ingrp))
+ if ((flags & (HBCC | HDCC | HEFM)) || mp->m_ingrp)
return 1;
if (!nameoutput) {
fprintf (out, "Message-ID: %s\n", message_id (tclock, 0));
if (subject)
fprintf (out, "Subject: %s", subject);
- fprintf (out, "BCC:\n");
+
+ /* for sendmail/pipe, insert all bcc recipients here so that the email can be routed based on the bcc: header */
+ if (sm_mts == MTS_SENDMAIL_PIPE)
+ {
+ char *allbcc = NULL;
+ struct mailname *lp;
+
+ for (lp = localaddrs.m_next; lp; lp = lp->m_next)
+ if (lp->m_bcc)
+ allbcc = allbcc? add(concat(", ", lp->m_mbox, NULL), allbcc)
+ : mh_xstrdup(lp->m_mbox);
+ for (lp = netaddrs.m_next; lp; lp = lp->m_next)
+ if (lp->m_bcc)
+ allbcc = allbcc? add(
+ concat(", ", lp->m_mbox, "@", lp->m_host, NULL),
+ allbcc)
+ : concat(lp->m_mbox, "@", lp->m_host, NULL);
+ if (allbcc)
+ {
+ fprintf (out, "BCC: %s\n",allbcc);
+ free(allbcc);
+ }
+ }
+ else
+ {
+ fprintf (out, "BCC:\n");
+ }
/*
* Use MIME encapsulation for Bcc messages