From 65005a655185c937dd085c7175f69c2a92e1ae0b Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Fri, 24 Jan 2014 14:26:57 -0300 Subject: Add a test for non-ascii mail with charset header. Also use python to get the TO field from the options.cfg file. --- src/swaks-batch.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/swaks-batch.sh b/src/swaks-batch.sh index 1e81210..3949d38 100755 --- a/src/swaks-batch.sh +++ b/src/swaks-batch.sh @@ -16,11 +16,15 @@ if ! `hash $SWAKS 2>/dev/null`; then exit 1 fi -# Customize this in order to test the desired accounts -FROM=ivan@dev.bitmask.net -TO=test_123@dev.bitmask.net +# Python helper to read configurations from file: +TO=`python -c "from ConfigParser import SafeConfigParser as scp; p = scp(); p.read('options.cfg'); print p.get('Configs', 'to');"` + +FROM=swaks@bitmask.net # this account does not need to exist. # 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' +# Non-ascii subject and body, without charset specification +$SWAKS --to $TO --from $FROM --header "Subject: Test 01 -- áèīôü" --body "Howdy from swaks. ýëąĥ" --helo 'asdf.com' + +# Non-ascii subject and body, with charset specification +$SWAKS --to $TO --from $FROM --header "Content-Type: text/plain; charset='utf-8'\nSubject: Test 02 -- áèīôü" --body "Howdy from swaks. ýëąĥ" --helo 'asdf.com' -- cgit v1.2.3