[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Tue, 04 Oct 2005 16:26:18 -0000


raeburn		Tue Oct  4 12:26:18 2005 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  Added dcmaildump(). Used by interface/lonnotify.pm to retrieve record of broadcast e-mail sent to domain.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.657 loncom/lonnet/perl/lonnet.pm:1.658
--- loncom/lonnet/perl/lonnet.pm:1.657	Tue Sep 20 03:56:23 2005
+++ loncom/lonnet/perl/lonnet.pm	Tue Oct  4 12:26:15 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.657 2005/09/20 07:56:23 albertel Exp $
+# $Id: lonnet.pm,v 1.658 2005/10/04 16:26:15 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1811,7 +1811,27 @@
     return %returnhash;
 }
 
-#
+# ---------------------------------------------------------- DC e-mail
+sub dcmaildump {
+    my ($dom,$startdate,$enddate,$senders) = @_;
+    my %returnhash=(); 
+    foreach my $tryserver (keys %libserv) {
+        if ($hostdom{$tryserver} eq $dom) {
+            %{$returnhash{$tryserver}}=();
+            foreach (
+                split(/\&/,&reply('dcmaildump:'.$dom.':'.
+                   &escape($startdate).':'.&escape($enddate).':'.
+                   &escape($senders), ,$tryserver))) {
+                my($key,$value) = split(/\=/,$_);
+                if (($key) && ($value)) {
+                    $returnhash{$tryserver}{$key} = $value;
+                }
+            }
+        }
+    }
+    return %returnhash;
+}
+
 # ----------------------------------------------------------- Check out an item
 
 sub get_first_access {