ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
PowerMTA Integration
Experiences and Solutions
Postmastery and PowerMTA
PowerMTA as building block
SMTP SMTP
con?guration
accounting
Integration challenges
Email submission
¡ñ SMTP
¡ð Clients: JavaMail, PHPMailer, MailKit
¡ñ Submission API
¡ð Library: Perl, Java, C++
¡ñ Pickup folder
¡ð Local application
¡ñ Transmission API (interim)
¡ð HTTP, JSON
¡ð Prebuilt message
Mailmerge support
From: "Customer Service" [*from]
To: "[FName]" [*to]
Date: [*date]
Subject: Travel Plans
Dear [FName],
You are flying out of [Airport] given that it is
closest to your location
in [City], [State].
Email generator ?ow
merging encoding submission
RFC5322text+html
github.com/postmastery/pmtaemailapi
{
"from": {"name": "J¨¦r?me", "address": "jerome@postmastery.net"},
"to": {"name": "Maarten", "address": "maarten@postmastery.net"},
"subject": "Pay for lunch",
"text": "Hi Maarten, can you pay me €50 for lunch.",
"html": "..."
}
x-sender: jerome@postmastery.net
x-receiver: maarten@postmastery.net
Date: Wed, 11 Sep 2019 12:51:40 +0200
From: =?utf-8?q?J=C3=A9r=C3=B4me?= <jerome@postmastery.net>
To: "Maarten" <maarten@postmastery.net>
Subject: Pay for lunch
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="e0508c573add4451552906243fc9673f43978e67fc3d8b0d44c7bdb693ff"
--e0508c573add4451552906243fc9673f43978e67fc3d8b0d44c7bdb693ff
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8
Hi Maarten, can you pay me =E2=82=AC50 for lunch.
--e0508c573add4451552906243fc9673f43978e67fc3d8b0d44c7bdb693ff
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=utf-8
...
--e0508c573add4451552906243fc9673f43978e67fc3d8b0d44c7bdb693ff--
JSON over HTTP
Inbound email processing
¡ñ Bounce processor
¡ñ Feedback loop processor
¡ñ Delivery to ?le
¡ñ Pipe to process
List-Unsubscribe with mailto
relay-domain unsubscribe.example.com
<domain unsubscribe.example.com>
type pipe
command "/opt/pmta/unsubmail -from=$from -to=$to -pat=(d+)_(d+)_(d+)_([a-f0-9]+)
-url=https://www.example.com/unsubscribe?q=$$1&c=$$3&b=$$2&hash=$$4"
</domain>
List-Unsubscribe: <mailto:229_3430_2346761_618e1a4097f3cf26a8b23f89b9848e5@unsubscribe.example.com>,
<https://www.example.com/unsubscribe?q=229&c=2346761&b=3430&hash=618e1a4097f3cf26a8b23f89b9848e5>
Processing accounting data
¡ñ Log ¡°tailing¡±
¡ð Logstash, Beats, Fluentd, NXLog
¡ð Integrations: Splunk, Elastic, Kafka
¡ñ Pickup folder
¡ð <acct-?le>.move-to, <acct-?le>.move-interval
¡ð Integrations: Interspire
¡ñ Pipe to process
¡ð <acct-?le |/path/to/executable>
¡ð Integrations: Ongage, Mailwizz, Redis
Accounting pipes
delivery
OS pipe
accounting
bounded buffersynchronisation
Accounting webhook
<acct-file |/opt/pmta/pmtawebhook -url=...>
records b, rb
record-fields b timeLogged,rcpt,dsnAction,dsnStatus,dsnDiag,bounceCat
record-fields rb timeLogged,rcpt,dsnAction,dsnStatus,dsnDiag,bounceCat
</acct-file>
[{"type":"b", "timeLogged":"1382377561", "rcpt": "nobody@outlook.com", "dsnAction":"failed",
"dsnStatus":"5.0.0 (undefined status)", "dsnDiag":"smtp;550 Requested action not taken: mailbox
unavailable", "bounceCat":"bad-mailbox"},...]
JSON over HTTPS
PowerMTA 5.X?
Email API SMTP
Con?guration API
Event webhooks
15
Dank Je
Thank You

More Related Content

PowerMTA Integration Experiences and Solutions

  • 3. PowerMTA as building block SMTP SMTP con?guration accounting
  • 5. Email submission ¡ñ SMTP ¡ð Clients: JavaMail, PHPMailer, MailKit ¡ñ Submission API ¡ð Library: Perl, Java, C++ ¡ñ Pickup folder ¡ð Local application ¡ñ Transmission API (interim) ¡ð HTTP, JSON ¡ð Prebuilt message
  • 6. Mailmerge support From: "Customer Service" [*from] To: "[FName]" [*to] Date: [*date] Subject: Travel Plans Dear [FName], You are flying out of [Airport] given that it is closest to your location in [City], [State].
  • 7. Email generator ?ow merging encoding submission RFC5322text+html
  • 8. github.com/postmastery/pmtaemailapi { "from": {"name": "J¨¦r?me", "address": "jerome@postmastery.net"}, "to": {"name": "Maarten", "address": "maarten@postmastery.net"}, "subject": "Pay for lunch", "text": "Hi Maarten, can you pay me €50 for lunch.", "html": "..." } x-sender: jerome@postmastery.net x-receiver: maarten@postmastery.net Date: Wed, 11 Sep 2019 12:51:40 +0200 From: =?utf-8?q?J=C3=A9r=C3=B4me?= <jerome@postmastery.net> To: "Maarten" <maarten@postmastery.net> Subject: Pay for lunch MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="e0508c573add4451552906243fc9673f43978e67fc3d8b0d44c7bdb693ff" --e0508c573add4451552906243fc9673f43978e67fc3d8b0d44c7bdb693ff Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Maarten, can you pay me =E2=82=AC50 for lunch. --e0508c573add4451552906243fc9673f43978e67fc3d8b0d44c7bdb693ff Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 ... --e0508c573add4451552906243fc9673f43978e67fc3d8b0d44c7bdb693ff-- JSON over HTTP
  • 9. Inbound email processing ¡ñ Bounce processor ¡ñ Feedback loop processor ¡ñ Delivery to ?le ¡ñ Pipe to process
  • 10. List-Unsubscribe with mailto relay-domain unsubscribe.example.com <domain unsubscribe.example.com> type pipe command "/opt/pmta/unsubmail -from=$from -to=$to -pat=(d+)_(d+)_(d+)_([a-f0-9]+) -url=https://www.example.com/unsubscribe?q=$$1&c=$$3&b=$$2&hash=$$4" </domain> List-Unsubscribe: <mailto:229_3430_2346761_618e1a4097f3cf26a8b23f89b9848e5@unsubscribe.example.com>, <https://www.example.com/unsubscribe?q=229&c=2346761&b=3430&hash=618e1a4097f3cf26a8b23f89b9848e5>
  • 11. Processing accounting data ¡ñ Log ¡°tailing¡± ¡ð Logstash, Beats, Fluentd, NXLog ¡ð Integrations: Splunk, Elastic, Kafka ¡ñ Pickup folder ¡ð <acct-?le>.move-to, <acct-?le>.move-interval ¡ð Integrations: Interspire ¡ñ Pipe to process ¡ð <acct-?le |/path/to/executable> ¡ð Integrations: Ongage, Mailwizz, Redis
  • 13. Accounting webhook <acct-file |/opt/pmta/pmtawebhook -url=...> records b, rb record-fields b timeLogged,rcpt,dsnAction,dsnStatus,dsnDiag,bounceCat record-fields rb timeLogged,rcpt,dsnAction,dsnStatus,dsnDiag,bounceCat </acct-file> [{"type":"b", "timeLogged":"1382377561", "rcpt": "nobody@outlook.com", "dsnAction":"failed", "dsnStatus":"5.0.0 (undefined status)", "dsnDiag":"smtp;550 Requested action not taken: mailbox unavailable", "bounceCat":"bad-mailbox"},...] JSON over HTTPS
  • 14. PowerMTA 5.X? Email API SMTP Con?guration API Event webhooks