changeset 694:c45ab714d68e

To: header for email-sender contains all recipients
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 19 May 2020 11:49:11 +0900
parents 5f3e94a9b7b3
children 5cf0ba49aeab
files s4-funcs.sh
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/s4-funcs.sh	Tue May 19 11:45:02 2020 +0900
+++ b/s4-funcs.sh	Tue May 19 11:49:11 2020 +0900
@@ -2702,14 +2702,19 @@
 	)
       fi
       rcpts="`email4groupbyuid "$grp" $usel` $fromad$supprcpt"
-      rcpts=`echo $rcpts|tr ' ' '\n'|sort|uniq`
+      rcpts=`echo $rcpts|tr ' ' '\n'|sort|uniq|tr '\n' ' '`
       subj="${subj:-$gecos さんからのメッセージ}"
       REPLYTO=$replyto
       MAIL_FROM=$mail_from
       export REPLYTO SMAIL_TO MAIL_FROM
       err "GrpActionSend: user=[$user], MAIL_FROM=[$mail_from], rcpts=[$rcpts], REPLYTO=[$replyto}"
       for r in $rcpts; do
-	SMAIL_TO="$r $user $fromad"
+	if [ x"$user" = x"$r" -o x"$fromad" = x"$r" ]; then
+	  SMAIL_TO=$rcpts	# Show all rcpts to sender oneself
+	else
+	  # Show sender and rcpts address for guest
+	  SMAIL_TO=`echo $r $user $fromad|tr ' ' '\n'|sort -u|tr '\n' ' '`
+	fi
 	if [ -n "$afiles" ];then
 	  ./sendmultipart.sh -t "$r" -s "$subj" -f "$mail_from" $afiles
 	else

yatex.org