0x1949 Team - FAZEMRX - MANAGER
Edit File: cpanel-exim.postinst
#!/bin/bash set -e # https://wiki.debian.org/MaintainerScripts test -z "$PBUILDER_OPERATION" || ( echo "Skipping post-install for clamav due to PBUILDER_OPERATION environment variable"; exit 0 ) ## <asset scriplets/post> set -e if [ -z "$INIT_D" ]; then INIT_D=0; fi; if [ -z "$RHEL" ]; then RHEL=0; fi; PREFIX=/usr/local/cpanel/3rdparty runPost_install() { if [ "$INIT_D" = "1" ]; then /sbin/chkconfig --add exim /sbin/chkconfig --level 35 exim on >/dev/null 2>&1 else /usr/bin/systemctl daemon-reload /usr/bin/systemctl enable exim.service fi } runPost_all() { hostname >> /etc/localdomains if [ "$INIT_D" = "0" ]; then # on upgrades we want to reload the daemon to reparse the service file # /usr/bin/systemctl daemon-reload; fi chown root:mail /etc/valiases ||: chown root:mail /etc/vdomainaliases ||: chown root:mail /etc/vfilters ||: chown root:mailtrap /usr/sbin/sendmail ||: # need to adjust perms here as we rely on a non standard owner chmod 2755 /usr/sbin/sendmail ||: mkdir -p /var/spool/exim/db/ touch /var/log/exim_mainlog touch /var/log/exim_paniclog touch /var/log/exim_rejectlog chown -R mailnull:mailnull /var/log/exim_* /usr/local/cpanel/scripts/buildeximconf chown -R mailnull:mailnull /var/log/exim_* touch /etc/aliases chmod 644 /etc/aliases chmod 666 /dev/null if [ -e '/etc/exim.crt.preinstall' ]; then /bin/rm -f /etc/exim.crt /bin/mv -f /etc/exim.crt.preinstall /etc/exim.crt fi if [ -e '/etc/exim.key.preinstall' ]; then /bin/rm -f /etc/exim.key /bin/mv -f /etc/exim.key.preinstall /etc/exim.key fi if [ -e '/home/exim4-install' ]; then /bin/rm -rf /home/exim4-install fi if [ -e "/etc/exim.crt" -a -e "/etc/exim.key" ]; then echo else echo "US Unknown Unknown Unknown Unknown `hostname` ssl@cpanel.net " | \ openssl req -x509 -newkey rsa:2048 -keyout /etc/exim.key -out /etc/exim.crt -days 9999 -nodes /bin/chown mailnull:mail /etc/exim.crt /etc/exim.key /bin/chmod 0600 /etc/exim.crt /etc/exim.key fi for file in /etc/localdomains /etc/aliases /etc/secondarymx do if [ -e ${file}.eximreset ]; then /bin/cp -af ${file}.eximreset ${file} /bin/rm -f ${file}.eximreset fi done if [ -e '/var/log/exim_mainlog' ]; then /bin/chmod 640 /var/log/exim_* /bin/chown mailnull:mail /var/log/exim_* fi if [ ! -e '/etc/exim.conf' ]; then echo "Building exim.conf ... " /usr/local/cpanel/scripts/buildeximconf echo "Done" fi # do not abort when no *lock* files are available /bin/rm -f /var/spool/exim/db/*.lock* ||: for db in retry wait-remote_smtp misc callout; do /usr/sbin/exim_dbmbuild /dev/null /var/spool/exim/db/${db} done if [ -e "/var/spool/exim_incoming/db" ]; then /bin/rm -f /var/spool/exim_incoming/db/*.lock* for db in retry wait-remote_smtp misc callout; do /usr/sbin/exim_dbmbuild /dev/null /var/spool/exim_incoming/db/${db} done /bin/chmod 640 /var/spool/exim_incoming/db/* fi if [ -e "/var/spool/exim_incoming" ]; then /bin/chown -R mailnull:mail /var/spool/exim_incoming fi # do not abort when the directory is empty /bin/chmod 640 /var/spool/exim/db/* ||: /usr/local/cpanel/bin/servers_queue --plugin=CpServicesTasks queue "restartsrv exim" echo "Install Complete" } ## </asset> case "$1" in configure) if [ "x$2" = 'x' ]; then runPost_install; fi runPost_all; ;; esac exit 0