从 Postfix、Sendmail 或 Exim 迁移到Bird 的 3 个技巧

从 Postfix、Sendmail 或 Exim 迁移到Bird 的 3 个技巧

从 Postfix、Sendmail 或 Exim 迁移到Bird 的 3 个技巧

Aug 3, 2018

出版商

出版商

汤姆-梅尔斯

汤姆-梅尔斯

-

类别

类别

电子邮件

电子邮件

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 “如何发送电子邮件?” and “我怎么知道电子邮件发生了什么事?”  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.  ǞǞǞ rest of this document assumes you have an existing SparkPost account.


如何发送电子邮件?

Bird 将通过几种方式接受邮件传输。到目前为止,最常见的是 SMTP(简单邮件传输协议),而Bird 与其他安全电子邮件代理一样,都是通过 587 端口发送的。如果您目前有生成或邮件合并软件来创建电子邮件以进行发送,Bird 将把它作为标准 SMTP 邮件接受并尝试发送。您需要一个具有有效 TLS 证书的系统,它可以生成 SMTP 邮件并通过 587 端口发送。Postfix、Sendmail 和 Exim 本身都具备这种功能。


示例 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
· 是的,就是这么简单


例 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


那么 REST 注入呢?

对于使用 HTTP(S) 在其网络中传输数据的客户来说,将邮件转换为 SMTP 可能很麻烦。Bird 有一个全面的 REST API,可以通过 HTTPS 接收 JSON 模板、收件人列表和替换数据,然后将其转换为生成(合并)的电子邮件,通过标准 SMTP 发送到世界各地。这对于将生成工作从网络服务器卸载到邮件引擎特别有帮助。


例子。

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


如何获取送货信息?

Bird 收集大量的交付信息,并以 JSON 格式提供给您,您可以通过网络钩子 "推送 "或通过 API 调用 "提取 "这些信息。快递的数据如下所示:


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


这可能比您习惯在 Postfix 日志中看到的数据要多得多,而且这些数据已经采用了易于使用的格式。如果需要,将 JSON 数据转换为 Postfix 日志格式也相对简单。投递、退件、拒收、垃圾邮件投诉、打开、点击和延迟数据都可以用同样的方式读取。


例如

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.


-汤姆

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

ǞǞǞ right message ->right person ->right time.

By clicking "See Bird" you agree to Bird's 隐私声明.

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

The right message ->right person ->right time.

By clicking "See Bird" you agree to Bird's 隐私声明.