From 74ded863f2d611fea7df05d3f0f1396f8f2a06db Mon Sep 17 00:00:00 2001 From: Malte Meiboom Date: Wed, 20 May 2026 16:22:07 +0200 Subject: [PATCH] Fix mail test - Create an empty mailbox file in `/var/mail` so that `inotifywait` can wait on the right file and not just observe the directory. --- e2e-tests/common.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/e2e-tests/common.sh b/e2e-tests/common.sh index 2ec7c30..113b0aa 100644 --- a/e2e-tests/common.sh +++ b/e2e-tests/common.sh @@ -12,8 +12,14 @@ delete_unix_user() { # name # send a mail and wait for delivery send_test_mail() { # email_address + USER=$(echo $1 | cut -f 1 -d '@') + # create an empty mailbox file + touch /var/mail/$USER + chown $USER:mail /var/mail/$USER + chmod 600 /var/mail/$USER + echo "test mail" | sendmail $1 - inotifywait -qq -t 3 -e close_write /var/mail + inotifywait -qq -t 3 -e close_write /var/mail/$USER } # test header