aws-ses-sender icon indicating copy to clipboard operation
aws-ses-sender copied to clipboard

A few issues to fix

Open ambanmba opened this issue 3 years ago • 1 comments

I was unable to get the script to work as-is and needed to make the following changes on macOS Big Sur:

Line 50: ATTACHMENT=base64 -i $ATTACHMENT needs to change to: ATTACHMENT=base64 -e $ATTACHMENT (note the replacement of the -i with -e ... it also works if you omit -e completely)

Line 65: add another line: sed -i -e "s/$(printf '\r')//g" $TMPFILE (the script as written adds extra CR characters which make the JSON illegal). This removes those extra CRs.

Line 66: aws ses send-raw-email --raw-message file://$TMPFILE needs to change to: aws ses send-raw-email --cli-binary-format raw-in-base64-out --raw-message file://$TMPFILE

Even after fixing these issues, this script still won't work with large attachments because sed simply can't deal with them. Refer: https://unix.stackexchange.com/questions/546906/sed-command-giving-argument-list-too-long-error

ambanmba avatar Aug 10 '21 01:08 ambanmba

Made the changes and also fixed the problem with large attachments here: https://github.com/ambanmba/aws-ses-sender

ambanmba avatar Aug 10 '21 12:08 ambanmba