changes for Univention install

This commit is contained in:
Ralf Becker 2014-11-07 13:16:30 +00:00
parent dd7daa8dad
commit b721ae1afc
3 changed files with 21 additions and 15 deletions

View File

@ -36,6 +36,7 @@ $config = array(
'backup' => '',
'admin_user' => 'sysop',
'admin_passwd'=> randomstring(),
'admin_email' => '',
'lang' => 'en', // languages for admin user and extra lang to install
'charset' => 'utf-8',
'start_db' => '/sbin/service mysqld',
@ -347,7 +348,7 @@ if (!file_exists($config['header']) || filesize($config['header']) < 200) // def
}
// create mailserver config (fmail requires at least minimal config given as default, otherwise fatal error)
$setup_mailserver = $setup_cli.' --config '.escapeshellarg($config['domain'].','.$config['config_user'].','.$config['config_passwd']);
foreach(array('account-auth','smtpserver','smtp','postfix','mailserver','imap','cyrus','sieve') as $name)
foreach(array('account-auth','smtpserver','smtp','postfix','mailserver','imap','cyrus','sieve','folder') as $name)
{
if (!empty($config[$name])) $setup_mailserver .= ' --'.$name.' '.escapeshellarg($config[$name]);
}
@ -355,7 +356,7 @@ if (!file_exists($config['header']) || filesize($config['header']) < 200) // def
// create first user
$setup_admin = $setup_cli.' --admin '.escapeshellarg($config['domain'].','.$config['config_user'].','.$config['config_passwd'].','.
$config['admin_user'].','.$config['admin_passwd'].',,,,'.$config['lang']);
$config['admin_user'].','.$config['admin_passwd'].',,,'.$config['admin_email'].','.$config['lang']);
run_cmd($setup_admin);
// check if webserver is started and start it (permanent) if not
@ -754,7 +755,8 @@ function set_univention_defaults()
{
// ldap settings, see http://docs.univention.de/developer-reference-3.2.html#join:secret
$config['ldap_suffix'] = $config['ldap_base'] = _ucr_get('ldap/base');
$config['ldap_host'] = 'tls://'._ucr_get('ldap/server/ip').':'._ucr_get('ldap/server/port');
// port is ldap allowing starttls, but regular php/ldap config does not allow own certificate!
$config['ldap_host'] = 'ldap://'._ucr_get('ldap/server/ip').':'._ucr_get('ldap/server/port');
$config['ldap_admin'] = $config['ldap_root'] = 'cn=admin,$suffix';
$config['ldap_admin_pw'] = $config['ldap_root_pw'] = _ucr_secret('ldap');
$config['ldap_context'] = 'cn=users,$base';
@ -777,15 +779,19 @@ function set_univention_defaults()
{
if (!is_array($domains)) $domains = explode("\n", $domains);
$domain = array_shift($domains);
$config['smtpserver'] = "$mailserver,465,,,yes,tls";
// set "use auth with session credentials",tls,"not user editable","further identities"
$config['smtpserver'] = "$mailserver,465,,,yes,tls,no,yes";
$config['smtp'] = ',emailadmin_smtp_univention';
$config['mailserver'] = "$mailserver,993,$domain,email,tls";
$config['imap'] = /*'cyrus,'._ucr_secret('cyrus')*/','.',emailadmin_imap_cyrus';
// set folders so mail creates them on first login, UCS does not automatic
$config['folder'] = 'INBOX/Sent,INBOX/Trash,INBOX/Drafts,INBOX/Templates,INBOX/Spam';
if (($sieve_port = _ucr_get('mail/cyrus/sieve/port')))
{
$config['sieve'] = "$mailserver,$sieve_port,starttls";
}
// set an email address for sysop user so mail works right away
$config['admin_email'] = '$admin_user@'.$domain;
}
}
}

View File

@ -183,8 +183,8 @@ class setup_cmd_config extends setup_cmd
array('name' => 'editforwardingaddress','allowed' => array('yes',null)),
'acc_smtp_type',
),
'--smtpserver' => array( //smtp server,[smtp port],[smtp user],[smtp password],[no|starttls|ssl|tls],[user editable],[further identities]
'acc_smtp_host','acc_smtp_port','acc_smtp_username','acc_smtp_passwd',
'--smtpserver' => array( //smtp server,[smtp port],[smtp user],[smtp password],[auth session user/pw],[no|starttls|ssl|tls],[user editable],[further identities]
'acc_smtp_host','acc_smtp_port','acc_smtp_username','acc_smtp_passwd','acc_smtp_auth_session',
array('name' => 'acc_smtp_ssl','allowed' => array(0,'no',1,'starttls',3,'ssl',2,'tls')),
'acc_user_editable','acc_further_identities',
),

View File

@ -182,7 +182,7 @@ function do_config($args)
/**
* Register all hooks
*
* @param array $args domain(default),[config user(admin)],password
* @param array $arg domain(default),[config user(admin)],password
*/
function do_hooks($arg)
{
@ -480,7 +480,7 @@ function do_usage($what='')
echo ' --files-dir, --backup-dir, --temp-dir '.lang('path to various directories: have to exist and be writeable by the webserver')."\n";
echo ' --webserver-url '.lang('eg. /egroupware or http://domain.com/egroupware, default: %1',str_replace('/setup/setup-cli.php','',$_SERVER['PHP_SELF']))."\n";
echo ' --mailserver '.lang('host,port(143),[domain],[{standard(default)|vmailmgr = add domain for mailserver login}]').',[starttls|ssl|tls]'."\n";
echo ' --smtpserver '.lang('host,[smtp port],[smtp user],[smtp password],[auth=no|yes|ann]').',[starttls|ssl|tls]'."\n";
echo ' --smtpserver '.lang('host,[smtp port],[smtp user],[smtp password],[auth session user/pw=yes|no],[starttls|ssl|tls],[account user editable=yes|no],[further identities=yes|no]')."\n";
echo ' --smtp '.lang('MTA (with LDAP): [yes(user edit forwarding)],emailadmin_smtp(|_sql|_ldap|_ads|_qmail|_mandriva|_dbmailuser|_suse)')."\n";
echo ' --imap '.lang('IMAP: Admin user,Password,emailadmin_imap(|_cyrus|_dovecot)')."\n";
echo ' --sieve '.lang('Sieve: Host[,Port(4190)]').',[starttls|ssl|tls]'."\n";