Mailinglist Archive: yast-commit (953 mails)

< Previous Next >
[yast-commit] r49765 - in /trunk/mail/src: MailServerLDAP.pm YaPI/MailServer.pm mail-server_dialogs.ycp
  • From: varkoly@xxxxxxxxxxxxxxxx
  • Date: Wed, 06 Aug 2008 12:26:55 -0000
  • Message-id: <20080806122655.D877B27409@xxxxxxxxxxxxxxxx>
Author: varkoly
Date: Wed Aug 6 14:26:55 2008
New Revision: 49765

URL: http://svn.opensuse.org/viewcvs/yast?rev=49765&view=rev
Log:
including changes from rhafer considering the yast2-ldap-server
make the count of amavisd processes variable

Modified:
trunk/mail/src/MailServerLDAP.pm
trunk/mail/src/YaPI/MailServer.pm
trunk/mail/src/mail-server_dialogs.ycp

Modified: trunk/mail/src/MailServerLDAP.pm
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/mail/src/MailServerLDAP.pm?rev=49765&r1=49764&r2=49765&view=diff
==============================================================================
--- trunk/mail/src/MailServerLDAP.pm (original)
+++ trunk/mail/src/MailServerLDAP.pm Wed Aug 6 14:26:55 2008
@@ -39,58 +39,29 @@
{
my $ldapMap = YaPI::LdapServer->ReadDatabaseList();
# Now we configure the LDAP-Server to be able store the mail server
configuration
- my $schemas = YaPI::LdapServer->ReadSchemaIncludeList();
+ my $schemas = YaPI::LdapServer->ReadSchemaList();
my $SCHEMA = join "",@{$schemas};
- if( $SCHEMA !~ /dnszone.schema/ )
+
+ if( $SCHEMA !~ /dnszone/ )
{
- push @{$schemas},'/etc/openldap/schema/dnszone.schema';
+ YaPI::LdapServer->AddSchema('/etc/openldap/schema/dnszone.schema');
}
- if( $SCHEMA !~ /suse-mailserver.schema/ )
+ if( $SCHEMA !~ /suse-mailserver/ )
{
- push @{$schemas},'/etc/openldap/schema/suse-mailserver.schema';
- YaPI::LdapServer->WriteSchemaIncludeList($schemas);
+
YaPI::LdapServer->AddSchema('/etc/openldap/schema/suse-mailserver.schema');
}
- my $indices = YaPI::LdapServer->ReadIndex($ldapMap->[0]);
- my $SuSEMailClient = 0;
- my $SuSEMailDomainMasquerading = 0;
- my $suseTLSPerSitePeer= 0;
- foreach my $index (@{$indices})
- {
- if( $index->{attr} eq "SuSEMailClient,SUSEMailAcceptAddress,zoneName")
- {
- $SuSEMailClient = 1;
- }
- if( $index->{attr} eq
"SuSEMailDomainMasquerading,relativeDomainName,suseMailDomainType")
- {
- $SuSEMailDomainMasquerading = 1;
+
+ my $indices = YaPI::LdapServer->ReadIndex( $ldapMap->[2]->{'suffix'} );
+ my @attrs = ( "SuSEMailClient", "SUSEMailAcceptAddress", "zoneName",
+ "SuSEMailDomainMasquerading", "relativeDomainName",
"suseMailDomainType",
+ "suseTLSPerSitePeer", "SuSEMailTransportDestination" );
+ foreach my $attr (@attrs){
+ my $curindex;
+ if (! defined $indices->{$attr} ) {
+ $curindex->{'name'} = $attr;
+ $curindex->{'eq'} = 1;
+ YaPI::LdapServer->EditIndex($ldapMap->[2]->{'suffix'}, $curindex );
}
- if( $index->{attr} eq
"suseTLSPerSitePeer,SuSEMailTransportDestination")
- {
- $suseTLSPerSitePeer = 1;
- }
- }
- if(!$SuSEMailClient)
- {
- YaPI::LdapServer->AddIndex($ldapMap->[0],
- { "attr" =>
"SuSEMailClient,SUSEMailAcceptAddress,zoneName",
- "param" => "eq" }
- );
- }
- if(!$SuSEMailDomainMasquerading)
- {
- YaPI::LdapServer->AddIndex($ldapMap->[0],
- { "attr" =>
"SuSEMailDomainMasquerading,relativeDomainName,suseMailDomainType",
- "param" => "eq" }
- );
- }
- if(!$suseTLSPerSitePeer)
- {
- YaPI::LdapServer->AddIndex($ldapMap->[0],
- { "attr" =>
"suseTLSPerSitePeer,SuSEMailTransportDestination",
- "param" => "eq" }
- );
}
- YaPI::LdapServer->RecreateIndex($ldapMap->[0]);
- Service->Restart("ldap");
- return YaPI::LdapServer->ReadDatabase($ldapMap->[0]);
+ return YaPI::LdapServer->ReadDatabase($ldapMap->[2]->{'suffix'});
}

Modified: trunk/mail/src/YaPI/MailServer.pm
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/mail/src/YaPI/MailServer.pm?rev=49765&r1=49764&r2=49765&view=diff
==============================================================================
--- trunk/mail/src/YaPI/MailServer.pm (original)
+++ trunk/mail/src/YaPI/MailServer.pm Wed Aug 6 14:26:55 2008
@@ -56,9 +56,10 @@
my $proposal_valid = 0;

##
- # Some global variables for cyrus-imapd
-my $imapadm = "cyrus";
-my $imaphost = "localhost";
+ # Some global variables
+my $imapadm = "cyrus";
+my $imaphost = "localhost";
+my $aconf = "/etc/amavisd.conf";

##
# Write only, used during autoinstallation.
@@ -1048,6 +1049,7 @@
'RBLList' => [],
'AccessList' => [],
'VirusScanning' => 1,
+ 'VSCount' => 10
'SpamLearning' => 1
);

@@ -1094,6 +1096,7 @@
'RBLList' => [],
'AccessList' => [],
'VirusScanning' =>
YaST::YCP::Boolean(0),
+ 'VSCount' => 10,
'SpamLearning' =>
YaST::YCP::Boolean(0)
);

@@ -1169,8 +1172,28 @@
if( $smtp->[0]->{'options'}->{'content_filter'} eq
'smtp:[localhost]:10024' && $vscan )
{
$MailPrevention{'VirusScanning'} = YaST::YCP::Boolean(1);
+ if( ! open(IN,$aconf) )
+ {
+ return "Error: $!";
+ }
+ my @ACONF = <IN>;
+ close(IN);
+ my $ismax = 0;
+ foreach ( @ACONF )
+ {
+ s/\s+//g;
+ if ( /^\$max_servers=(\d+)/ )
+ {
+ $MailPrevention{'VSCount'} = $1;
+ }
+ }
+ if( !$ismax )
+ {
+ $MailPrevention{'VSCount'} = 2;
+ }
}
}
+
# make IMAP connection
my $imap = new Net::IMAP($imaphost, Debug => 0);
if( $imap )
@@ -1335,7 +1358,7 @@
SCR->Read('.mail.postfix.mastercf');
if( $MailPrevention->{'VirusScanning'} )
{
- my $err = activate_virus_scanner();
+ my $err = activate_virus_scanner($MailPrevention->{'VSCount'});
if( $err ne "" )
{
return $self->SetError(summary => "activating virus scanner failed",
@@ -1348,7 +1371,7 @@
SCR->Execute('.mail.postfix.mastercf.modifyService',
{ 'service' => 'smtp',
'command' => 'smtpd',
- 'maxproc' => '5',
+ 'maxproc' => $MailPrevention->{'VSCount'},
'options' => { 'content_filter' => 'smtp:[127.0.0.1]:10024' }
} );
}
else
@@ -1356,7 +1379,7 @@
SCR->Execute('.mail.postfix.mastercf.addService',
{ 'service' => 'smtp',
'command' => 'smtpd',
- 'maxproc' => '5',
+ 'maxproc' => $MailPrevention->{'VSCount'},
'options' => { 'content_filter' => 'smtp:[127.0.0.1]:10024' }
} );
}
my $smtps = SCR->Execute('.mail.postfix.mastercf.findService',
@@ -2805,9 +2828,9 @@


sub activate_virus_scanner {
+ my $VSCount = shift || 5;
use File::Copy;

- my $aconf = "/etc/amavisd.conf";
my $cconf = "/etc/clamd.conf";
my $clamsock = '/var/lib/clamav/clamd-socket';
my @CONF = ();
@@ -2823,7 +2846,7 @@
my $ismax = 0;
foreach my $l ( @ACONF )
{
- $ismax = 1 if $l =~ s/^\$max_servers = \d+/\$max_servers = 5/;
+ $ismax = 1 if $l =~ s/^\$max_servers = \d+/\$max_servers = $VSCount/;
$l =~ s/(.*)/# $1/ if $l =~ /bypass_virus_checks_acl.*=.*qw\( \./;
if( $isclam || $l =~ /Clam Antivirus-clamd/ )
{
@@ -2839,7 +2862,7 @@
}
if( !$ismax )
{
- push @CONF, '$max_servers = 5;'
+ push @CONF, '$max_servers = '.$VSCount;
}
if( ! open(OUT,">$aconf.new") )
{

Modified: trunk/mail/src/mail-server_dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/mail/src/mail-server_dialogs.ycp?rev=49765&r1=49764&r2=49765&view=diff
==============================================================================
--- trunk/mail/src/mail-server_dialogs.ycp (original)
+++ trunk/mail/src/mail-server_dialogs.ycp Wed Aug 6 14:26:55 2008
@@ -660,7 +660,8 @@
list<string> RBLList = (list<string>)
MailServer::MailPrevention["RBLList"]:[];
list<map<string,string> > AccessList = (list<map<string,string> >)
MailServer::MailPrevention["AccessList"]:[];
boolean VirusScanning =
(boolean)MailServer::MailPrevention["VirusScanning"]:false;
- boolean SpamLearning =
(boolean)MailServer::MailPrevention["SpamLearning "]:false;
+ boolean SpamLearning =
(boolean)MailServer::MailPrevention["SpamLearning"]:false;
+ integer VSCount = (integer)MailServer::MailPrevention["VSCount
"]:10;
boolean BasicProtectionOff = false;
boolean BasicProtectionMedium = false;
boolean BasicProtectionHard = true;
@@ -692,7 +693,11 @@
SpamL = `Left(`CheckBox (`id(`SpamLearning), `opt(`notify),
_("Configure Spam Learning Extension"), SpamLearning));
}
term content = `VBox (
- `Left(`CheckBox (`id(`VirusScanning), `opt(`notify), _("Start Virus
Scanner AMAVIS"), VirusScanning)),
+ `HBox(
+ `Left(`CheckBox (`id(`VirusScanning), `opt(`notify),
_("Start Virus Scanner AMAVIS"), VirusScanning)),
+ `HSpacing (1),
+ `Left(`CheckBox (`id(`VSCount), `opt(`notify), _("Count of
Virsus Scanner Process"), VSCount))
+ ),
`VSpacing (1),
SpamL,
`VSpacing (1),
@@ -1416,6 +1421,7 @@
if( ret == `SpamLearning ) {
MailServer::MailPrevention["Changed"] = true;
UI::ChangeWidget(`id(`VirusScanning), `Value, true);
+ UI::ChangeWidget(`id(`VSCount), `Value, 10);
continue;
}
if(ret == `RBLAdd) {
@@ -1452,9 +1458,10 @@
}
});
}
- MailServer::MailPrevention["BasicProtection"] =
(string)UI::QueryWidget(`id(`BasicProtection), `CurrentButton);
- MailServer::MailPrevention["VirusScanning"] = (boolean)
UI::QueryWidget(`id(`VirusScanning), `Value);
- MailServer::MailPrevention["SpamLearnig"] = (boolean)
UI::QueryWidget(`id(`SpamLearning), `Value);
+ MailServer::MailPrevention["BasicProtection"] = (string)
UI::QueryWidget(`id(`BasicProtection), `CurrentButton);
+ MailServer::MailPrevention["VirusScanning"] =
(boolean)UI::QueryWidget(`id(`VirusScanning), `Value);
+ MailServer::MailPrevention["SpamLearning"] =
(boolean)UI::QueryWidget(`id(`SpamLearning), `Value);
+ MailServer::MailPrevention["VSCount"] =
(boolean)UI::QueryWidget(`id(`VSCount), `Value);
title = _("Mail Server SPAM Basic Prevention Configuration");
content = MailPreventionDialog(CID,CIDRBL);
helptext = HELPS["MailPrevention"]:"Bla Bla Bla";

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages