--- loncom/interface/lonmsg.pm 2010/09/13 23:35:44 1.227 +++ loncom/interface/lonmsg.pm 2013/07/24 18:21:39 1.235 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging # -# $Id: lonmsg.pm,v 1.227 2010/09/13 23:35:44 raeburn Exp $ +# $Id: lonmsg.pm,v 1.235 2013/07/24 18:21:39 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -465,6 +465,7 @@ sub sendemail { if ($senderaddress) { $msg->add('From',$senderaddress); } + $msg->add('Content-type','text/plain; charset=UTF-8'); if (my $fh = $msg->open()) { print $fh $body; $fh->close; @@ -525,7 +526,10 @@ sub sendnotification { to access the full message.',$url); my %userenv = &Apache::lonnet::get('environment',['notifywithhtml'],$toudom,$touname); - my $subject = &mt_user($user_lh,"'New' $critical message from ").$sender; + my $subject = &mt_user($user_lh,"'New'$critical message from [_1]",$sender); + unless ($subj eq '') { + $subject = $subj; + } my ($blocked,$blocktext); if (!$crit) { @@ -577,7 +581,7 @@ sub make_htmlfree { sub mynewmail{ &newmail(); - return $env{'user.mailcheck.lastnewmassagetime'} > $env{'user.mailcheck.lastvisit'}; + return $env{'user.mailcheck.lastnewmessagetime'} > $env{'user.mailcheck.lastvisit'}; } @@ -585,7 +589,7 @@ sub newmail { if ((time-$env{'user.mailcheck.time'})>300) { my %what=&Apache::lonnet::get('email_status',['recnewemail']); &Apache::lonnet::appenv({'user.mailcheck.time'=>time}); - &Apache::lonnet::appenv({'user.mailcheck.lastnewmassagetime'=> $what{'recnewemail'}}); + &Apache::lonnet::appenv({'user.mailcheck.lastnewmessagetime'=> $what{'recnewemail'}}); if ($what{'recnewemail'}>0) { return 1; } } return 0; @@ -985,7 +989,9 @@ sub secapply { my $rec=shift; my $defaultflag=shift; $rec=~s/\s+//g; - $rec=~s/\@/\:/g; + unless ($rec =~ /\:/) { + $rec=~s/\@/\:/g; + } my ($adr,$sections_or_groups)=($rec=~/^([^\(]+)\(([^\)]+)\)/); if ($sections_or_groups) { foreach my $item (split(/\;/,$sections_or_groups)) {