summaryrefslogtreecommitdiff
path: root/ucs-3.0/tests/16-create-john-no-mailserver.sh
blob: 146c0722db6bdfac60edde87d9c1c30204559c0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash

eval "$(ucr shell)"

if [ "${server_role}" != "domaincontroller_master" ]; then
    echo "SKIPPED - This system is not a master domain controller."
    exit 0
fi

imap_server=$(ldapsearch -x -H ldap://${ldap_server_name}:${ldap_server_port} -D "${ldap_hostdn}" -y /etc/machine.secret -LLL "(univentionService=IMAP)" cn | grep ^cn | awk '{print $2}' | head -n 1)

if [ -z "${imap_server}" ]; then
    echo "FAILED - No IMAP server found"
    exit 1
fi

univention-directory-manager users/user create \
    --set password=Welcome2KolabSystems \
    --set "username=doe" \
    --set "lastname=Doe" \
    --set "e-mail=doe@${domainname}" \
    --set "mailPrimaryAddress=doe@${domainname}" \
    --set "mailAlternativeAddress=ceo@${domainname}" \
    --position "cn=users,${ldap_base}"

ldapsearch -x -H ldap://${ldap_server_name}:${ldap_server_port} -b "${ldap_base}" -LLL -D "${ldap_hostdn}" -y /etc/machine.secret "(uid=doe)" entrydn univentionMailHomeServer