John - mailets for Go
This is a simple SMTP Server that can have a chain of mail processors inserted, this is not a production tool, and was written for teaching purposes.
Running John
$ go build ./cmd/john
$ ./john smtp --init-maildir
Mail will be delivered to ./tmp in Maildir format.
Can't use SMTP?
It might be simpler to use HTTP to send emails.
$ ./john http --init-maildir
This defaults to serving on :8080
You can send emails via curl
#!/bin/sh
curl -d "Testing" \
-H "John-Envelope-From: [email protected]" \
-H "John-Envelope-To: [email protected]" \
-H "John-Mail-From: [email protected]" \
-H "John-Mail-To: [email protected]" \
-H "John-Mail-Test-Header: this is a test" \
http://localhost:8080/
Again mail will be delivered to ./tmp in Maildir format.
Testing mail delivery
$ echo "This is the message body and contains the message" | mailx -v -r \
"[email protected]" -s "This is the subject" -S smtp="localhost:2525" \
[email protected]
Running the tests
$ go test ./...