mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 10:07:02 +00:00
Swaks updates
This commit is contained in:
30
swaks-tests/README.md
Normal file
30
swaks-tests/README.md
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
swaks-tests
|
||||||
|
===========
|
||||||
|
|
||||||
|
[Swaks](http://www.jetmore.org/john/code/swaks/) - Swiss Army Knife for SMTP
|
||||||
|
|
||||||
|
Swaks gives us an easy way to generate mail to send into Inbucket. You will need to
|
||||||
|
install Swaks before you can use the provided scripts.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
To deliver a batch of test email to the `swaks` mailbox, assuming Inbucket SMTP is listening
|
||||||
|
on localhost:2500:
|
||||||
|
|
||||||
|
./run-tests.sh
|
||||||
|
|
||||||
|
To deliver a batch of test email to the `james` mailbox:
|
||||||
|
|
||||||
|
./run-tests.sh james
|
||||||
|
|
||||||
|
You may also pass swaks options to deliver to a alternate host/port:
|
||||||
|
|
||||||
|
./run-tests --server inbucket.mydomain.com:25
|
||||||
|
|
||||||
|
To specify the mailbox with an alternate server, use `--to` with a local and host part:
|
||||||
|
|
||||||
|
./run-tests --server inbucket.mydomain.com:25 --to james@mydomain.com
|
||||||
|
|
||||||
|
## To Do
|
||||||
|
|
||||||
|
Replace Swaks with a native Go solution.
|
||||||
@@ -1,8 +1,23 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# run-tests.sh: Generate test emails for Inbucket
|
# run-tests.sh
|
||||||
|
# description: Generate test emails for Inbucket
|
||||||
|
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
"")
|
||||||
|
to="swaks"
|
||||||
|
;;
|
||||||
|
--*)
|
||||||
|
to="swaks"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
to="$1"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
export SWAKS_OPT_server="127.0.0.1:2500"
|
export SWAKS_OPT_server="127.0.0.1:2500"
|
||||||
export SWAKS_OPT_to="swaks@inbucket.local"
|
export SWAKS_OPT_to="$to@inbucket.local"
|
||||||
|
|
||||||
# Basic test
|
# Basic test
|
||||||
swaks $* --h-Subject: "Swaks Plain Text" --body text.txt
|
swaks $* --h-Subject: "Swaks Plain Text" --body text.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user