john

module
v0.0.0-...-0125218 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2025 License: Apache-2.0

README

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 ./...

Directories

Path Synopsis
cmd
john command
internal
cmd
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL