Support for defaultMailOptions attribute
authorStephen Gran <steve@lobefin.net>
Sun, 15 Nov 2009 23:18:15 +0000 (23:18 +0000)
committerStephen Gran <steve@lobefin.net>
Sun, 15 Nov 2009 23:18:15 +0000 (23:18 +0000)
Signed-off-by: Stephen Gran <steve@lobefin.net>
debian/changelog
html/update.html
update.cgi

index 165b5a5..d483b6d 100644 (file)
@@ -1,3 +1,10 @@
+userdir-ldap-cgi (0.3.29) unstable; urgency=low
+
+  * Move html into the cgi
+  * Support for defaultMailOptions attribute
+
+ -- Stephen Gran <sgran@debian.org>  Sun, 15 Nov 2009 23:17:15 +0000
+
 userdir-ldap-cgi (0.3.28) unstable; urgency=low
 
   * Add myself to uploaders
index 9a1ef87..4334cb4 100644 (file)
     <b>Mail Content Inspection Action:</b></td><td>
     <?mailcontentselect>
   </td></tr>
+  <tr><td align="right">
+    <b>Default Mail Handling:</b><br>
+    <font size="-1">(If this option is set, several default anti-spam setings will
+    be applied to the mail handling for your account)</font>
+  </td><td>
+    <input name="maildefaultoptions" type="checkbox" value="TRUE"~mailgreylisting~>
+  </td></tr>
   <tr><td align="right">
     <b>Mail Disable Message:</b><br>
     <font size="-1">(Note: if this is set, ALL email to your account will be
index c4b84d5..c4ad736 100755 (executable)
@@ -108,6 +108,12 @@ if (!($query->param('doupdate'))) {
     $data{mailcallout} = "";
   }
 
+  if ($data{maildefaultoptions} eq "TRUE") {
+    $data{maildefaultoptions} = " checked";
+  } else {
+    $data{maildefaultoptions} = "";
+  }
+
   $data{mailcontentinspectionaction} ||= 'reject';
   
   $data{email} = CGI::escapeHTML(join(", ", @{$entry->{emailforward}}));
@@ -263,7 +269,7 @@ if (!($query->param('doupdate'))) {
   my ($lat, $long);
   ($lat, $long) = &Util::CheckLatLong($query->param('latitude'), 
                                       $query->param('longitude'));
-  my ($greylisting, $callout, $mailcontentinspection);
+  my ($greylisting, $callout, $mailcontentinspection, $defaultoptions);
 
   $greylisting = $query->param('mailgreylisting');
   if (!$greylisting or $greylisting ne "TRUE") {
@@ -280,6 +286,11 @@ if (!($query->param('doupdate'))) {
      $mailcontentinspection = "reject";
   }
 
+  $defaultoptions = $query->param('maildefaultoptions');
+  if (!$defaultoptions or $defaultoptions ne "TRUE") {
+     $defaultoptions = "FALSE";
+  }
+
   my $newsudo;
   my $newsudo_hosts;
   if ($query->param('newsudopass') && $query->param('newsudopassvrfy')) {
@@ -347,6 +358,7 @@ if (!($query->param('doupdate'))) {
   &Util::LDAPUpdate($ldap, $editdn, 'mailCallout', $callout);
   &Util::LDAPUpdate($ldap, $editdn, 'mailContentInspectionAction', $mailcontentinspection);
   &Util::LDAPUpdate($ldap, $editdn, 'mailGreylisting', $greylisting);
+  &Util::LDAPUpdate($ldap, $editdn, 'mailDefaultOptions', $defaultoptions);
   &Util::LDAPUpdate($ldap, $editdn, 'sudoPassword', \@keepsudo);
 
   # when we are done, reload the page with the updated details.