An SMTP server in Go for testing. Currently in Proof-Of-Concept.
Gost (Go SMTP Test) is meant to facilitate testing automated emails. The end goal a server that will accept connections via HTTP for clients (probably test runners) to register their desire to listen for an email. The server then receives an email via SMTP and notifies the client. The client will then either receive the content of the email via the RabbitMQ message, or initiate an HTTP request for the body of the email.
Testing agents use raw TCP sockets to connect to the Gost server, register pattern matchers, and await matches from the server.
Each message is terminated by the newline character '\n'
.
- Client opens a connection to Gost (default port 60510)
- Server sends
HELLO
- Client selects an appropriate version and sends
OLLEH {"version": 3}
- If the server supports the version, server sends
OKAY
, otherwise sendsUNSUPPORTED
and drops the connection. - Client begins main operative procedure
Client commands:
PING
, server respondsPONG
MATCH {"to": "[email protected]"}
, server respondsMATCHPUT {"match_id": <uuid>}
Server commands:
PING
, client respondsPONG
GOTEMAIL {"match_id": <uuid>, "email": {email...}}
, client respondsOKAY
EXPIRED {"match_id": <uuid>}
, client respondsOKAY
When the client is finished, sends QUIT
and the server
drops the connection.