--- loncom/interface/lonmsgdisplay.pm 2020/11/11 22:04:25 1.181.2.7
+++ loncom/interface/lonmsgdisplay.pm 2023/09/15 22:32:46 1.200
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging display
#
-# $Id: lonmsgdisplay.pm,v 1.181.2.7 2020/11/11 22:04:25 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.200 2023/09/15 22:32:46 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -111,6 +111,7 @@ use Apache::loncommunicate;
use Apache::lonfeedback;
use Apache::lonrss();
use Apache::lonselstudent();
+use Apache::lonenc();
use lib '/home/httpd/lib/perl/';
use LONCAPA qw(:DEFAULT :match);
@@ -791,11 +792,11 @@ sub groupmail_header {
({text=>&mt('Group').": $description",
no_mt=>1,});
}
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"/adm/email?compose=group&group=".
- "$env{'form.group'}&$refarg",
- text=>"Send a Message in a Group",
- title=>"Compose Group Message"},);
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"/adm/email?compose=group&group=".
+ "$env{'form.group'}&$refarg",
+ text=>"Send a Message in a Group",
+ title=>"Compose Group Message"},);
if ($action eq 'sending') {
&Apache::lonhtmlcommon::add_breadcrumb
({text=>"Messages being sent.",
@@ -912,7 +913,7 @@ sub discrit {
}
sub sortedmessages {
- my ($blocked,$startblock,$endblock,$numblocked,$folder,$msgstatus) = @_;
+ my ($blocked,$startblock,$endblock,$by_ip,$numblocked,$folder,$msgstatus) = @_;
my $suffix=&Apache::lonmsg::foldersuffix($folder);
my @messages = &Apache::lonnet::getkeys('nohist_email'.$suffix);
#unpack the varibles and repack into temp for sorting
@@ -944,7 +945,8 @@ sub sortedmessages {
push(@temp1,$content{'recuser'},$content{'recdomain'});
}
# Check whether message was sent during blocking period.
- if ($sendtime >= $startblock && ($sendtime <= $endblock && $endblock > 0) ) {
+ if (($by_ip) ||
+ (($sendtime >= $startblock) && ($sendtime <= $endblock && $endblock > 0))) {
$$blocked{$msgid} = 'ON';
$$numblocked ++;
} else {
@@ -1071,7 +1073,9 @@ sub disfolder {
my %blocked = ();
my %setters = ();
my $numblocked = 0;
- my ($startblock,$endblock) = &Apache::loncommon::blockcheck(\%setters,'com');
+ my $clientip = &Apache::lonnet::get_requestor_ip($r);
+ my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) =
+ &Apache::loncommon::blockcheck(\%setters,'com',$clientip);
my %js_lt = &Apache::lonlocal::texthash(
sede => 'Select a destination folder to which the messages will be moved.',
nome => 'No messages have been selected to apply this action to.',
@@ -1115,7 +1119,7 @@ sub disfolder {
ENDDISHEADER
my $fsqs='&folder='.$folder;
- my @temp=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder,$msgstatus);
+ my @temp=&sortedmessages(\%blocked,$startblock,$endblock,$by_ip,\$numblocked,$folder,$msgstatus);
my $totalnumber=$#temp+1;
if ($totalnumber < 1) {
$r->print('
');
if ($numblocked > 0) {
- $r->print(&blocked_in_folder($numblocked,$startblock,$endblock,
+ $r->print(&blocked_in_folder($numblocked,$startblock,$endblock,$by_ip,$clientip,$blockdom,
\%setters));
}
return;
@@ -1318,20 +1322,26 @@ ENDDISHEADER
$r->print('');
if ($numblocked > 0) {
$r->print(&blocked_in_folder($numblocked,$startblock,$endblock,
- \%setters));
+ $by_ip,$clientip,$blockdom,\%setters));
}
}
sub blocked_in_folder {
- my ($numblocked,$startblock,$endblock,$setters) = @_;
- my $beginblock = &Apache::lonlocal::locallocaltime($startblock);
- my $finishblock = &Apache::lonlocal::locallocaltime($endblock);
- my $output = '
'.
+ my ($numblocked,$startblock,$endblock,$by_ip,$clientip,$blockdom,$setters) = @_;
+ my $output;
+ if ($by_ip) {
+ $output = '
'.
+ &mt('[quant,_1,message is, messages are] not viewable because display of LON-CAPA messages is blocked for your current IP address: [_2].',$numblocked,$clientip).' '.
+ &mt('Note: communication is being blocked for certain IP address(es).');
+ } else {
+ my $beginblock = &Apache::lonlocal::locallocaltime($startblock);
+ my $finishblock = &Apache::lonlocal::locallocaltime($endblock);
+ $output = '
'.
&mt('[quant,_1,message is, messages are] not viewable because display of LON-CAPA messages sent to you by other students between [_2] and [_3] is currently being blocked because of online exams.',$numblocked,$beginblock,$finishblock);
+ }
#$output .= &Apache::loncommon::build_block_table($startblock,$endblock,
# $setters);
-
- my ($blocked, $blocktext) = &Apache::loncommon::blocking_status("com");
+ my ($blocked, $blocktext) = &Apache::loncommon::blocking_status("com",$clientip);
$output .="
".$blocktext;
return $output;
@@ -1342,6 +1352,26 @@ sub blocked_in_folder {
sub compout {
my ($r,$forwarding,$replying,$broadcast,$replycrit,$folder,$dismode,
$multiforward)=@_;
+ my $clientip = &Apache::lonnet::get_requestor_ip($r);
+ my %setters;
+ my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) =
+ &Apache::loncommon::blockcheck(\%setters,'com',$clientip);
+ if ($by_ip) {
+ my $showdom = &Apache::lonnet::domain($blockdom);
+ if ($showdom eq '') {
+ $showdom = $blockdom;
+ }
+ $r->print(&Apache::loncommon::start_page('Messages'));
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('Send and display messages'));
+ $r->print('
'.
+ &mt('Sending of LON-CAPA messages is blocked for your current IP address: [_1].',$clientip).'
'.
+ '
'.
+ &mt('Note: communication is being blocked for certain IP address(es).').
+ '
'.
+ &mt('This restriction was set by an administrator in the [_1] LON-CAPA domain.',$showdom).
+ '
');
+ return;
+ }
my $suffix=&Apache::lonmsg::foldersuffix($folder);
my ($cdom,$cnum,$group,$refarg);
if (exists($env{'form.group'})) {
@@ -1421,7 +1451,7 @@ sub compout {
);
if (!$forwarding && !$multiforward) {
$attachrow = '
';
}
@@ -2106,14 +2136,16 @@ sub displaymessage {
my %setters = ();
my $numblocked = 0;
my $crstype = &Apache::loncommon::course_type();
+ my $clientip = &Apache::lonnet::get_requestor_ip($r);
# info to generate "next" and "previous" buttons and check if message is blocked
- my ($startblock,$endblock) = &Apache::loncommon::blockcheck(\%setters,'com');
- my @messages=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder,$msgstatus);
+ my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) =
+ &Apache::loncommon::blockcheck(\%setters,'com',$clientip);
+ my @messages=&sortedmessages(\%blocked,$startblock,$endblock,$by_ip,\$numblocked,$folder,$msgstatus);
if ( $blocked{$msgid} eq 'ON' ) {
&printheader($r,'/adm/email',&mt('Display a Message'));
#$r->print(&mt('You attempted to display a message that is currently blocked because you are enrolled in one or more courses for which there is an ongoing online exam.'));
- my($blocked, $blocktext) = &Apache::loncommon::blocking_status("com");
+ my($blocked, $blocktext) = &Apache::loncommon::blocking_status("com",$clientip);
$r->print(" ".$blocktext);
return;
}
@@ -2472,12 +2504,16 @@ sub displaymessage {
$showsymb,$env{'user.domain'},$env{'user.name'});
if ($symb) {
if ($encrypturl =~ /^yes$/i && !$env{'request.role.adv'}) {
- $showsymb = &Apache::lonenc::check_encrypt($symb);
+ unless ($showsymb =~ m{^/enc/}) {
+ $showsymb = &Apache::lonenc::encrypted($showsymb);
+ }
}
$symblink = '?symb='.$showsymb;
}
if ($encrypturl =~ /^yes$/i && !$env{'request.role.adv'}) {
- $showurl = $baseurl;
+ unless ($showurl =~ m{^/enc/}) {
+ $showurl = &Apache::lonenc::encrypted($showurl);
+ }
}
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Refers to'))
.''.$restitle.''
@@ -2671,12 +2707,20 @@ sub displayresource {
&& (&Apache::lonnet::allowed('vgr',$content{'courseid'}))) {
my $symb;
if (defined($content{'symb'})) {
- $symb = $content{'symb'};
- } else {
- $symb=&Apache::lonnet::symbread($content{'baseurl'});
+ $symb = &Apache::lonenc::check_decrypt($content{'symb'});
+ } elsif (defined($content{'baseurl'})) {
+ $symb =
+ &Apache::lonnet::symbread(&Apache::lonenc::check_decrypt($content{'baseurl'}));
}
# Could not get a symb, give up
unless ($symb) { return $content{'citation'}; }
+ if ($symb =~ /ext\.tool$/) {
+ return '
'.&mt('Current transactions for student (if applicable)').'
'.
+ &Apache::loncommon::get_previous_attempt($symb,
+ $content{'sendername'},
+ $content{'senderdomain'},
+ $content{'courseid'});
+ }
# Have a symb, can render
return '
'.&mt('Current attempts of student (if applicable)').'
'.
&Apache::loncommon::get_previous_attempt($symb,
@@ -2782,8 +2826,15 @@ sub sendoffmail {
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
$cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
}
- if ($env{'form.send'}) {
- if (!$env{'form.multiforward'}) {
+ my $clientip = &Apache::lonnet::get_requestor_ip($r);
+ my %setters;
+ my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) =
+ &Apache::loncommon::blockcheck(\%setters,'com',$clientip);
+ if ($by_ip) {
+ &printheader($r,'','Sending messages blocked from your location.');
+ return 'blocked';
+ } elsif ($env{'form.send'}) {
+ if (!$env{'form.multiforward'}) {
if ($group eq '') {
&printheader($r,'','Messages being sent.');
} else {
@@ -2813,6 +2864,8 @@ sub sendoffmail {
my $mode = $env{'form.sendmode'};
my (%toaddr,$tos,$cc,$bcc,$broadcast);
+ my (%willtrust,%trustchecked,%disallowed);
+ my $serverdefdom = &Apache::lonnet::default_login_domain();
if ($mode eq 'group') {
if (defined($env{'form.courserecips'})) {
@@ -2822,9 +2875,17 @@ sub sendoffmail {
foreach my $dest (@to) {
my ($user,$domain) = split(/:/, $dest);
if (($user ne '') && ($domain ne '')) {
- my $rec = $user.":".$domain;
- $toaddr{$rec} = '';
- $broadcast->{$rec} = '';
+ unless ($trustchecked{$domain}) {
+ $willtrust{$domain} = &Apache::lonnet::will_trust('msg',$serverdefdom,$domain);
+ $trustchecked{$domain} = 1;
+ }
+ if ($willtrust{$domain}) {
+ my $rec = $user.":".$domain;
+ $toaddr{$rec} = '';
+ $broadcast->{$rec} = '';
+ } else {
+ $disallowed{'to'}{$user.":".$domain} = 1;
+ }
}
}
}
@@ -2835,22 +2896,47 @@ sub sendoffmail {
if ($txt) {
$rec =~ s/^\s+//;
$rec =~ s/\s+$//;
- $toaddr{$rec}.=$txt."\n";
- $broadcast->{$rec} = '';
+ my ($recuname,$recudom) = split(/:/,$rec);
+ unless ($trustchecked{$recudom}) {
+ $willtrust{$recudom} = &Apache::lonnet::will_trust('msg',$serverdefdom,$recudom);
+ $trustchecked{$recudom} = 1;
+ }
+ if ($willtrust{$recudom}) {
+ $toaddr{$rec}.=$txt."\n";
+ $broadcast->{$rec} = '';
+ } else {
+ $disallowed{'to'}{$rec} = 1;
+ }
}
}
} else {
if (($env{'form.recuname'} ne '') && ($env{'form.recdomain'} ne '')) {
- $toaddr{$env{'form.recuname'}.':'.$env{'form.recdomain'}}='';
- $tos->{$env{'form.recuname'}.':'.$env{'form.recdomain'}}='';
+ unless ($trustchecked{$env{'form.recdomain'}}) {
+ $willtrust{$env{'form.recdomain'}} = &Apache::lonnet::will_trust('msg',$serverdefdom,$env{'form.recdomain'});
+ $trustchecked{$env{'form.recdomain'}} = 1;
+ }
+ if ($willtrust{$env{'form.recdomain'}}) {
+ $toaddr{$env{'form.recuname'}.':'.$env{'form.recdomain'}}='';
+ $tos->{$env{'form.recuname'}.':'.$env{'form.recdomain'}}='';
+ } else {
+ $disallowed{'to'}{$env{'form.recuname'}.':'.$env{'form.recdomain'}};
+ }
}
}
if ($env{'form.additionalrec_to'}) {
foreach my $rec (split(/\s*,\s*/,$env{'form.additionalrec_to'})) {
my ($auname,$audom)=split(/:/,$rec);
if (($auname ne "") && ($audom ne "")) {
- $toaddr{$auname.':'.$audom}='';
- $tos->{$auname.':'.$audom}='';
+ unless ($trustchecked{$audom}) {
+ $willtrust{$audom} = &Apache::lonnet::will_trust('msg',$serverdefdom,$audom);
+ $trustchecked{$audom} = 1;
+ }
+ if ($willtrust{$audom}) {
+ $toaddr{$auname.':'.$audom}='';
+ $tos->{$auname.':'.$audom}='';
+ } else {
+ $disallowed{'to'}{$auname.':'.$audom};
+ }
}
}
}
@@ -2860,8 +2946,16 @@ sub sendoffmail {
foreach my $rec (@toreplies) {
my ($auname,$audom)=split(/:/,$rec);
if (($auname ne "") && ($audom ne "")) {
- $toaddr{$auname.':'.$audom}='';
- $tos->{$auname.':'.$audom}='';
+ unless ($trustchecked{$audom}) {
+ $willtrust{$audom} = &Apache::lonnet::will_trust('msg',$serverdefdom,$audom);
+ $trustchecked{$audom} = 1;
+ }
+ if ($willtrust{$audom}) {
+ $toaddr{$auname.':'.$audom}='';
+ $tos->{$auname.':'.$audom}='';
+ } else {
+ $disallowed{'to'}{$auname.':'.$audom};
+ }
}
}
}
@@ -2869,9 +2963,17 @@ sub sendoffmail {
foreach my $rec (split(/\s*,\s*/,$env{'form.additionalrec_cc'})) {
my ($auname,$audom)=split(/:/,$rec);
if (($auname ne "") && ($audom ne "")) {
- $toaddr{$auname.':'.$audom}='';
if (!defined($tos->{$auname.':'.$audom})) {
- $cc->{$auname.':'.$audom}='';
+ unless ($trustchecked{$audom}) {
+ $willtrust{$audom} = &Apache::lonnet::will_trust('msg',$serverdefdom,$audom);
+ $trustchecked{$audom} = 1;
+ }
+ if ($willtrust{$audom}) {
+ $toaddr{$auname.':'.$audom}='';
+ $cc->{$auname.':'.$audom}='';
+ } else {
+ $disallowed{'cc'}{$auname.':'.$audom};
+ }
}
}
}
@@ -2882,9 +2984,17 @@ sub sendoffmail {
foreach my $rec (@ccreplies) {
my ($auname,$audom)=split(/:/,$rec);
if (($auname ne "") && ($audom ne "")) {
- $toaddr{$auname.':'.$audom}='';
if (!defined($tos->{$auname.':'.$audom})) {
- $cc->{$auname.':'.$audom}='';
+ unless ($trustchecked{$audom}) {
+ $willtrust{$audom} = &Apache::lonnet::will_trust('msg',$serverdefdom,$audom);
+ $trustchecked{$audom} = 1;
+ }
+ if ($willtrust{$audom}) {
+ $toaddr{$auname.':'.$audom}='';
+ $cc->{$auname.':'.$audom}='';
+ } else {
+ $disallowed{'cc'}{$auname.':'.$audom} = 1;
+ }
}
}
}
@@ -2895,9 +3005,17 @@ sub sendoffmail {
foreach my $rec (@groupreplies) {
my ($auname,$audom)=split(/:/,$rec);
if (($auname ne "") && ($audom ne "")) {
- $toaddr{$auname.':'.$audom}='';
if (!defined($tos->{$auname.':'.$audom})) {
- $broadcast->{$auname.':'.$audom}='';
+ unless ($trustchecked{$audom}) {
+ $willtrust{$audom} = &Apache::lonnet::will_trust('msg',$serverdefdom,$audom);
+ $trustchecked{$audom} = 1;
+ }
+ if ($willtrust{$audom}) {
+ $toaddr{$auname.':'.$audom}='';
+ $broadcast->{$auname.':'.$audom}='';
+ } else {
+ $disallowed{'to'}{$auname.':'.$audom} = 1;
+ }
}
}
}
@@ -2906,10 +3024,18 @@ sub sendoffmail {
foreach my $rec (split(/\s*,\s*/,$env{'form.additionalrec_bcc'})) {
my ($auname,$audom)=split(/:/,$rec);
if (($auname ne "") && ($audom ne "")) {
- $toaddr{$auname.':'.$audom}='';
- if ((!defined($tos->{$auname.':'.$audom})) &&
+ if ((!defined($tos->{$auname.':'.$audom})) &&
(!defined($cc->{$auname.':'.$audom}))) {
- $bcc->{$auname.':'.$audom}='';
+ unless ($trustchecked{$audom}) {
+ $willtrust{$audom} = &Apache::lonnet::will_trust('msg',$serverdefdom,$audom);
+ $trustchecked{$audom} = 1;
+ }
+ if ($willtrust{$audom}) {
+ $toaddr{$auname.':'.$audom}='';
+ $bcc->{$auname.':'.$audom}='';
+ } else {
+ $disallowed{'bcc'}{$auname.':'.$audom} = 1;
+ }
}
}
}
@@ -2929,42 +3055,42 @@ sub sendoffmail {
} else {
$savemsg=&Apache::lonfeedback::clear_out_html($env{'form.message'});
}
- my %reciphash = (
- to => $tos,
- cc => $cc,
- bcc => $bcc,
- );
- if ($mode eq 'group') {
- if ($group eq '') {
- $reciphash{'course_broadcast'} = $broadcast;
- } else {
- if ($env{'form.groupmail'} eq 'cc') {
- $reciphash{'group_cc_broadcast'} = $broadcast;
+ my ($recipid, @recusers, @recudoms, %permresults);
+ if (keys(%toaddr) > 0) {
+ my %reciphash = (
+ to => $tos,
+ cc => $cc,
+ bcc => $bcc,
+ );
+ if ($mode eq 'group') {
+ if ($group eq '') {
+ $reciphash{'course_broadcast'} = $broadcast;
} else {
- $reciphash{'group_bcc_broadcast'} = $broadcast;
+ if ($env{'form.groupmail'} eq 'cc') {
+ $reciphash{'group_cc_broadcast'} = $broadcast;
+ } else {
+ $reciphash{'group_bcc_broadcast'} = $broadcast;
+ }
}
}
- }
- my ($recipid,$recipstatus) =
- &Apache::lonmsg::store_recipients($msgsubj,$env{'user.name'},
- $env{'user.domain'},\%reciphash);
- if ($recipstatus ne 'ok') {
- &Apache::lonnet::logthis('Failed to store To, Bcc and Cc recipients for '.$env{'user.name'}.':'.$env{'user.domain'});
- }
- if ($env{'form.attachment'}) {
- if (length($env{'form.attachment'}) <= 1048576) {
- $attachmenturl=&Apache::lonnet::userfileupload('attachment',undef,'feedback/'.$now);
- } else {
- $r->print('
'.&mt('Attachment not included - exceeded permitted length').'
');
- }
- } elsif ($env{'form.multiforward'}) {
- if ($env{'form.attachmenturl'} ne '') {
- $attachmenturl = $env{'form.attachmenturl'};
+ ($recipid,my $recipstatus) =
+ &Apache::lonmsg::store_recipients($msgsubj,$env{'user.name'},
+ $env{'user.domain'},\%reciphash);
+ if ($recipstatus ne 'ok') {
+ &Apache::lonnet::logthis('Failed to store To, Bcc and Cc recipients for '.$env{'user.name'}.':'.$env{'user.domain'});
+ }
+ if ($env{'form.attachment'}) {
+ if (length($env{'form.attachment'}) <= 1048576) {
+ $attachmenturl=&Apache::lonnet::userfileupload('attachment',undef,'feedback/'.$now);
+ } else {
+ $r->print('
'.&mt('Attachment not included - exceeded permitted length').'
');
+ }
+ } elsif ($env{'form.multiforward'}) {
+ if ($env{'form.attachmenturl'} ne '') {
+ $attachmenturl = $env{'form.attachmenturl'};
+ }
}
}
- my @recusers;
- my @recudoms;
- my %permresults;
foreach my $address (sort(keys(%toaddr))) {
my ($recuname,$recdomain)=split(/\:/,$address);
my $msgtxt = $savemsg;
@@ -3102,6 +3228,23 @@ sub sendoffmail {
$r->print($message);
}
}
+ if (keys(%disallowed)) {
+ if ((ref($disallowed{'to'}) eq 'HASH') && (keys(%{$disallowed{'to'}}) > 0)) {
+ $r->print(&mt("The following recipients were excluded because the user's domain does not accept messages from server's domain:").'
'.
+ join("
\n",sort(keys(%{$disallowed{'to'}}))).
+ '
');
+ }
+ if (ref($disallowed{'cc'}) eq 'HASH') {
+ $r->print(&mt("The following CCs were excluded because the user's domain does not accept messages from server's domain:").'
'.
+ join("
\n",sort(keys(%{$disallowed{'cc'}}))).
+ '
');
+ }
+ if (ref($disallowed{'bcc'}) eq 'HASH') {
+ $r->print(&mt("The following BCCs were excluded because the user's domain does not accept messages from server's domain:").'
'.
+ join("
\n",sort(keys(%{$disallowed{'bcc'}}))).
+ '
');
+ }
+ }
} else {
&printheader($r,'','Messages cancelled.');
return 'cancelled';
@@ -3127,9 +3270,24 @@ sub handler {
'sendreply','compose','sendmail','critical','recname','recdom',
'recordftf','sortedby','folder','startdis','interdis',
'showcommentbaseurl','dismode','group','subject','text','ref',
- 'msgstatus']);
+ 'msgstatus','btoken']);
$sqs='&sortedby='.$env{'form.sortedby'};
+# ----------- Check if access was from balancer to server with existing session
+
+ if ($env{'form.btoken'}) {
+ my %info = &Apache::lonnet::tmpget($env{'form.btoken'});
+ &Apache::lonnet::tmpdel($env{'form.btoken'});
+ delete($env{'form.btoken'});
+ unless ($env{'form.display'}) {
+ if (($info{'display'}) && ($info{'mailrecip'})) {
+ if (&unescape($info{'mailrecip'}) eq $env{'user.name'}.':'.$env{'user.domain'}) {
+ $env{'form.display'} = &unescape($info{'display'});
+ }
+ }
+ }
+ }
+
# ------------------------------------------------------ They checked for email
&Apache::lonnet::put('email_status',{'recnewemail'=>0});
@@ -3384,8 +3542,12 @@ sub handler {
my $count = keys(%forwardfail);
my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Could not forward [quant,_1,message].',$count),1);
foreach my $key (keys(%forwardfail)) {
- $message .= ' '.&mt('Could not deliver forwarded message.').' '.
- &mt('The recipient addresses may need to be corrected').' ('.$forwardfail{$key}.')';
+ $message .= ' '.&mt('Could not deliver forwarded message.').' ';
+ if ($forwardfail{$key} eq 'blocked') {
+ $message .= &mt('Sending messages is blocked from your IP address');
+ } else {
+ $message .= &mt('The recipient addresses may need to be corrected').' ('.$forwardfail{$key}.')';
+ }
}
$message = &Apache::loncommon::confirmwrapper($message);
$r->print($message);