aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorler <ler@FreeBSD.org>2018-10-30 07:28:26 +0800
committerler <ler@FreeBSD.org>2018-10-30 07:28:26 +0800
commit15de61c021a723715632a8904076dee29799154a (patch)
tree80a8253c98dc7ae2eecc71270fb97ed8ffca39e4 /mail
parent0b1593edd5c5a885697f1d2d67888bac7624fa69 (diff)
downloadfreebsd-ports-gnome-15de61c021a723715632a8904076dee29799154a.tar.gz
freebsd-ports-gnome-15de61c021a723715632a8904076dee29799154a.tar.zst
freebsd-ports-gnome-15de61c021a723715632a8904076dee29799154a.zip
mail/dovecot: give better error message(s) when there are configuration errors.
PR: 232785 Submitted by: prj@rootwyrm.com
Diffstat (limited to 'mail')
-rw-r--r--mail/dovecot/Makefile2
-rw-r--r--mail/dovecot/files/dovecot.in8
2 files changed, 9 insertions, 1 deletions
diff --git a/mail/dovecot/Makefile b/mail/dovecot/Makefile
index 9deef42bc432..cde1cabd8118 100644
--- a/mail/dovecot/Makefile
+++ b/mail/dovecot/Makefile
@@ -8,7 +8,7 @@
PORTNAME= dovecot
PORTVERSION= 2.3.3
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= mail ipv6
MASTER_SITES= https://www.dovecot.org/releases/2.3/
diff --git a/mail/dovecot/files/dovecot.in b/mail/dovecot/files/dovecot.in
index cc3b43efc02b..e5a5c166c9f7 100644
--- a/mail/dovecot/files/dovecot.in
+++ b/mail/dovecot/files/dovecot.in
@@ -60,6 +60,14 @@ for config in ${dovecot_config}; do
required_files="${config}"
command_args="-c ${config}"
if [ -s ${config} ]; then
+ ${command} ${command_args} -a 2>/dev/null
+ if [ $? -ne 0 ]; then
+ echo "==Error=="
+ echo "Configuration file check failed."
+ # Use dovecot to print the config error.
+ ${command} ${command_args} -a
+ exit $?
+ fi
base_dir=$(${command} ${command_args} -a 2>/dev/null | /usr/bin/awk -F '= ' '/^base_dir =/ { print $2 }')
pidfile="${base_dir}/master.pid"
else