• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

Input Mail-Headers?

Just follow that recipe!
I don't agree that such info is sensitive, but hey, everyone has their right for paranoia.

There's no way (AFAIK) to prevent Plesk from rewriting main.cf and master.cf, but it doesn't do it as often as it did in the past.

I have a monitoring system that will alert me that this file has changed.
I have a cronjob that will save the complete /etc/postfix in a compressed tar-file if it ever changes.
It has the advantage that you will find out if Plesk has been improved or that it just killed your custom setup.

cat /etc/cron.hourly/taretcs
Code:
#!/bin/bash

tarfolder /etc/postfix
tarfolder /etc/courier-imap
tarfolder /etc/dovecot

cat /usr/local/sbin/tarfolder
Code:
#!/bin/bash

# Strip last slash..
DATESTAMP=`date +%Y-%m-%d.%H-%M`
HEADLESS=
tty >/dev/null || HEADLESS=true

GLOB=
SUFFIX=
while getopts d opt ; do
  case $opt in
    d)   GLOB='/*(.)' ;;
    ?)   printf "Usage: %s: [-d] <folder>\n" $0
    exit 2;;
  esac
done
shift `expr ${OPTIND} - 1`

[ -z "${GLOB}" ] || SUFFIX="_NoSubfolders"

FOLDER="`echo ${1} | sed 's/\/$//'`"
[ -d "${FOLDER}" ] || exit 1

if ! echo "${FOLDER}" | grep -q '^/' ; then
  FOLDER="`realpath ${FOLDER} 2>/dev/null`"
  if [ -z "${FOLDER}" ] ; then
    echo "You need to use an absolute path (or install readlink => apt-get instatll readlink)" >&2
    exit 1
  fi
fi

DIRFILE=`echo ${FOLDER} | tr '/ ' '.' | tr -s '.'`
TMPDIR=`mktemp -t -d ${0//*\/}.XXXXXXXXXX`

if cd ${TMPDIR} ; then
  TGZ="${TMPDIR}/.${DIRFILE}.${DATESTAMP}.tgz"

  tar cpzf "${TGZ}" "${FOLDER}${GLOB}" --exclude=*.tgz >/dev/null 2>&1
  LATEST_TGZ=`find "${FOLDER}" -maxdepth 1 -type f | \
                   grep "${DIRFILE}.*\.tgz" | xargs -I{} stat -c '%Y %n' {} | \
                   sort -rn | head -n1 | awk '{print $2}'`

  if [ -z "${LATEST_TGZ}" ] ; then
    [ ${HEADLESS} ] || echo "First tgz" >&2
    mv "${TGZ}" "${FOLDER}/"
  else
    mkdir ${TMPDIR}/f1
    mkdir ${TMPDIR}/f2
    if tar xzf "${LATEST_TGZ}" -C ${TMPDIR}/f1  >/dev/null 2>&1 ; then
      if tar xzf "${TGZ}" -C ${TMPDIR}/f2  >/dev/null 2>&1 ; then
        if diff -r ${TMPDIR}/f1  ${TMPDIR}/f2 >/dev/null 2>&1 ; then
          [ ${HEADLESS} ] || echo "Folder \"${FOLDER}\" hasn't changed.... I will discard this tgz" >&2
        else
          if [ ! ${HEADLESS} ] ; then
            echo "Last tgz is different" >&2
            diff -r ${TMPDIR}/f1  ${TMPDIR}/f2
          fi
          mv "${TGZ}" "${FOLDER}/"
        fi
      fi
    fi
  fi
fi
rm -rf ${TMPDIR}
 
Last edited:
Back
Top