[LON-CAPA-cvs] cvs: loncom /interface lonmsg.pm
raeburn
raeburn at source.lon-capa.org
Wed Feb 7 20:46:23 EST 2024
raeburn Thu Feb 8 01:46:23 2024 EDT
Modified files:
/loncom/interface lonmsg.pm
Log:
- For users with srm priv, unless replies are explicitly disallowed, set
a Reply-to email address, where available, in case the "From" address is
reserved for use by TLS authentication.
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.249 loncom/interface/lonmsg.pm:1.250
--- loncom/interface/lonmsg.pm:1.249 Sun Sep 18 22:33:45 2022
+++ loncom/interface/lonmsg.pm Thu Feb 8 01:46:23 2024
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging
#
-# $Id: lonmsg.pm,v 1.249 2022/09/18 22:33:45 raeburn Exp $
+# $Id: lonmsg.pm,v 1.250 2024/02/08 01:46:23 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -454,14 +454,17 @@
$replytoaddress = 'do-not-reply@'.$hostname;
} else {
my %senderemails;
- my $have_sender;
+ my ($have_sender.$setreplyto);
if ($env{'form.reply_to_addr'}) {
my ($replytoname,$replytodom) = split(/:/,$env{'form.reply_to_addr'});
- if (!($replytoname eq $env{'user.name'} && $replytodom eq $env{'user.domain'})) {
+ if (($replytoname eq $env{'user.name'} && $replytodom eq $env{'user.domain'})) {
+ $setreplyto = 1;
+ } else {
if (&Apache::lonnet::homeserver($replytoname,$replytodom) ne 'no_host') {
%senderemails =
&Apache::loncommon::getemails($replytoname,$replytodom);
$have_sender = 1;
+ $setreplyto = 1;
}
}
}
@@ -471,7 +474,12 @@
foreach my $type ('permanentemail','critnotification','notification') {
if ($senderemails{$type}) {
($senderaddress) = split(/,/,$senderemails{$type});
- last if ($senderaddress);
+ if ($senderaddress) {
+ if ($setreplyto) {
+ $replytoaddress = $senderaddress;
+ }
+ last;
+ }
}
}
}
More information about the LON-CAPA-cvs
mailing list