Skip to content

Commit faa0985

Browse files
authored
Fix catchall Deb12 / Ubuntu 22.04 (hestiacp#3760)
* Update exim4.95 config for catchall * remove extra lines * Update 1.8.0.sh
1 parent aa2a065 commit faa0985

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

install/deb/exim/exim4.conf.4.94.template

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,6 @@ terminate_alias:
362362
transport = devnull
363363
condition = ${lookup{$local_part@$domain}lsearch{/etc/exim4/domains/${lookup{$domain}dsearch{/etc/exim4/domains/}}/aliases}{true}{false}}
364364

365-
366-
367365
######################################################################
368366
# TRANSPORTS CONFIGURATION #
369367
######################################################################

install/deb/exim/exim4.conf.4.95.template

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,14 +377,13 @@ catchall:
377377
data = ${extract{1}{:}{${lookup{*@$domain}lsearch{/etc/exim4/domains/${lookup{$domain}dsearch{/etc/exim4/domains/}}/aliases}}}}
378378
file_transport = local_delivery
379379
redirect_router = dnslookup
380+
condition = ${lookup{$local_part@$domain}lsearch{/etc/exim4/domains/${lookup{$domain}dsearch{/etc/exim4/domains/}}/aliases}{false}{true}}
380381

381382
terminate_alias:
382383
driver = accept
383384
transport = devnull
384385
condition = ${lookup{$local_part@$domain}lsearch{/etc/exim4/domains/${lookup{$domain}dsearch{/etc/exim4/domains/}}/aliases}{true}{false}}
385386

386-
387-
388387
######################################################################
389388
# TRANSPORTS CONFIGURATION #
390389
######################################################################

install/deb/exim/exim4.conf.template

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,6 @@ terminate_alias:
364364
transport = devnull
365365
condition = ${lookup{$local_part@$domain}lsearch{/etc/exim4/domains/$domain/aliases}{true}{false}}
366366

367-
368-
369367
######################################################################
370368
# TRANSPORTS CONFIGURATION #
371369
######################################################################

install/upgrade/versions/1.8.0.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,4 +264,19 @@ if [ "$MAIL_SYSTEM" = "exim4" ]; then
264264
chown root:Debian-exim /etc/exim4/srs.conf
265265
fi
266266
fi
267+
268+
exim_version=$(exim4 --version | head -1 | awk '{print $3}' | cut -f -2 -d .)
269+
# if Exim version > 4.95 or greater!
270+
if version_ge "$exim_version" "4.95"; then
271+
if [ -z "$(grep -e 'condition = \${lookup{\$local_part@\$domain}lsearch{/etc/exim4/domains/\${lookup{\$domain}dsearch{/etc/exim4/domains/}}/aliases}{false}{true}}' /etc/exim4/exim4.conf.template)" ]; then
272+
for line in $(sed -n '/redirect_router = dnslookup/=' /etc/exim4/exim4.conf.template); do
273+
testline=$((line - 1))
274+
newline=$((line + 1))
275+
if [ "$(awk NR==$testline /etc/exim4/exim4.conf.template)" = " file_transport = local_delivery" ]; then
276+
# Add new line
277+
sed -i "$newline i \ \ condition = \${lookup{\$local_part@\$domain}lsearch{/etc/exim4/domains/\${lookup{\$domain}dsearch{/etc/exim4/domains/}}/aliases}{false}{true}}" /etc/exim4/exim4.conf.template
278+
fi
279+
done
280+
fi
281+
fi
267282
fi

0 commit comments

Comments
 (0)