3 Tips bij migratie naar Bird vanuit Postfix, Sendmail of Exim

3 Tips bij migratie naar Bird vanuit Postfix, Sendmail of Exim

3 Tips bij migratie naar Bird vanuit Postfix, Sendmail of Exim

Aug 3, 2018

Gepubliceerd door

Gepubliceerd door

Tom Mairs

Tom Mairs

-

Categorie:

Categorie:

E-mail

E-mail

Ready to see Bird
in action?

Ready to see Bird
in action?

3 Tips When Migrating to Bird from Postfix, Sendmail or Exim

This document outlines common ways our customers use Bird for general integration.  These integrations cover essential topics like “Hoe verstuur ik e-mail?” and “Hoe weet ik wat er met de e-mail is gebeurd?”  If you are transitioning from Postfix, Sendmail, or Exim, this document should explain everything you need to know about the basics of sending and reporting on email.  De rest of this document assumes you have an existing SparkPost account.


Hoe verstuur ik e-mail?

Bird accepteert mail voor overdracht op een aantal manieren. Verreweg de meest voorkomende is SMTP (Simple Mail Transfer Protocol) en Bird presenteert zichzelf precies als elke andere beveiligde e-mailagent op poort 587. Als je momenteel generatie- of samenvoegsoftware hebt die een e-mail maakt om af te leveren, dan zal Bird het accepteren als een standaard SMTP-bericht en proberen het af te leveren. Je hebt een systeem nodig met een geldig TLS-certificaat dat SMTP-berichten kan genereren en versturen via poort 587. Postfix, Sendmail en Exim hebben allemaal deze mogelijkheid.


Voorbeeld 1:

You have a web server that generates a merged message for email delivery through Postfix.
· Adjust the web server’s generation software to send SMTP message to your assigned SparkPost server instead of the Postfix server
· Ja, het is echt zo makkelijk


Voorbeeld 2:

You have some management code that needs to use the local server’s “Mail” function.
· If you are using Sendmail, edit the /etc/mail/sendmail.mc file to add a “smart-host” definition.
IE: define(`SMART_HOST’,`smtp.MyMessageBirdServer.com’)
· If you are using Postfix, edit the /etc/postfix/transport file to add an smtp relay definition.
IE: * smtp:MyMessageBirdServer.com
· Make sure you enable TLS and set your outbound port to 587.
· Apply the changes and restart the local mail services
· Execute the management code as, and the mail will route to MessageBird for delivery


Hoe zit het met REST-injectie?

Voor klanten die HTTP(S) gebruiken om gegevens in hun netwerken te transporteren, kan het omzetten van een bericht naar SMTP omslachtig zijn. Bird heeft een uitgebreide REST API die een JSON sjabloon, lijst van ontvangers en substitutiegegevens via HTTPS kan accepteren en dat vervolgens kan omzetten in gegenereerde (samengevoegde) e-mail die via standaard SMTP naar de wereld kan worden gestuurd. Dit is vooral handig om het genereren van e-mails over te hevelen van webservers naar de mail engine.


Voorbeeld:

Your servers generate a newsletter to 50,000 recipients daily merging personal data then send each individually through Postfix.
· Create JSON objects for the recipients, substitution data, and content template.
· Use the REST API to POST the JSON objects to Bird’s Transmission API. Doing this offloads the generation process to SparkPost for faster delivery.
· You can even put the JSON in a file and use cURL:

curl -v -H "Content-Type: application/json" -X POST \ https://api.bird.com/api/v1transmissies -d@./newsletter.json


Hoe krijg ik informatie over de levering?

Bird verzamelt een overvloed aan leveringsinformatie en maakt die beschikbaar voor jou in JSON-formaat dat kan worden "gepushed" als een webhook of "opgehaald" met een API-oproep. De gegevens voor een levering zien er ongeveer zo uit:


{      "campaign_id":"Welcome_Letter",    "customer_id":"108",    "delv_method":"esmtp",    "event_id":"84769964978165188",    "friendly_from":"bounce@sp-send.com",    "ip_address":"50.116.50.117",    "ip_pool":"default",    "message_id":"00046a82565a6d39451a",    "msg_from":"abc-bounces-108@sp-send..com",    "msg_size":"2164",    "num_retries":"0",    "queue_time":"1759",    "raw_rcpt_to":"fakespark+32@deadboltemail.com",    "rcpt_meta":{      },    "rcpt_tags":[      ],    "rcpt_to":"fakespark+32@deadboltemail.com",    "routing_domain":"deadboltemail.com",    "sending_ip":"52.38.47.118",    "subject":"Welcome Letter Template",    "tdate":"2018-01-10T21:15:24.000Z",    "template_id":"welcome-letter",    "template_version":"5",    "transmission_id":"84769964922735103",    "type":"delivery",    "timestamp":"2018-01-10T14:15:24.000-07:00" }


Dat is waarschijnlijk veel meer data dan je gewend bent om te zien in een Postfix log en het is al in een formaat dat gemakkelijk te gebruiken is. Het is relatief triviaal om die JSON gegevens te converteren naar Postfix log formaat indien nodig. Aflevering, bounce, weigering, spam_klacht, open, klik en vertragingsgegevens kunnen op dezelfde manier gelezen worden.


Voorbeelden:

1) You usually export Postfix logs out to Excel so you can sort and analyze.
A) Execute a message_events API call and run the resulting JSON data through JSON2CSV.


2) You like to convert your Postfix logs to JSON, then pull them into a web service for reading and analysis.
A) Use the MessageBird metrics API to poll SparkPost for the data you need, and it is automatically exported as JSON


3) You have a separate process that tails and parses the logs in real-time and updates a separate recipient database.
A) SparkPost can provide a real-time webhook that can feed your process spam_complaintants and unsubscribes specifically for this purpose. Implementation is trivial.


-Tom

Your new standard in Marketing, Pay & Sales. It's Bird

De right message -> naar de right person -> aan de right time.

By clicking "See Bird" you agree to Bird's Privacyverklaring.

Your new standard in Marketing, Pay & Sales. It's Bird

The right message -> naar de right person -> aan de right time.

By clicking "See Bird" you agree to Bird's Privacyverklaring.