大网数据广告活动
服务器运维问答

Mandrill/Mailchimp API testing from localhost

· 52CE 我爱测

I'm looking for a way to test some email-sending capability when developing an app locally, i.e on http://localhost:[some-port] I'm using Mandrill by Mailchimp with it's official Mandrill API Module on Node.js. Mandrill requires …

问题原文

原帖链接 · nicholaswmin · CC BY-SA 3.0

I'm looking for a way to test some email-sending capability when developing an app locally, i.e on http://localhost:[some-port]

I'm using Mandrill by Mailchimp with it's official Mandrill API Module on Node.js.

Mandrill requires to set some DKIM/SPF settings for the sending domain and I'm not sure how to set my localhost as a Sending Domain.

From their docs:

You'll need to add SPF and DKIM records and verify ownership of your sending domains before you can send email through your account. Mandrill will not send any email from unverified domains or domains without valid SPF and DKIM records, including public domains like gmail.com, yahoo.com, and more.

So basically Mandrill requires setting the Sending Domains and the DKIM/SPF settings for each domain

I've successfully setup my main & live (www.something.com) domain's settings but now I want to also setup localhost so I can test when doing local development

Not setting localhost as a Sending Domain, caused "rejected/unsigned" errors

Of course if I don't set localhost as Sending Domain, any attempts to send a message results in this error:

[ { email: '[email omitted]',
    status: 'rejected',
    _id: 'bdbd8317b1a14986852b93e12a24246e',
    reject_reason: 'unsigned' } ]

Setting localhost as a Sending Domain

Is there an actual way to set localhost as a Sending Domain?


Note: I am already testing with a Test API key

已采纳解答

原帖链接 · blaughw · CC BY-SA 3.0

DKIM/SPF Lookup

You should send emails as a valid domain in Public DNS. This allows DKIM and SPF lookups to function as intended. You can use the same domain as production/live, but you would probably want a subdomain like dev.something.com to be the sending domain. This would require it's own SPF/DKIM DNS entries.

Domain Ownership

Most recipient domains will not accept email from an unauthenticated/unvalidated source. So yes, you need to own a domain. it would be sufficient to get a free domain from EasyDNS, etc. You don't necessarily need a 2nd level domain. You do need the ability to add TXT records and CNAMEs on the zone for public lookup by receiving email servers.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-09-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。