mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-12-24 07:37:04 +00:00
fake mail script
This commit is contained in:
parent
e1c0cf6c0c
commit
020110eefd
22
tools/fake_mail
Normal file
22
tools/fake_mail
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
# Save the command-line information passed to the function
|
||||
# so that I can translate info to call sendmail
|
||||
if read -t 0; then
|
||||
message=`cat`
|
||||
fi
|
||||
script="$0"
|
||||
|
||||
for arg in "$@"; do
|
||||
if [ "$lastarg" == "-s" ]; then
|
||||
subject="$arg"
|
||||
fi
|
||||
if [[ $arg =~ [[:space:]] ]]; then
|
||||
arg=\"$arg\"
|
||||
fi
|
||||
lastarg="$arg"
|
||||
done
|
||||
|
||||
# send message using sendmail
|
||||
echo "Subject: $subject
|
||||
|
||||
$message" | sendmail -F "`hostname -f`" "$lastarg"
|
Loading…
Reference in New Issue
Block a user