mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
Multi-recipient swaks test
- Add a multi-recipient test to run-tests.sh - Removal accidental output of jq binary location when pretty-printing REST JSON - Add To: change to CHANGELOG.md - Fix comment typo
This commit is contained in:
@@ -7,6 +7,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
[Unreleased]
|
||||
------------
|
||||
|
||||
### Added
|
||||
- Storage of To: header in messages (likely breaks existing datastores)
|
||||
|
||||
### Fixed
|
||||
- We should no longer run out of file handles when dealing with a large number
|
||||
of recipients on a single message.
|
||||
|
||||
@@ -103,7 +103,7 @@ main() {
|
||||
esac
|
||||
|
||||
# Use jq to pretty-print if installed and we are expecting JSON output
|
||||
if [ $pretty ] && [ $is_json ] && type -P jq; then
|
||||
if [ $pretty ] && [ $is_json ] && type -P jq >/dev/null; then
|
||||
curl -s $curl_opts -H "Accept: application/json" --noproxy "$API_HOST" -X "$method" "$url" | jq .
|
||||
else
|
||||
curl -s $curl_opts -H "Accept: application/json" --noproxy "$API_HOST" -X "$method" "$url"
|
||||
|
||||
@@ -344,13 +344,11 @@ func (m *FileMessage) From() string {
|
||||
return m.Ffrom
|
||||
}
|
||||
|
||||
|
||||
// From returns the value of the Message From header
|
||||
// From returns the value of the Message To header
|
||||
func (m *FileMessage) To() string {
|
||||
return m.Fto
|
||||
}
|
||||
|
||||
|
||||
// Subject returns the value of the Message Subject header
|
||||
func (m *FileMessage) Subject() string {
|
||||
return m.Fsubject
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# description: Generate test emails for Inbucket
|
||||
|
||||
set -eo pipefail
|
||||
[ $TRACE ] && set -x
|
||||
|
||||
# We need to be in swaks-tests directory
|
||||
cmdpath="$(dirname "$0")"
|
||||
@@ -19,6 +20,7 @@ case "$1" in
|
||||
;;
|
||||
*)
|
||||
to="$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -28,6 +30,10 @@ export SWAKS_OPT_to="$to@inbucket.local"
|
||||
# Basic test
|
||||
swaks $* --h-Subject: "Swaks Plain Text" --body text.txt
|
||||
|
||||
# Multi-recipient test
|
||||
swaks $* --to="$to@inbucket.local,alternate@inbucket.local" --h-Subject: "Swaks Multi-Recipient" \
|
||||
--body text.txt
|
||||
|
||||
# HTML test
|
||||
swaks $* --h-Subject: "Swaks HTML" --data mime-html.raw
|
||||
|
||||
@@ -35,7 +41,8 @@ swaks $* --h-Subject: "Swaks HTML" --data mime-html.raw
|
||||
swaks $* --h-Subject: "Swaks Top Level HTML" --data nonmime-html.raw
|
||||
|
||||
# Attachment test
|
||||
swaks $* --h-Subject: "Swaks Attachment" --attach-type image/png --attach favicon.png --body text.txt
|
||||
swaks $* --h-Subject: "Swaks Attachment" --attach-type image/png --attach favicon.png \
|
||||
--body text.txt
|
||||
|
||||
# Encoded subject line test
|
||||
swaks $* --data utf8-subject.raw
|
||||
|
||||
Reference in New Issue
Block a user