Author: varkoly
Date: Mon Oct 29 17:49:55 2007
New Revision: 41625
URL: http://svn.opensuse.org/viewcvs/yast?rev=41625&view=rev
Log:
#335524 Advanced Mail Transfer Agent cannot access LDAP server
Modified:
trunk/mail/src/MailServer.ycp
trunk/mail/src/mail-advanced.ycp
trunk/mail/src/mail-server_dialogs.ycp
trunk/mail/src/mail-server_ldap-setup.ycp
trunk/mail/src/mail.ycp
Modified: trunk/mail/src/MailServer.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/mail/src/MailServer.ycp?rev=41625&r1=41624&r2=41625&view=diff
==============================================================================
--- trunk/mail/src/MailServer.ycp (original)
+++ trunk/mail/src/MailServer.ycp Mon Oct 29 17:49:55 2007
@@ -216,7 +216,7 @@
if(! is_main_domain )
{
y2milestone("no main mail domain");
- LDAPSettings["bind_pw"] = MailServer::AdminPassword;
+ LDAPSettings["bind_pw"] = AdminPassword;
SCR::Execute (.ldap.bind,LDAPSettings);
integer counter = 0;
map lastDomain = $[];
Modified: trunk/mail/src/mail-advanced.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/mail/src/mail-advanced.ycp?rev=41625&r1=41624&r2=41625&view=diff
==============================================================================
--- trunk/mail/src/mail-advanced.ycp (original)
+++ trunk/mail/src/mail-advanced.ycp Mon Oct 29 17:49:55 2007
@@ -36,13 +36,14 @@
* @param options map of options from command line
* @return boolean true on success
*/
-boolean SetupMailServer(map options)
+boolean SetupMailServer()
{
any ret = SetupSequence();
return true;
}
-map cmdline_description = $[
+map cmdline_description =
+$[
"id" : "mail-server",
/* Command line help text for the mail-server module */
"help" : _("Configuration of mail server"),
@@ -85,6 +86,10 @@
{
ret = MailServerAutoSequence();
}
+else if(setup)
+{
+ ret = SetupSequence();
+}
else
{
ret = CommandLine::Run(cmdline_description);
Modified: trunk/mail/src/mail-server_dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/mail/src/mail-server_dialogs.ycp?rev=41625&r1=41624&r2=41625&view=diff
==============================================================================
--- trunk/mail/src/mail-server_dialogs.ycp (original)
+++ trunk/mail/src/mail-server_dialogs.ycp Mon Oct 29 17:49:55 2007
@@ -32,6 +32,7 @@
*/
define any CheckLDAPDialog ()
{
+ y2milestone("--Start CheckLDAPDialog ---");
boolean ca_mgm = false;
boolean conf_ldap_server = false;
boolean setup_ldap_server = false;
@@ -44,6 +45,7 @@
{ //No LDAP-Client configuration
setup_ldap_server = true;
ca_mgm = true;
+ conf_ldap_server = true;
comment = _("Your computer is not configured as LDAP-client.") + "<br>" +
_("We suggest to setup a local LDAP-server for the mail server.") + "<br>" +
_("To secure your system we suggest to create certificates for the LDAP and Mail Server.") + "<br>";
@@ -52,14 +54,14 @@
{ //The computer is configured as LDAP-Client
if( LDAPSettings["ldap_server"]:"" == "127.0.0.1" )
{ // The LDAP-Server is local
- comment = _("Your computer is configured as LDAP-client and the LDAP-Server is local.") + "<br>" +
+ comment = _("Your computer is configured as LDAP-client and the LDAP-Server is local.") + "<br>" +
_("We suggest to adapt the LDAP-server configuration for the mail server.") + "<br>" +
_("For this reason you have to know the password of the LDAP-administrator account:") + "<br>" +
"<B>" + LDAPSettings["bind_dn"]:"" + ".</B><BR>";
}
else
{ // The LDAP-Server is not local
- comment = _("Your computer is configured as LDAP-client and the LDAP-Server is not local.") + "<br>" +
+ comment = _("Your computer is configured as LDAP-client and the LDAP-Server is not local.") + "<br>" +
_("We suggest to configure the LDAP-server for the mail server.") + "<br>" +
_("For this reason you have to know the password of the LDAP-administrator account:") + "<br>" +
"<B>" + LDAPSettings["bind_dn"]:"" + ".</B><BR>" +
@@ -108,12 +110,30 @@
Ldap::LDAPInit();
LDAPSettings = (map ) Ldap::Export();
}
- string adminpw = Ldap::LDAPAskAndBind(false);
- if( adminpw != nil )
+ MailServer::AdminPassword = Ldap::LDAPAskAndBind(false);
+ if( MailServer::AdminPassword != nil )
{
- YaPI::MailServer::ResetMailServer(adminpw,LDAPSettings);
+ block<boolean> abort = ``{
+ if (UI::PollInput () == `abort &&
+ // popup text
+ Popup::YesNo (_("Really abort the writing process?")))
+ return true;
+ return false;
+ };
+
+ //tell Ldap module to create the default objects:
+ LDAPSettings [ "create_ldap" ] = true;
+ Ldap::Import(LDAPSettings);
+ //write the settings:
+ Ldap::Write(abort);
+ //create default mail-server configuration
+ YaPI::MailServer::ResetMailServer(MailServer::AdminPassword,LDAPSettings);
+ return `next;
+ }
+ else
+ {
+ return `abort;
}
- return `ok;
}
/**
@@ -124,6 +144,7 @@
define any AuthorizingDialog ()
{
+ y2milestone("--Start AuthorizingDialog ---");
Ldap::Read();
map LDAPSettings = Ldap::Export();
if(LDAPSettings["bind_dn"]:"" == "" )
@@ -140,6 +161,7 @@
}
Ldap::Read();
}
+ Ldap::LDAPInit();
integer size1 = (integer)SCR::Read(.target.size, "/etc/ssl/servercerts/servercert.pem");
integer size2 = (integer)SCR::Read(.target.size, "/etc/ssl/servercerts/serverkey.pem");
@@ -152,11 +174,16 @@
MailServer::CertExist = true;
}
- return Ldap::LDAPAskAndBind(false);
-
+ MailServer::AdminPassword = Ldap::LDAPAskAndBind(false);
+ if( MailServer::AdminPassword == nil )
+ {
+ return `abort;
+ }
+ return `next;
}
-list<map> GenerateTree(list<map> Tree, string parent, list<list> input) {
+list<map> GenerateTree(list<map> Tree, string parent, list<list> input)
+{
foreach(list i, input, ``{
string title = i[0]:"";
@@ -170,7 +197,9 @@
return Tree;
}
-term GlobalSettingsDialog() {
+term GlobalSettingsDialog()
+{
+ y2milestone("--Start GlobalSettingsDialog ---");
boolean limit = ((string)MailServer::GlobalSettings["MaximumMailSize"]:"0" != "0");
boolean is_DNS = ((string)MailServer::GlobalSettings["SendingMail","Type"]:"" == "DNS");
boolean is_NONE = ((string)MailServer::GlobalSettings["SendingMail","Type"]:"" == "NONE");
@@ -302,7 +331,8 @@
return content;
}
-list<term> MakeSelectedList(list<string> items, string value ) {
+list<term> MakeSelectedList(list<string> items, string value )
+{
list<term> SelectedList = [];
foreach(string i, items, ``{
if( i == value ) {
@@ -314,7 +344,9 @@
return SelectedList;
}
-void ShowMailTransport(string CID, string ACTION) {
+void ShowMailTransport(string CID, string ACTION)
+{
+ y2milestone("--Start ShowMailTransport ---");
list