Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ matrix:
name: "Lint Checks, Packs Tests (Python 2.7)"
- env: TASK="compilepy3 ci-py3-unit" CACHE_NAME=py3 COMMAND_THRESHOLD=680
python: 3.6
name: "Unit Tests (Python 3.6)"
name: "Unit Tests, Pack Tests (Python 3.6)"
- env: TASK="ci-py3-integration" CACHE_NAME=py3 COMMAND_THRESHOLD=310
python: 3.6
name: "Integration Tests (Python 3.6)"
Expand Down Expand Up @@ -100,7 +100,7 @@ before_install:

install:
- ./scripts/travis/install-requirements.sh
- if [ "${TASK}" = 'ci-unit' ] || [ "${TASK}" = 'ci-integration' ] || [ "${TASK}" = 'compilepy3 ci-py3-unit' ] || [ "${TASK}" = 'ci-py3-integration' ]; then sudo .circle/add-itest-user.sh; fi
- if [ "${TASK}" = 'ci-unit' ] || [ "${TASK}" = 'ci-integration' ] || [ "${TASK}" = 'ci-checks ci-packs-tests' ] || [ "${TASK}" = 'compilepy3 ci-py3-unit' ] || [ "${TASK}" = 'ci-py3-integration' ]; then sudo .circle/add-itest-user.sh; fi

# Let's enable rabbitmqadmin
# See https://github.com/messagebus/lapine/wiki/Testing-on-Travis.
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ Fixed
values.

Reported by @dswebbthg, @nickbaum. (bug fix) #4513 #4527 #4528
* Fix a bug with action positional parameter serialization used in local and remote script runner
not working correctly with non-ascii (unicode) values.

This would prevent actions such as ``core.sendmail`` which utilize positional parameters from
working correctly when a unicode value was provided.

Reported by @johandahlberg (bug fix) #4533
* Fix ``core.sendmail`` action so it specifies ``charset=UTF-8`` in the ``Content-Type`` email
header. This way it works correctly when an email subject and / or body contains unicode data.

Reported by @johandahlberg (bug fix) #4533 4534

2.10.0 - December 13, 2018
--------------------------
Expand Down
31 changes: 22 additions & 9 deletions contrib/core/actions/send_mail/send_mail
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,27 @@
HOSTNAME=$(hostname -f)
LINE_BREAK=""

SENDMAIL=`which sendmail`
if [ $? -ne 0 ]; then
echo "Unable to find sendmail binary in PATH" >&2
exit 2
FOOTER="This message was generated by StackStorm action `basename $0` running on `hostname`"

# Allow user to provide a custom sendmail binary for more flexibility and easier
# testing
SENDMAIL_BINARY=$1

if [ "${SENDMAIL_BINARY}" = "None" ]; then
# If path to the sendmail binary is not provided, try to find one in $PATH
SENDMAIL=`which sendmail`

if [ $? -ne 0 ]; then
echo "Unable to find sendmail binary in PATH" >&2
exit 2
fi

MAIL="$SENDMAIL -t"
else
MAIL="${SENDMAIL_BINARY}"
fi
shift

MAIL="$SENDMAIL -t"
FOOTER="This message was generated by StackStorm action `basename $0` running on `hostname`"
if [[ $1 =~ '@' ]]; then
FROM=$1
else
Expand Down Expand Up @@ -52,7 +65,7 @@ if [[ -z $trimmed && $SEND_EMPTY_BODY -eq 1 ]] || [[ -n $trimmed ]]; then
cat <<EOF
TO: ${TO}
FROM: ${FROM}
SUBJECT: ${SUBJECT}
SUBJECT: =?UTF-8?B?$(echo ${SUBJECT} | base64)?=
EOF

if [[ -n $ATTACHMENTS ]]; then
Expand Down Expand Up @@ -83,7 +96,7 @@ EOF

cat <<EOF
--${boundary}
Content-Type: ${CONTENT_TYPE}
Content-Type: ${CONTENT_TYPE}; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Expand All @@ -92,7 +105,7 @@ EOF
else

cat <<EOF
Content-Type: ${CONTENT_TYPE}
Content-Type: ${CONTENT_TYPE}; charset=UTF-8

EOF

Expand Down
23 changes: 15 additions & 8 deletions contrib/core/actions/sendmail.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,53 @@
---
name: sendmail
pack: core
description: This sends an email
entry_point: send_mail/send_mail
runner_type: "local-shell-script"
enabled: true
parameters:
sendmail_binary:
description: "Optional path to the sendmail binary. If not provided, it uses a system default one."
position: 0
required: false
type: "string"
default: None
from:
description: Sender email address.
position: 0
position: 1
required: false
type: string
default: "stanley"
to:
description: Recipient email address.
position: 1
position: 2
required: true
type: string
subject:
description: Subject of the email.
position: 2
position: 3
required: true
type: string
send_empty_body:
description: Send a message even if the body is empty.
position: 3
position: 4
required: false
type: boolean
default: True
content_type:
type: string
description: Content type of message to be sent
description: Content type of message to be sent without the charset (charset is set to UTF-8 inside the script).
default: "text/html"
position: 4
position: 5
body:
description: Body of the email.
position: 5
position: 6
required: true
type: string
sudo:
immutable: true
attachments:
description: Array of attachment file paths, comma-delimited.
position: 6
position: 7
required: false
type: "string"
1 change: 1 addition & 0 deletions contrib/core/requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mail-parser>=3.9.1,<4.0
Loading