Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120835160
kolab-ucs-join-script.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
10 KB
Referenced Files
None
Subscribers
None
kolab-ucs-join-script.sh
View Options
#!/bin/bash
VERSION
=
3
. /usr/share/univention-join/joinscripthelper.lib
. /usr/share/univention-lib/all.sh
joinscript_init
function
addUserAttribute
{
name
=
"
$1
"
shift
udm settings/extended_attribute create
\
--ignore_exists
\
--position
"cn=custom attributes,cn=univention,
$ldap_base
"
\
--set
tabName
=
"Mail"
\
--append
translationTabName
=
'"de_CH" "Mail"'
\
--append
translationTabName
=
'"de_DE" "Mail"'
\
--set
name
=
"
$name
"
\
--set
CLIName
=
"
$name
"
\
--set
mayChange
=
1
\
"
$@
"
}
eval
"
$(
univention-config-registry shell
)
"
# Delete old service references
echo
-n
"Removing legacy Kolab 2 service reference from LDAP ... "
ucs_removeServiceFromLocalhost
"kolab2"
"
$@
"
# Register Kolab service
echo
-n
"Creating Kolab service in LDAP ... "
ucs_addServiceToLocalhost
"kolab"
"
$@
"
# Register LDAP schema extensions
ucs_registerLDAPExtension
"
$@
"
\
--schema /usr/share/doc/kolab-schema/kolab3.schema
ucs_registerLDAPExtension
"
$@
"
\
--schema /usr/share/doc/kolab-schema/univention-kolab3-wrapper.schema
ucs_registerLDAPExtension
"
$@
"
\
--acl /usr/share/doc/kolab-schema/univention-kolab3.acl
# If there is no default kolab home server ...
kolab_home
=
$(
udm settings/default list
"
$@
"
--filter
=
'cn=default'
2
>/dev/null
\
|
grep -i defaultUniventionMailHomeServer
\
|
sed -r
's/\s*defaultUniventionMailHomeServer: //'
)
if
[
"
${
kolab_home
}
"
=
"None"
-o -z
"
${
kolab_home
}
"
]
;
then
echo
-n
"Setting default groupware server ... "
udm settings/default modify
"
$@
"
\
--dn
cn
=
default,cn
=
univention,
${
ldap_base
}
\
--set
defaultUniventionMailHomeServer
=
"
${
hostname
}
.
${
domainname
}
"
fi
# Create Groupware account template
echo
-n
"Creating Groupware Account template ... "
udm settings/usertemplate create
"
$@
"
--ignore_exists
\
--position
cn
=
templates,cn
=
univention,
${
ldap_base
}
\
--set
name
=
"
${
domainname
}
Groupware Account"
\
--set
univentionMailHomeServer
=
"
${
hostname
}
.
${
domainname
}
"
\
--set
mailPrimaryAddress
=
"<username>@
${
domainname
}
"
\
--set e-mail
=
"<username>@
${
domainname
}
"
\
--set
unixhome
=
"/home/<username>"
mail
=
$(
udm settings/usertemplate list
"
$@
"
--filter
=
"cn=
$domainname
Groupware Account"
|
grep
' e-mail:'
|
sed
's/[^:]*: //;s/^None$//'
)
shell
=
$(
udm settings/usertemplate list
"
$@
"
--filter
=
"cn=
$domainname
Groupware Account"
|
grep
' shell:'
|
sed
's/[^:]*: //;s/^None$//'
)
unixhome
=
$(
udm settings/usertemplate list
"
$@
"
--filter
=
"cn=
$domainname
Groupware Account"
|
grep
' unixhome:'
|
sed
's/[^:]*: //;s/^\/home\/$//'
)
if
[
-z
"
$mail
"
-o -z
"
$shell
"
-o -z
"
$unixhome
"
]
;
then
udm settings/usertemplate modify --dn
"cn=
$domainname
Groupware Account,cn=templates,cn=univention,
$ldap_base
"
--set
univentionMailHomeServer
=
"
$hostname
.
$domainname
"
--set
mailPrimaryAddress
=
"<username>@
$domainname
"
--set e-mail
=
"<username>@
$domainname
"
--set
shell
=
"/bin/bash"
--set
unixhome
=
"/home/<username>"
fi
# remove old '$hostname.$domainname Groupware Account' template (#1606)
udm settings/usertemplate remove --dn
"
$hostname
.
$domainname
Groupware Account,cn=templates,cn=univention,
${
ldap_base
}
"
||
true
# Create mail domain
echo
-n
"Creating mail domain
${
domainname
}
... "
udm mail/domain create
\
$@
--ignore_exists
\
--set
name
=
${
domainname
}
\
--position
cn
=
domain,cn
=
mail,
${
ldap_base
}
\
>/dev/null
2
>
&
1
&&
echo
"OK"
||
echo
"FAIL"
# Create cyrus-admin user
echo
-n
"Creating Cyrus Admin user ... "
udm users/user create
"
$@
"
--ignore_exists
\
--set
password
=
$(
cat /etc/cyrus.secret
)
\
--set
"username=cyrus-admin"
\
--set
"firstname=Cyrus"
\
--set
"lastname=Administrator"
\
--position
"cn=users,
${
ldap_base
}
"
### Admin Settings
# Forwards
addUserAttribute KolabForwardAddress
\
"
$@
"
\
--set
objectClass
=
"kolabInetOrgPerson"
\
--append
module
=
"users/user"
\
--append
module
=
"users/self"
\
--set
groupPosition
=
1
\
--set
groupName
=
"Forwards"
\
--append
translationGroupName
=
'"de_CH" "Weiterleitung"'
\
--append
translationGroupName
=
'"de_DE" "Weiterleitung"'
\
--set
tabPosition
=
1
\
--set
shortDescription
=
"Forwarding address"
\
--append
translationShortDescription
=
'"de_CH" "E-Mail-Adresse für Mailweiterleitung"'
\
--append
translationShortDescription
=
'"de_DE" "E-Mail-Adresse für Mailweiterleitung"'
\
--set
syntax
=
emailAddress
\
--set
multivalue
=
1
\
--set
ldapMapping
=
kolabForwardAddress
addUserAttribute KolabForwardActive
\
"
$@
"
\
--set
objectClass
=
"univentionKolabInetOrgPerson"
\
--append
module
=
"users/user"
\
--append
module
=
"users/self"
\
--set
groupPosition
=
1
\
--set
groupName
=
"Forwards"
\
--append
translationGroupName
=
'"de_CH" "Weiterleitung"'
\
--append
translationGroupName
=
'"de_DE" "Weiterleitung"'
\
--set
tabPosition
=
3
\
--set
shortDescription
=
"Forward mail"
\
--append
translationShortDescription
=
'"de_CH" "Mails weiterleiten"'
\
--append
translationShortDescription
=
'"de_DE" "Mails weiterleiten"'
\
--set
syntax
=
TrueFalseUp
\
--set
multivalue
=
0
\
--set
ldapMapping
=
univentionKolabForwardActive
addUserAttribute KolabForwardKeepCopy
\
"
$@
"
\
--set
objectClass
=
"kolabInetOrgPerson"
\
--append
module
=
"users/user"
\
--append
module
=
"users/self"
\
--set
groupPosition
=
1
\
--set
groupName
=
"Forwards"
\
--append
translationGroupName
=
'"de_CH" "Weiterleitung"'
\
--append
translationGroupName
=
'"de_DE" "Weiterleitung"'
\
--set
tabPosition
=
5
\
--set
shortDescription
=
"Keep a copy of forwarded mail"
\
--append
translationShortDescription
=
'"de_CH" "Kopie erstellen bei Mailweiterleitung"'
\
--append
translationShortDescription
=
'"de_DE" "Kopie erstellen bei Mailweiterleitung"'
\
--set
syntax
=
TrueFalseUp
\
--set
multivalue
=
0
\
--set
ldapMapping
=
kolabForwardKeepCopy
addUserAttribute KolabForwardUCE
\
"
$@
"
\
--set
objectClass
=
"kolabInetOrgPerson"
\
--append
module
=
"users/user"
\
--append
module
=
"users/self"
\
--set
groupPosition
=
1
\
--set
groupName
=
"Forwards"
\
--append
translationGroupName
=
'"de_CH" "Weiterleitung"'
\
--append
translationGroupName
=
'"de_DE" "Weiterleitung"'
\
--set
tabPosition
=
6
\
--set
shortDescription
=
"Forward Spam"
\
--append
translationShortDescription
=
'"de_CH" "Spam weiterleiten"'
\
--append
translationShortDescription
=
'"de_DE" "Spam weiterleiten"'
\
--set
syntax
=
TrueFalseUp
\
--set
multivalue
=
0
\
--set
ldapMapping
=
kolabForwardUCE
# Vacation
addUserAttribute KolabVacationText
\
"
$@
"
\
--set
objectClass
=
"univentionKolabInetOrgPerson"
\
--append
module
=
"users/user"
\
--append
module
=
"users/self"
\
--set
groupPosition
=
2
\
--set
groupName
=
"Vacation"
\
--append
translationGroupName
=
'"de_CH" "Abwesenheit"'
\
--append
translationGroupName
=
'"de_DE" "Abwesenheit"'
\
--set
tabPosition
=
11
\
--set
shortDescription
=
"Text of out of office notice"
\
--append
translationShortDescription
=
'"de_CH" "Text der Abwesenheitsnotiz"'
\
--append
translationShortDescription
=
'"de_DE" "Text der Abwesenheitsnotiz"'
\
--set
syntax
=
TextArea
\
--set
multivalue
=
0
\
--set
ldapMapping
=
univentionKolabVacationText
addUserAttribute KolabVacationActive
\
"
$@
"
\
--set
objectClass
=
"univentionKolabInetOrgPerson"
\
--append
module
=
"users/user"
\
--append
module
=
"users/self"
\
--set
groupPosition
=
2
\
--set
groupName
=
"Vacation"
\
--append
translationGroupName
=
'"de_CH" "Abwesenheit"'
\
--append
translationGroupName
=
'"de_DE" "Abwesenheit"'
\
--set
tabPosition
=
12
\
--set
shortDescription
=
"Activate out of office notice"
\
--append
translationShortDescription
=
'"de_CH" "Abwesenheitsnotiz aktivieren"'
\
--append
translationShortDescription
=
'"de_DE" "Abwesenheitsnotiz aktivieren"'
\
--set
syntax
=
TrueFalseUp
\
--set
multivalue
=
0
\
--set
ldapMapping
=
univentionKolabVacationActive
addUserAttribute KolabVacationAddress
\
"
$@
"
\
--set
objectClass
=
"kolabInetOrgPerson"
\
--append
module
=
"users/user"
\
--append
module
=
"users/self"
\
--set
groupPosition
=
2
\
--set
groupName
=
"Vacation"
\
--append
translationGroupName
=
'"de_CH" "Abwesenheit"'
\
--append
translationGroupName
=
'"de_DE" "Abwesenheit"'
\
--set
tabPosition
=
13
\
--set
shortDescription
=
" E-mail adresses for vacation notice"
\
--append
translationShortDescription
=
'"de_CH" "E-Mail-Adressen für Abwesenheitsnotiz"'
\
--append
translationShortDescription
=
'"de_DE" "E-Mail-Adressen für Abwesenheitsnotiz"'
\
--set
multivalue
=
0
\
--set
syntax
=
emailAddress
\
--set
ldapMapping
=
kolabVacationAddress
addUserAttribute KolabVacationNoReactDomain
\
"
$@
"
\
--set
objectClass
=
"univentionKolabInetOrgPerson"
\
--append
module
=
"users/user"
\
--append
module
=
"users/self"
\
--set
groupPosition
=
2
\
--set
groupName
=
"Vacation"
\
--append
translationGroupName
=
'"de_CH" "Abwesenheit"'
\
--append
translationGroupName
=
'"de_DE" "Abwesenheit"'
\
--set
tabPosition
=
14
\
--set
syntax
=
string
\
--set
multivalue
=
1
\
--set
shortDescription
=
"Exclude mail domains from out of office notices"
\
--append
translationShortDescription
=
'"de_CH" "Domains von Abwesenheitsnotiz ausnehmen"'
\
--append
translationShortDescription
=
'"de_DE" "Domains von Abwesenheitsnotiz ausnehmen"'
\
--set
ldapMapping
=
univentionKolabVacationNoReactDomain
# Delivery
addUserAttribute KolabDeliveryToFolderName
\
"
$@
"
\
--set
objectClass
=
"univentionKolabInetOrgPerson"
\
--append
module
=
"users/user"
\
--append
module
=
"users/self"
\
--set
groupPosition
=
3
\
--set
groupName
=
"Delivery"
\
--append
translationGroupName
=
'"de_CH" "Zustellung"'
\
--append
translationGroupName
=
'"de_DE" "Zustellung"'
\
--set
tabPosition
=
21
\
--set
syntax
=
string
\
--set
multivalue
=
0
\
--set
shortDescription
=
"Folder for incoming mail"
\
--append
translationShortDescription
=
'"de_CH" "Ordner für eingehende Mails"'
\
--append
translationShortDescription
=
'"de_DE" "Ordner für eingehende Mails"'
\
--set
ldapMapping
=
univentionKolabDeliveryToFolderName
addUserAttribute KolabDeliveryToFolderActive
\
"
$@
"
\
--set
objectClass
=
"univentionKolabInetOrgPerson"
\
--append
module
=
"users/user"
\
--append
module
=
"users/self"
\
--set
groupPosition
=
3
\
--set
groupName
=
"Delivery"
\
--append
translationGroupName
=
'"de_CH" "Zustellung"'
\
--append
translationGroupName
=
'"de_DE" "Zustellung"'
\
--set
tabPosition
=
22
\
--set
syntax
=
TrueFalseUp
\
--set
multivalue
=
0
\
--set
shortDescription
=
"Move incoming mails into chosen folder"
\
--append
translationShortDescription
=
'"de_CH" "Eingehende Mails in einen ausgewählten Ordner verschieben"'
\
--append
translationShortDescription
=
'"de_DE" "Eingehende Mails in einen ausgewählten Ordner verschieben"'
\
--set
ldapMapping
=
univentionKolabDeliveryToFolderActive
# Allow Domain Users to modify self
udm groups/group modify
\
--dn
"cn=Domain Users,cn=groups,
$ldap_base
"
\
--policy-reference
"cn=default-udm-self,cn=UMC,cn=policies,
$ldap_base
"
joinscript_save_current_version
exit
0
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Fri, Apr 24, 1:14 PM (5 d, 5 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18842558
Default Alt Text
kolab-ucs-join-script.sh (10 KB)
Attached To
Mode
rKMETA kolab
Attached
Detach File
Event Timeline