s4

changeset 630:8874225971ff

Test of setting Reply-to header
author HIROSE Yuuji <yuuji@gentei.org>
date Fri, 24 Apr 2020 20:59:23 +0900
parents b1ddb2559d77
children 574529409c72
files examples/common/msg/mail-header.m4 s4-funcs.sh
diffstat 2 files changed, 14 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/examples/common/msg/mail-header.m4	Thu Apr 23 08:14:09 2020 +0900
     1.2 +++ b/examples/common/msg/mail-header.m4	Fri Apr 24 20:59:23 2020 +0900
     1.3 @@ -3,4 +3,5 @@
     1.4  From: _FROM_
     1.5  MIME-Version: 1.0
     1.6  Content-type: text/plain; charset=iso-2022-jp
     1.7 +_REPLYTO_
     1.8  
     2.1 --- a/s4-funcs.sh	Thu Apr 23 08:14:09 2020 +0900
     2.2 +++ b/s4-funcs.sh	Fri Apr 24 20:59:23 2020 +0900
     2.3 @@ -1146,8 +1146,10 @@
     2.4    from=`echo "${MAIL_FROM:-$admin}"|nkf -jM|tr -d '\n'`
     2.5    rcpt=`echo $1|tr ' ' '\n'|sort -u|tr '\n' ' '` # uniq and strip newlines
     2.6    subj=`echo $2|nkf -jM|tr -d '\n'`
     2.7 -  (_m4 -D_RCPT_="${SMAIL_TO:-$rcpt}" -D_SUBJ_="\`$subj'" -D_FROM_="$from" $msgdir/mail-header.m4
     2.8 -   cat $3 | nkf -jd ) | sendmail -f $admin $rcpt
     2.9 +  sender=${SENDER:-$admin}
    2.10 +  replyto=${REPLYTO:+"Reply-to: $REPLYTO$LF"}
    2.11 +  (_m4 -D_RCPT_="${SMAIL_TO:-$rcpt}" -D_REPLYTO_="$replyto" -D_SUBJ_="\`$subj'" -D_FROM_="$from" $msgdir/mail-header.m4
    2.12 +   cat $3 | nkf -jd ) | sendmail -f $sender $rcpt
    2.13  }
    2.14  smail_queue_flush() {
    2.15    # $1=timelimit
    2.16 @@ -2617,9 +2619,12 @@
    2.17  	myuid=`query "SELECT rowid FROM user WHERE name='$user';"`
    2.18  	fromad=`email4groupbyuid "$grp" "$myuid" | sed -e 1q -e 's/[ ,].*//'`
    2.19  	mail_from="$safegc <$fromad>"
    2.20 +	replyto=$fromad
    2.21        else
    2.22  	mail_from="$noreply_from"
    2.23        fi
    2.24 +      ## SENDER=$noreply \ # Should not SENDER be set to $noreply??
    2.25 +      REPLYTO=$replyto \
    2.26        MAIL_FROM=$mail_from \
    2.27  	       smail "`email4groupbyuid "$grp" $usel` $user" \
    2.28  	       "$gecos さんからのメッセージ" <<EOF
    2.29 @@ -3013,8 +3018,13 @@
    2.30    fi
    2.31    grp=`getgroupbyid $rowid`
    2.32    members=`collectemail $grp`
    2.33 +  myuid=`query "SELECT rowid FROM user WHERE name='$user';"`
    2.34 +  mailfrom=`email4groupbyuid "$grp" "$myuid" | sed -e 1q -e 's/[ ,].*//'`
    2.35    # smail rcpt subj (file)
    2.36 -  SMAIL_TO="`echo "$grp" | nkf -jM | tr -d '\n'` readers <$admin>" \
    2.37 +  MAIL_FROM=$mailfrom \
    2.38 +  SENDER=$noreply \
    2.39 +  REPLYTO=$mailfrom \
    2.40 +  SMAIL_TO="`echo "$grp" | nkf -jM | tr -d '\n'` readers <$noreply>" \
    2.41  	  smail "$members" "グループ $grp 宛メッセージ(from `gecos $user`)" <<EOF
    2.42  $urlbase?grp+$rowid
    2.43  グループ $grp に所属する