3 consejos para migrar de Postfix, Sendmail o Exim a Bird

3 consejos para migrar de Postfix, Sendmail o Exim a Bird

3 consejos para migrar de Postfix, Sendmail o Exim a Bird

Aug 3, 2018

Publicado por

Publicado por

Tom Mairs

Tom Mairs

-

Categoría:

Categoría:

Email

Email

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 “¿Cómo envío un correo electrónico?” and “¿cómo puedo saber qué ha pasado con el correo electrónico?”  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.  En rest of this document assumes you have an existing SparkPost account.


¿Cómo se envía un correo electrónico?

Bird aceptará correo para su transferencia de un par de maneras. Con mucho, la más común es SMTP (Simple Mail Transfer Protocol) y Bird se presenta precisamente como cualquier otro agente de correo electrónico seguro en el puerto 587. Si actualmente dispone de un software de generación o combinación de correspondencia que crea un correo electrónico para su entrega, Bird lo aceptará como un mensaje SMTP estándar e intentará entregarlo. Necesitará un sistema que con un certificado TLS válido que pueda generar mensajes SMTP y enviarlos por el puerto 587. Postfix, Sendmail y Exim tienen esta capacidad de forma nativa.


Ejemplo 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
· Sí, es así de fácil


Ejemplo 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


¿Y la inyección REST?

Para los clientes que utilizan HTTP(S) para transportar datos en sus redes, convertir un mensaje a SMTP puede resultar engorroso. Bird dispone de una completa API REST que puede aceptar una plantilla JSON, una lista de destinatarios y datos de sustitución a través de HTTPS y, a continuación, convertirlo en correo electrónico generado (fusionado) para enviarlo al mundo a través de SMTP estándar. Esto es particularmente útil para descargar el trabajo de generación de los servidores web al motor de correo.


Ejemplo:

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/v1transmissions -d@./newsletter.json


¿Cómo puedo obtener información sobre la entrega?

Bird recopila grandes cantidades de información sobre las entregas y la pone a su disposición en formato JSON que se puede "enviar" como un webhook o "extraer" con una llamada a la API. Los datos de una entrega tienen este aspecto:


{      "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" }


Eso es probablemente muchos más datos de los que está acostumbrado a ver en un registro Postfix y ya está en un formato que es fácilmente consumible. Es relativamente trivial convertir esos datos JSON al formato de registro Postfix si es necesario. Los datos de entrega, rebote, rechazo, spam_complaint, apertura, clic y retraso pueden ser leídos de la misma manera.


Ejemplos:

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

En right message -> a la right person -> en el right time.

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

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

The right message -> a la right person -> en el right time.

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