mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
Add ability to build with Dovecot community repository (#2797)
This commit is contained in:
parent
a09d46a677
commit
157fde23af
|
@ -9,8 +9,9 @@
|
||||||
|
|
||||||
FROM docker.io/debian:11-slim AS stage-base
|
FROM docker.io/debian:11-slim AS stage-base
|
||||||
|
|
||||||
ARG LOG_LEVEL=trace
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
ARG DOVECOT_COMMUNITY_REPO=0
|
||||||
|
ARG LOG_LEVEL=trace
|
||||||
|
|
||||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||||
|
|
||||||
|
|
|
@ -43,16 +43,10 @@ function _install_packages
|
||||||
{
|
{
|
||||||
_log 'debug' 'Installing all packages now'
|
_log 'debug' 'Installing all packages now'
|
||||||
|
|
||||||
declare -a DOVECOT_PACKAGES ANTI_VIRUS_SPAM_PACKAGES
|
declare -a ANTI_VIRUS_SPAM_PACKAGES
|
||||||
declare -a CODECS_PACKAGES MISCELLANEOUS_PACKAGES
|
declare -a CODECS_PACKAGES MISCELLANEOUS_PACKAGES
|
||||||
declare -a POSTFIX_PACKAGES MAIL_PROGRAMS_PACKAGES
|
declare -a POSTFIX_PACKAGES MAIL_PROGRAMS_PACKAGES
|
||||||
|
|
||||||
DOVECOT_PACKAGES=(
|
|
||||||
dovecot-core dovecot-fts-xapian dovecot-imapd
|
|
||||||
dovecot-ldap dovecot-lmtpd dovecot-managesieved
|
|
||||||
dovecot-pop3d dovecot-sieve dovecot-solr
|
|
||||||
)
|
|
||||||
|
|
||||||
ANTI_VIRUS_SPAM_PACKAGES=(
|
ANTI_VIRUS_SPAM_PACKAGES=(
|
||||||
amavisd-new clamav clamav-daemon
|
amavisd-new clamav clamav-daemon
|
||||||
pyzor razor spamassassin
|
pyzor razor spamassassin
|
||||||
|
@ -89,7 +83,6 @@ function _install_packages
|
||||||
)
|
)
|
||||||
|
|
||||||
apt-get "${QUIET}" --no-install-recommends install \
|
apt-get "${QUIET}" --no-install-recommends install \
|
||||||
"${DOVECOT_PACKAGES[@]}" \
|
|
||||||
"${ANTI_VIRUS_SPAM_PACKAGES[@]}" \
|
"${ANTI_VIRUS_SPAM_PACKAGES[@]}" \
|
||||||
"${CODECS_PACKAGES[@]}" \
|
"${CODECS_PACKAGES[@]}" \
|
||||||
"${MISCELLANEOUS_PACKAGES[@]}" \
|
"${MISCELLANEOUS_PACKAGES[@]}" \
|
||||||
|
@ -97,6 +90,31 @@ function _install_packages
|
||||||
"${MAIL_PROGRAMS_PACKAGES[@]}"
|
"${MAIL_PROGRAMS_PACKAGES[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _install_dovecot
|
||||||
|
{
|
||||||
|
declare -a DOVECOT_PACKAGES
|
||||||
|
|
||||||
|
DOVECOT_PACKAGES=(
|
||||||
|
dovecot-core dovecot-fts-xapian dovecot-imapd
|
||||||
|
dovecot-ldap dovecot-lmtpd dovecot-managesieved
|
||||||
|
dovecot-pop3d dovecot-sieve dovecot-solr
|
||||||
|
)
|
||||||
|
|
||||||
|
if [[ ${DOVECOT_COMMUNITY_REPO} -eq 1 ]]
|
||||||
|
then
|
||||||
|
_log 'trace' 'Using Dovecot community repository'
|
||||||
|
curl https://repo.dovecot.org/DOVECOT-REPO-GPG | gpg --import
|
||||||
|
gpg --export ED409DA1 > /etc/apt/trusted.gpg.d/dovecot.gpg
|
||||||
|
echo "deb https://repo.dovecot.org/ce-2.3-latest/debian/bullseye bullseye main" > /etc/apt/sources.list.d/dovecot.list
|
||||||
|
|
||||||
|
_log 'trace' 'Updating Dovecot package signatures'
|
||||||
|
apt-get "${QUIET}" update
|
||||||
|
fi
|
||||||
|
|
||||||
|
_log 'debug' 'Installing Dovecot'
|
||||||
|
apt-get "${QUIET}" --no-install-recommends install "${DOVECOT_PACKAGES[@]}"
|
||||||
|
}
|
||||||
|
|
||||||
function _install_fail2ban
|
function _install_fail2ban
|
||||||
{
|
{
|
||||||
local FAIL2BAN_DEB_URL='https://github.com/fail2ban/fail2ban/releases/download/0.11.2/fail2ban_0.11.2-1.upstream1_all.deb'
|
local FAIL2BAN_DEB_URL='https://github.com/fail2ban/fail2ban/releases/download/0.11.2/fail2ban_0.11.2-1.upstream1_all.deb'
|
||||||
|
@ -142,5 +160,6 @@ function _post_installation_steps
|
||||||
_pre_installation_steps
|
_pre_installation_steps
|
||||||
_install_postfix
|
_install_postfix
|
||||||
_install_packages
|
_install_packages
|
||||||
|
_install_dovecot
|
||||||
_install_fail2ban
|
_install_fail2ban
|
||||||
_post_installation_steps
|
_post_installation_steps
|
||||||
|
|
Loading…
Reference in a new issue