--- loncom/interface/lonerrorhandler.pm	2009/02/12 21:15:47	1.23
+++ loncom/interface/lonerrorhandler.pm	2013/08/12 16:51:58	1.24
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Internal Server Error Handler
 #
-# $Id: lonerrorhandler.pm,v 1.23 2009/02/12 21:15:47 schafran Exp $
+# $Id: lonerrorhandler.pm,v 1.24 2013/08/12 16:51:58 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -83,8 +83,18 @@ $env{'form.guesses'}
 $lt{'env'}:
 $env{'form.environment'}
 ENDMESSAGE
-        my $sysmail = $r->dir_config('lonSysEMail');
         my $defdom = $r->dir_config('lonDefDomain');
+        my $sysmail;
+        my $notify = 1;
+        my %domconfig = &Apache::lonnet::get_dom('configuration',['contacts']);
+        if (ref($domconfig{'contacts'}) eq 'HASH') {
+            if ($domconfig{'contacts'}{'reporterrors'} == 0) {
+                $notify = 0;
+            }
+        }
+        if ($notify) {
+            $sysmail = 'errorrecord@loncapa.org';
+        }
         my $origmail = $r->dir_config('lonAdmEMail');
         my $recipients = &Apache::loncommon::build_recipient_list($sysmail,
                                              'errormail',$defdom,$origmail);