test-mail script fixes

This commit is contained in:
Ivan Dimitrov 2023-11-09 12:24:10 +02:00
parent 6b8ed09354
commit 46492ae750
2 changed files with 10 additions and 8 deletions

View File

@ -1,6 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env bash
mail="
name="Ivan Dimitrov"
from="ivan@idimitrov.dev"
rand="$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13 ; echo '')"
to="test-$rand@srv1.mail-tester.com"
mail="From: $from
To: $to
Subject: Invitation to Our Upcoming Tech Symposium Subject: Invitation to Our Upcoming Tech Symposium
List-Unsubscribe: <mailto:unsubscribe@example.com> List-Unsubscribe: <mailto:unsubscribe@example.com>
@ -32,12 +39,7 @@ jane.smith@example.com
P.S. If you wish to stop receiving these emails, you can unsubscribe by replying with 'UNSUBSCRIBE' in the subject line. P.S. If you wish to stop receiving these emails, you can unsubscribe by replying with 'UNSUBSCRIBE' in the subject line.
" "
name="Ivan Dimitrov" echo "$mail" | sendmail -t -F "$name" -f "$from"
from="ivan@idimitrov.dev"
rand="$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13 ; echo '')"
to="test-$rand.srv1.mail-tester.com"
sendmail -F "$name" -f "$from" "$to" < "$mail"
echo "https://mail-tester.com/test-$rand" echo "https://mail-tester.com/test-$rand"

View File

@ -50,6 +50,6 @@
}; };
environment = { environment = {
systemPackages = with pkgs; [ coreutils-full fd git vim mlocate busybox bash ]; systemPackages = with pkgs; [ coreutils-full fd git vim mlocate busybox bash scripts ];
}; };
} }