diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2014-01-22 14:18:47 -0300 |
---|---|---|
committer | Ivan Alejandro <ivanalejandro0@gmail.com> | 2014-01-22 14:29:53 -0300 |
commit | cc516f070c938d02a7616910ef4233c390494661 (patch) | |
tree | 25ff7fb6a50972c5df673432e9e3f05459ab15a5 | |
parent | 38b56cd07fdd5c841f014656b8e67379692f78f0 (diff) |
Add swaks helper script.
-rwxr-xr-x | src/swaks-batch.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/swaks-batch.sh b/src/swaks-batch.sh new file mode 100755 index 0000000..1e81210 --- /dev/null +++ b/src/swaks-batch.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# This scripts depends on swaks: http://www.jetmore.org/john/code/swaks/ + +if [ -n "$1" ]; then + SWAKS=$1 +else + SWAKS=swaks +fi + +# if [[ "$SWAKS" == "" ]]; then +if ! `hash $SWAKS 2>/dev/null`; then + echo "Error: I need swaks to work." + echo "You can get swaks from: http://www.jetmore.org/john/code/swaks/" + echo "If you already have it, you can send its location as a first parameter of the script." + echo "E.g.: $0 /path/to/swaks" + exit 1 +fi + +# Customize this in order to test the desired accounts +FROM=ivan@dev.bitmask.net +TO=test_123@dev.bitmask.net + +# NOTE: Add the swak commands below here: + +# Unicode subject and body, without charset specification +$SWAKS --to $TO --from $FROM --header "Subject: Test -- áèīôü" --body "Howdy from swaks. ýëąĥ" --helo 'asdf.com' |