简体   繁体   English

测试邮件列表软件的最佳方法是什么?

[英]What is the best way to test mailing list software?

I recently wrote mailing list software in Ruby On Rails. 我最近在Ruby On Rails中编写了邮件列表软件。 I would like to get some expert advice on the best way to test it. 我想就测试它的最佳方法获得一些专家建议。 For example, it would be cool if I could write a script generate 10,000 email addresses, use the software to send an email to those 10,000 addresses, and then write a script to make sure the emails got through. 例如,如果我可以编写脚本生成10,000个电子邮件地址,使用该软件向这些10,000个地址发送电子邮件,然后编写脚本以确保电子邮件通过,那将会很酷。 I am not sure how easy/possible this is. 我不确定这有多容易/可能。

If you happen to have an email address on a system run with the Postfix MTA, you have an arbitrarily large supply of email addresses at your disposal. 如果您在使用Postfix MTA运行的系统上碰巧有电子邮件地址,则可以随意使用大量电子邮件地址。 For example, my regular email address is nr@cs.tufts.edu, but mail sent to nr+xxx@cs.tufts.edu will get forwarded according to the contents of ~nr/.forward+xxx. 例如,我的常规电子邮件地址是nr@cs.tufts.edu,但发送到nr+xxx@cs.tufts.edu的邮件将根据~nr / .forward + xxx的内容转发。 I used this facility once when I need a collection of 120 distinct email addresses because I was acting as a trusted third party for anonymous communication between a bunch of other people. 当我需要120个不同的电子邮件地址时,我使用过这个工具,因为我作为一个受信任的第三方,在一群其他人之间进行匿名通信。

In the default configuration for Postfix, the manual says 在Postfix的默认配置中,手册说

mail for name+foo is delivered to the alias name+foo or to the alias name, to the destinations listed in ~name/.forward+foo or in ~name/.forward, to the mailbox owned by the user name, or it is sent back as undeliverable. name + foo的邮件被传递到别名+ foo或别名,~name / .forward + foo或~name / .forward中列出的目的地,到用户名所拥有的邮箱,或者因无法送达而被送回。

as long as you own all 10,000 email addresses, you can do it 只要你拥有所有10,000个电子邮件地址,你就可以做到

the simple solution is to set up an email service with a 'catch-all' email address, ie one that receives all incoming email to the same domain where the address does not exist. 简单的解决方案是设置一个带有“全能”电子邮件地址的电子邮件服务,即接收所有传入电子邮件的电子邮件服务到不存在该地址的同一域。 Then you can generate random nonsense for the recipient addresses but all on the same domain, and after they're sent you can collect them all from the catch-all account, strip out the list of intended recipient email addresses, and compare that to the list of generated recipients 然后,您可以为收件人地址生成随机废话,但所有收件人地址都在同一个域中,并且在发送后,您可以从全能帐户中收集所有内容,删除预期收件人电子邮件地址列表,并将其与生成的收件人列表

it would be best if you did this on your own email server/system, though, to avoid getting blacklisted as a spammer! 不过,如果您在自己的电子邮件服务器/系统上执行此操作最好,以避免被列入垃圾邮件发送者列入黑名单!

I suppose your ML manager has a command interface, being either a web one or a mail one (or hopefully both)? 我想你的ML管理器有一个命令界面,可以是网络接口,也可以是邮件接口(或希望两者都有)? You need to test these as well. 您还需要测试这些。 Web UI is a bit more difficult to test but the mail one should be pretty simple. Web UI有点难以测试,但邮件应该非常简单。 If I were to write such a ML manager, I'd probably add a XML-RPC/SOAP webservice to access admin functions. 如果我要编写这样一个ML管理器,我可能会添加一个XML-RPC / SOAP Web服务来访问管理功能。 If your ML manager also support, grouping of mail by domain (all *@aol.com, and so on), it would be good to test this as well. 如果您的ML经理也支持,按域分组邮件(所有*@aol.com等),那么测试它也是一件好事。 In such matters, TDD approach would be nice to follow. 在这些问题上,TDD方法会很好。 Many functions in a MLM can be tested with unit tests. MLM中的许多功能都可以通过单元测试进行测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM