|
| 1 | +# SparkPost RFC 822 |
| 2 | + |
| 3 | +API documentation: https://developers.sparkpost.com/api/transmissions/#transmissions-post-send-rfc822-content |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +Launch the API: |
| 8 | + |
| 9 | +```bash |
| 10 | +docker-compose up http2smtp |
| 11 | +Creating http2smtp_smtp_1 ... done |
| 12 | +Creating http2smtp_http2smtp_1 ... done |
| 13 | +Attaching to http2smtp_http2smtp_1 |
| 14 | +http2smtp_1 | {"level":"info","version":"v0.1.0+dev","time":"2021-01-03T22:32:08Z","message":"app is starting"} |
| 15 | +http2smtp_1 | {"level":"info","version":"v0.1.0+dev","smtp":{"addr":"smtp:1025","id":"go:net/smtp"},"time":"2021-01-03T22:32:08Z","message":"dialing to smtp server"} |
| 16 | +http2smtp_1 | {"level":"info","version":"v0.1.0+dev","time":"2021-01-03T22:32:08Z","message":"listening on http:8080"} |
| 17 | +``` |
| 18 | + |
| 19 | +Send the example request: |
| 20 | + |
| 21 | +```bash |
| 22 | +http POST :8080/sparkpost/api/v1/transmissions traceparent:$(openssl rand -hex 16) < sparkpost_rfc822.json |
| 23 | +``` |
| 24 | + |
| 25 | +Logs: |
| 26 | + |
| 27 | +```bash |
| 28 | +http2smtp_1 | {"level":"info","version":"v0.1.0+dev","smtp":{"addr":"smtp:1025","id":"go:net/smtp"},"trace_id":"304dfb8a7fbcfbdb1db373da9e39354a","time":"2021-01-04T00:24:27Z","message":"sending message"} |
| 29 | +http2smtp_1 | { "level": "debug", "version": "v0.1.0+dev", "smtp":{ "addr": "smtp:1025", "id": "go:net/smtp"}, "trace_id": "304dfb8a7fbcfbdb1db373da9e39354a", "tos":[ "[email protected]"], "time": "2021-01-04T00:24:27Z", "message": "executing transaction"} |
| 30 | +http2smtp_1 | { "level": "debug", "version": "v0.1.0+dev", "smtp":{ "addr": "smtp:1025", "id": "go:net/smtp"}, "trace_id": "304dfb8a7fbcfbdb1db373da9e39354a", "from": "Test <[email protected]>", "time": "2021-01-04T00:24:27Z", "message": "sending MAIL FROM cmd"} |
| 31 | +http2smtp_1 | { "level": "debug", "version": "v0.1.0+dev", "smtp":{ "addr": "smtp:1025", "id": "go:net/smtp"}, "trace_id": "304dfb8a7fbcfbdb1db373da9e39354a", "to": "[email protected]", "time": "2021-01-04T00:24:27Z", "message": "sending RCPT cmd"} |
| 32 | +http2smtp_1 | {"level":"debug","version":"v0.1.0+dev","smtp":{"addr":"smtp:1025","id":"go:net/smtp"},"trace_id":"304dfb8a7fbcfbdb1db373da9e39354a","time":"2021-01-04T00:24:27Z","message":"sending DATA cmd"} |
| 33 | +http2smtp_1 | { "level": "debug", "version": "v0.1.0+dev", "smtp":{ "addr": "smtp:1025", "id": "go:net/smtp"}, "trace_id": "304dfb8a7fbcfbdb1db373da9e39354a", "data": "From: Test <[email protected]>\nTo: Bob <[email protected]>\nSubject: Hello world!\n\nHello world!", "time": "2021-01-04T00:24:27Z", "message": "writing data"} |
| 34 | +http2smtp_1 | { "level": "debug", "version": "v0.1.0+dev", "smtp":{ "addr": "smtp:1025", "id": "go:net/smtp"}, "trace_id": "304dfb8a7fbcfbdb1db373da9e39354a", "tos":[ "[email protected]"], "time": "2021-01-04T00:24:27Z", "message": "transaction executed"} |
| 35 | +http2smtp_1 | {"level":"info","version":"v0.1.0+dev","smtp":{"addr":"smtp:1025","id":"go:net/smtp"},"trace_id":"304dfb8a7fbcfbdb1db373da9e39354a","accepted":1,"time":"2021-01-04T00:24:27Z","message":"message sent"} |
| 36 | +http2smtp_1 | {"level":"info","version":"v0.1.0+dev","trace_id":"304dfb8a7fbcfbdb1db373da9e39354a","verb":"POST","ip":"172.24.0.1","user_agent":"HTTPie/2.3.0","url":"/sparkpost/api/v1/transmissions","code":201,"size":97,"duration":3.273861,"time":"2021-01-04T00:24:27Z","message":"served request"} |
| 37 | +``` |
0 commit comments