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

first steps with dovecot-ee

parent 3f5ee199
...@@ -89,55 +89,72 @@ done ...@@ -89,55 +89,72 @@ done
set -- "${POSITIONAL[@]}" # restore positional parameters set -- "${POSITIONAL[@]}" # restore positional parameters
if [[ "${FEATURE_INSTALL}" = true ]]; then if [[ "${FEATURE_INSTALL}" = true ]]; then
if [[ -z "${DC_VERSION}" ]]; then if [[ -z "${DC_VERSION}" ]]; then
echo "Version not specified, set to latest" echo "Version not specified, set to latest"
DC_VERSION=2.3-latest DC_VERSION=2.3-latest
fi 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 if [[ true == "${ANY_DEB}" ]]; then
# Adding dovecot key # Adding dovecot key
apt-key adv --fetch-keys https://repo.dovecot.org/DOVECOT-REPO-GPG 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" 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 elif [[ true == "${ANY_SLES}" ]]; then
echo "" echo ""
echo "ERROR: dovecot setup on sles not yet implemented" echo "ERROR: dovecot setup on sles not yet implemented"
echo "" echo ""
sleep 10 sleep 10
exit 1 exit 1
elif [[ true == "${ANY_RHEL}" ]] || [[ true == "${ANY_CENTOS}" ]]; then elif [[ true == "${ANY_RHEL}" ]] || [[ true == "${ANY_CENTOS}" ]]; then
echo "" echo ""
echo "ERROR: dovecot setup on rhel/centos not yet implemented" echo "ERROR: dovecot setup on rhel/centos not yet implemented"
echo "" echo ""
sleep 10 sleep 10
exit 1 exit 1
fi fi
installPackages "dovecot-core dovecot-imapd dovecot-lmtpd dovecot-managesieved dovecot-sieve dovecot-pop3d dovecot-ldap postfix rsyslog" installPackages "dovecot-core dovecot-imapd dovecot-lmtpd dovecot-managesieved dovecot-sieve dovecot-pop3d dovecot-ldap postfix rsyslog"
echo "Copy Dovecot Configs" fi
rm -rf /etc/dovecot/* echo "Copy Dovecot Configs"
cp -R config/dovecot/etc/dovecot/* /etc/dovecot/ rm -rf /etc/dovecot/*
restartService dovecot cp -R config/dovecot/etc/dovecot/* /etc/dovecot/
restartService dovecot
INIT_STATE_FILE="/etc/dovecot/dovecot-init-done"
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
if [ ! -f ${INIT_STATE_FILE} ]; then if [ ! -f ${INIT_STATE_FILE} ]; then
mkdir /var/log/dovecot # 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 "Executing init-config script (dovecot-backend) "
echo "$0 $@" echo "$0 $@"
echo "Creating user and group: vmail" echo "Creating user and group: vmail"
groupadd -g 5000 vmail groupadd -g 5000 vmail
useradd -u 5000 -g 5000 -m -d /home/vmail -s /bin/false vmail useradd -u 5000 -g 5000 -m -d /home/vmail -s /bin/false vmail
adduser dovecot 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/debug.log
touch /var/log/dovecot/info.log touch /var/log/dovecot/info.log
touch /var/log/dovecot/error.log touch /var/log/dovecot/error.log
...@@ -181,9 +198,9 @@ if [ ! -f ${INIT_STATE_FILE} ]; then ...@@ -181,9 +198,9 @@ if [ ! -f ${INIT_STATE_FILE} ]; then
chmod 2770 /home/vmail chmod 2770 /home/vmail
restartService postfix restartService postfix
restartService dovecot restartService dovecot
fi
fi
elif [[ "${FEATURE_ENABLE}" = false ]]; then elif [[ "${FEATURE_ENABLE}" = false ]]; then
INPUT=${SCRIPT_DIR}/../config/environment/qa/users.csv INPUT=${SCRIPT_DIR}/../config/environment/qa/users.csv
OLDIFS=$IFS OLDIFS=$IFS
...@@ -216,6 +233,4 @@ elif [[ "${FEATURE_ENABLE}" = true ]]; then ...@@ -216,6 +233,4 @@ elif [[ "${FEATURE_ENABLE}" = true ]]; then
# echo "password : $password" # echo "password : $password"
done < $INPUT done < $INPUT
IFS=$OLDIFS IFS=$OLDIFS
fi fi
\ No newline at end of file
...@@ -124,6 +124,16 @@ case $key in ...@@ -124,6 +124,16 @@ case $key in
sleep 3 sleep 3
shift 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) -s|--singlenode)
export INSTALL_DATABASE=true export INSTALL_DATABASE=true
export INSTALL_MIDDLEWARE=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