• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

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