Commit f34c1eaa authored by daniel.pondruff's avatar daniel.pondruff
Browse files

first steps with dovecot-ee

parent 3f5ee199
......@@ -89,55 +89,72 @@ done
set -- "${POSITIONAL[@]}" # restore positional parameters
if [[ "${FEATURE_INSTALL}" = true ]]; then
if [[ -z "${DC_VERSION}" ]]; then
echo "Version not specified, set to latest"
DC_VERSION=2.3-latest
fi
if [[ -z "${DC_VERSION}" ]]; then
echo "Version not specified, set to latest"
DC_VERSION=2.3-latest
fi
if [[ true = "${INSTALL_DOVECOT_EE}" ]];then
if [[ true == "${ANY_DEB}" ]]; then
# Adding dovecot key
apt-key adv --fetch-keys http://software.open-xchange.com/oxbuildkey.pub
{
#TODO: get latest ee repo. bene?
echo "deb http://buildservice.open-xchange.com/dovecot-ee-2.3.9.3-2/DebianBuster/ /"
} > /etc/apt/sources.list.d/dovecot.list
elif [[ true == "${ANY_SLES}" ]]; then
echo ""
echo "ERROR: dovecot setup on sles not yet implemented"
echo ""
sleep 10
exit 1
elif [[ true == "${ANY_RHEL}" ]] || [[ true == "${ANY_CENTOS}" ]]; then
echo ""
echo "ERROR: dovecot setup on rhel/centos not yet implemented"
echo ""
sleep 10
exit 1
fi
installPackages "dovecot-ee-core dovecot-ee-imapd dovecot-ee-license dovecot-ee-managesieved dovecot-ee-sieve dovecot-ee-pop3d dovecot-ee-lmtpd dovecot-ee-virtual-attachments-plugin postfix rsyslog"
else
if [[ true == "${ANY_DEB}" ]]; then
# Adding dovecot key
apt-key adv --fetch-keys https://repo.dovecot.org/DOVECOT-REPO-GPG
{
# Adding dovecot key
apt-key adv --fetch-keys https://repo.dovecot.org/DOVECOT-REPO-GPG
{
echo "deb https://repo.dovecot.org/ce-${DC_VERSION}/debian/${DIST_VERSION} ${DIST_VERSION} main"
} > /etc/apt/sources.list.d/dovecot.list
} > /etc/apt/sources.list.d/dovecot.list
elif [[ true == "${ANY_SLES}" ]]; then
echo ""
echo "ERROR: dovecot setup on sles not yet implemented"
echo ""
sleep 10
exit 1
echo ""
echo "ERROR: dovecot setup on sles not yet implemented"
echo ""
sleep 10
exit 1
elif [[ true == "${ANY_RHEL}" ]] || [[ true == "${ANY_CENTOS}" ]]; then
echo ""
echo "ERROR: dovecot setup on rhel/centos not yet implemented"
echo ""
sleep 10
exit 1
echo ""
echo "ERROR: dovecot setup on rhel/centos not yet implemented"
echo ""
sleep 10
exit 1
fi
installPackages "dovecot-core dovecot-imapd dovecot-lmtpd dovecot-managesieved dovecot-sieve dovecot-pop3d dovecot-ldap postfix rsyslog"
echo "Copy Dovecot Configs"
rm -rf /etc/dovecot/*
cp -R config/dovecot/etc/dovecot/* /etc/dovecot/
restartService dovecot
INIT_STATE_FILE="/etc/dovecot/dovecot-init-done"
if [ ! -f "/etc/dovecot/dovecot.conf" ]; then
# Copy default config
echo "Copying default config from /etc/dovecot.dist"
cp -R /etc/dovecot.dist/* /etc/dovecot/
fi
fi
echo "Copy Dovecot Configs"
rm -rf /etc/dovecot/*
cp -R config/dovecot/etc/dovecot/* /etc/dovecot/
restartService dovecot
INIT_STATE_FILE="/etc/dovecot/dovecot-init-done"
if [ ! -f ${INIT_STATE_FILE} ]; then
mkdir /var/log/dovecot
if [ ! -f ${INIT_STATE_FILE} ]; then
# Create log dir and adjust permissions
if [[ ! -d "/var/log/dovecot/" ]];then
mkdir -p /var/log/dovecot
fi
echo "Executing init-config script (dovecot-backend) "
echo "$0 $@"
echo "Creating user and group: vmail"
groupadd -g 5000 vmail
useradd -u 5000 -g 5000 -m -d /home/vmail -s /bin/false vmail
adduser dovecot vmail
# Create log dir and adjust permissions
mkdir -p /var/log/dovecot
touch /var/log/dovecot/debug.log
touch /var/log/dovecot/info.log
touch /var/log/dovecot/error.log
......@@ -181,9 +198,9 @@ if [ ! -f ${INIT_STATE_FILE} ]; then
chmod 2770 /home/vmail
restartService postfix
restartService dovecot
fi
restartService dovecot
fi
elif [[ "${FEATURE_ENABLE}" = false ]]; then
INPUT=${SCRIPT_DIR}/../config/environment/qa/users.csv
OLDIFS=$IFS
......@@ -216,6 +233,4 @@ elif [[ "${FEATURE_ENABLE}" = true ]]; then
# echo "password : $password"
done < $INPUT
IFS=$OLDIFS
fi
fi
\ No newline at end of file
......@@ -124,6 +124,16 @@ case $key in
sleep 3
shift
;;
--dovecot-ee)
export INSTALL_DOVECOT_EE=true
export INSTALL_DOVECOT=true
export OX_MAIL_HOST=localhost
export OX_MAIL_DOMAIN=$(hostname)
echo "WARNING: overriding OX_MAIL_HOST and OX_MAIL_DOMAIN with local only dovecot configuration!"
sleep 3
sleep 3
shift
;;
-s|--singlenode)
export INSTALL_DATABASE=true
export INSTALL_MIDDLEWARE=true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment