fix: Drop `/var/lib/getmail/` location

This commit is contained in:
Brennan Kinney 2024-05-17 21:21:46 +12:00 committed by GitHub
parent df1939abc3
commit b7ff8b2e7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 11 deletions

View File

@ -7,13 +7,7 @@ source /usr/local/bin/setup.d/getmail.sh
_setup_getmail
if [[ -d /var/lib/getmail ]]; then
GETMAILDIR=/var/lib/getmail
else
mkdir -p /tmp/docker-mailserver/getmail
GETMAILDIR=/tmp/docker-mailserver/getmail
fi
GETMAILDIR=/tmp/docker-mailserver/getmail
for FILE in /etc/getmailrc.d/getmailrc*; do
getmail --getmaildir "${GETMAILDIR}" --rcfile "${FILE}" --dump | tail -n +6
done

View File

@ -1,7 +1,8 @@
#! /bin/bash
GETMAILDIR=/tmp/docker-mailserver/getmail
for FILE in /etc/getmailrc.d/getmailrc*; do
if ! pgrep -f "${FILE}$" &>/dev/null; then
getmail --getmaildir /var/lib/getmail --rcfile "${FILE}"
getmail --getmaildir "${GETMAILDIR}" --rcfile "${FILE}"
fi
done

View File

@ -33,8 +33,9 @@ EOF
fi
# Both the debug command and cron job (that runs getmail) for getmail
# expect this location to exist. As does the `/var/mail-state` startup script.
mkdir -p /var/lib/getmail
# expect this location to exist.
GETMAILDIR=/tmp/docker-mailserver/getmail
mkdir -p "${GETMAILDIR}"
else
_log 'debug' 'Getmail is disabled'
fi

View File

@ -23,7 +23,6 @@ function _setup_save_states() {
[[ ${ENABLE_CLAMAV} -eq 1 ]] && SERVICEDIRS+=('lib/clamav')
[[ ${ENABLE_FAIL2BAN} -eq 1 ]] && SERVICEDIRS+=('lib/fail2ban')
[[ ${ENABLE_FETCHMAIL} -eq 1 ]] && SERVICEDIRS+=('lib/fetchmail')
[[ ${ENABLE_GETMAIL} -eq 1 ]] && SERVICEDIRS+=('lib/getmail')
[[ ${ENABLE_MTA_STS} -eq 1 ]] && SERVICEDIRS+=('lib/mta-sts')
[[ ${ENABLE_POSTGREY} -eq 1 ]] && SERVICEDIRS+=('lib/postgrey')
[[ ${ENABLE_RSPAMD} -eq 1 ]] && SERVICEDIRS+=('lib/rspamd')