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.
This commit is contained in:
Malte Meiboom
2026-05-20 16:22:07 +02:00
parent e1a75288a6
commit 74ded863f2
+7 -1
View File
@@ -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