0x1949 Team - FAZEMRX - MANAGER
Edit File: cpanel-dovecot.preinst
#!/bin/sh set -e # https://wiki.debian.org/MaintainerScripts test -n "$PBUILDER_OPERATION" && echo "Skipping pre-install for dovecot due to PBUILDER_OPERATION environment variable" && exit 0; ## <asset scriplets/pre> set -e if [ -z "$INIT_D" ]; then INIT_D=0; fi; if [ -z "$RHEL" ]; then RHEL=0; fi; PREFIX=/usr/local/cpanel/3rdparty # in all pre pre_upgrade() { # on upgrades we need to stop dovecot. echo "Stopping previous version of dovecot on upgrade" /usr/local/cpanel/scripts/restartsrv dovecot --stop ||: } # Install, not upgrade pre_install() { setup_users; if [ "$INIT_D" = "1" ]; then if [ ! -f /etc/rc.d/init.d/cpfunctions ]; then install -p -m644 /usr/local/cpanel/etc/init/scripts/centos/cpfunctions /etc/rc.d/init.d/cpfunctions fi fi fix_dovecot_wrap; } fix_dovecot_wrap() { # This is redundant with install/Wrap.pm but required in case upcp fails. if [ -f /usr/local/cpanel/bin/dovecot-wrap ]; then chown root:dovecot /usr/local/cpanel/bin/dovecot-wrap && chmod 4750 /usr/local/cpanel/bin/dovecot-wrap fi } setup_users() { #dovecot uid and gid are reserved, see /usr/share/doc/setup-*/uidgid getent group dovecot >/dev/null || groupadd -r --gid 97 dovecot getent passwd dovecot >/dev/null || \ useradd -r --uid 97 -g dovecot -d /usr/libexec/dovecot -s /sbin/nologin -c "Dovecot IMAP server" dovecot getent group dovenull >/dev/null || groupadd -r dovenull getent passwd dovenull >/dev/null || \ useradd -r -g dovenull -d /usr/libexec/dovecot -s /sbin/nologin -c "Dovecot's unauthorized user" dovenull } ## </asset> case "$1" in upgrade) pre_upgrade; pre_install; ;; install) pre_install; ;; esac exit 0