summaryrefslogtreecommitdiffstats
path: root/debian/tests/basic
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:16:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:16:14 +0000
commit318a1a2246a9f521e5a02313dcc1f6d68a0af7ec (patch)
treee28c79d572e488bf782444e31d81291b99ef1932 /debian/tests/basic
parentAdding upstream version 4.96. (diff)
downloadexim4-318a1a2246a9f521e5a02313dcc1f6d68a0af7ec.tar.xz
exim4-318a1a2246a9f521e5a02313dcc1f6d68a0af7ec.zip
Adding debian version 4.96-15+deb12u4.debian/4.96-15+deb12u4debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/tests/basic')
-rwxr-xr-xdebian/tests/basic60
1 files changed, 60 insertions, 0 deletions
diff --git a/debian/tests/basic b/debian/tests/basic
new file mode 100755
index 0000000..ac641a1
--- /dev/null
+++ b/debian/tests/basic
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+set -e
+
+runandshow() {
+ count=0
+ printf '===============\n%s: running ' $0
+ for i in "$@" ; do
+ printf "argv[%i]=[%s] " "$count" "$i"
+ count=$(($count+1))
+ done
+ echo
+ "$@"
+}
+
+shouldfail() {
+if runandshow "$@"; then
+ echo ... should have failed
+ exit 1
+else
+ :
+fi
+}
+
+exim=/usr/sbin/exim4
+
+
+runandshow $exim -bV
+runandshow $exim -bt postmaster@localhost
+
+# Since example.com is not a local domain delivery should fail with the
+# default dc_eximconfig_configtype=local
+shouldfail $exim -bt invalid@example.com
+runandshow $exim -be \
+ '${lookup{exim4.conf.template}dsearch{/etc/exim4}{$value}fail}'
+rc="$($exim -be \
+ '${lookup{exim4.conf.template}dsearch{/etc/exim4}{$value}fail}')"
+if [ "$rc" != "exim4.conf.template" ]; then
+ echo wrong expansion result $rc
+ false
+fi
+
+runandshow $exim -be \
+ '${run{/bin/echo -n foo}{success}{error}} runrc[$runrc] value[$value]'
+rc="$($exim -be \
+ '${run{/bin/echo -n foo}{success}{error}} runrc[$runrc] value[$value]')"
+if [ "$rc" != "success runrc[0] value[foo]" ]; then
+ echo wrong expansion result $rc
+ false
+fi
+
+runandshow swaks -s localhost -tlso -q ehlo
+runandshow swaks -s localhost -tlso -f root@localhost -t postmaster@localhost \
+ -q rcpt
+shouldfail swaks -s localhost -tlso -f root@localhost \
+ -t postmaster@localhost \
+ --h-From 'From: Invalid Syntax <root@localhost'
+shouldfail swaks -s localhost -tlso -f root@localhost \
+ -t postmaster@localhost \
+ --body `dirname $0`/long-header.msg