Index: trunk/cgi-bin/main.cgi
===================================================================
--- trunk/cgi-bin/main.cgi	(revision 415)
+++ trunk/cgi-bin/main.cgi	(revision 416)
@@ -890,8 +890,7 @@
 		qq(&ipdb=1&ip=$msg">Add this IP to RADIUS user table</a></div>)
 	: "</div>");
-      # Notify tech@example.com
-#      mailNotify('tech@example.com',"ADDED: $disp_alloctypes{$webvar{alloctype}} allocation",
-#	"$disp_alloctypes{$webvar{alloctype}} $msg allocated to customer $webvar{custid}\n".
-#	"Description: $webvar{desc}\n\nAllocated by: $authuser\n");
+      mailNotify($ip_dbh, "a$webvar{alloctype}", "ADDED: $disp_alloctypes{$webvar{alloctype}} allocation",
+	"$disp_alloctypes{$webvar{alloctype}} $msg allocated to customer $webvar{custid}\n".
+	"Description: $webvar{desc}\n\nAllocated by: $authuser\n");
     } else {
       my $netblock = new NetAddr::IP $webvar{fullcidr};
@@ -905,7 +904,7 @@
 		qq(">Add this netblock to RADIUS user table</a></div>)
 	: "</div>");
-#      mailNotify('nocmgr@example.com',"ADDED: $disp_alloctypes{$webvar{alloctype}} allocation",
-#	"$disp_alloctypes{$webvar{alloctype}} $webvar{fullcidr} allocated to customer $webvar{custid}\n".
-#	"Description: $webvar{desc}\n\nAllocated by: $authuser\n");
+      mailNotify($ip_dbh, "a$webvar{alloctype}", "ADDED: $disp_alloctypes{$webvar{alloctype}} allocation",
+	"$disp_alloctypes{$webvar{alloctype}} $webvar{fullcidr} allocated to customer $webvar{custid}\n".
+	"Description: $webvar{desc}\n\nAllocated by: $authuser\n");
     }
     syslog "notice", "$authuser allocated '$webvar{fullcidr}' to '$webvar{custid}' as ".
@@ -1224,6 +1223,8 @@
   # If we get here, the operation succeeded.
   syslog "notice", "$authuser updated $webvar{block}";
-#mailNotify('nocmgr@example.com',"SWIPed: $disp_alloctypes{$webvar{alloctype}} $webvar{block}",
-#	"$webvar{block} had SWIP status changed to \"Yes\" by $authuser");
+##fixme:  need to wedge something in to allow "update:field" notifications
+## hmm.  how to tell what changed?  O_o
+mailNotify($ip_dbh, 'ua', "SWIPed: $disp_alloctypes{$webvar{alloctype}} $webvar{block}",
+	"$webvar{block} had SWIP status changed to \"Yes\" by $authuser") if $webvar{swip} eq 'on';
   open (HTML, "../updated.html")
 	or croak "Could not open updated.html :$!";
@@ -1401,11 +1402,7 @@
     syslog "notice", "$authuser deallocated '$webvar{alloctype}'-type netblock $webvar{block}".
 	" $custid, $city, desc='$description'";
-    # Notify tech@ when a block/IP is deallocated
-#    mailNotify('tech@example.com',"REMOVED: $disp_alloctypes{$webvar{alloctype}} $webvar{block}",
-#	"$disp_alloctypes{$webvar{alloctype}} $webvar{block} deallocated by $authuser\n".
-#	"CustID: $custid\nCity: $city\nDescription: $description\n");
-#    mailNotify('nocmgr@example.com',"REMOVED: $disp_alloctypes{$webvar{alloctype}} $webvar{block}",
-#	"$disp_alloctypes{$webvar{alloctype}} $webvar{block} deallocated by $authuser\n".
-#	"CustID: $custid\nCity: $city\nDescription: $description\n");
+    mailNotify($ip_dbh, 'da', "REMOVED: $disp_alloctypes{$webvar{alloctype}} $webvar{block}",
+	"$disp_alloctypes{$webvar{alloctype}} $webvar{block} deallocated by $authuser\n".
+	"CustID: $custid\nCity: $city\nDescription: $description\n");
   } else {
     if ($webvar{alloctype} =~ /^.i$/) {
