是否可以指定多个电子邮件地址来接收退回邮件?
我们使用 JavaMail API 从我们的应用程序发送电子邮件。要处理退回邮件(未送达报告), 我们使用以下代码将退回邮件重定向到不同的电子邮件地址:
properties.put("mail.smtp.from", "[email protected]");
在我们的例子中,我们希望将退回邮件重定向到多个电子邮件地址。事实上,我们甚至尝试了一些其他选项,例如提供用逗号分隔的地址列表等,但它们都不起作用。
我的问题是,是否可以将退回邮件重定向到多个电子邮件地址?即使在谷歌搜索后我也无法找到正确的答案/解决方案。
任何替代/解决方案也将受到赞赏。
We're using JavaMail API to send emails from our application. To handle bounce back messages (Non delivery report),
we're redirecting bounce backs to a different email address using the following code:
properties.put("mail.smtp.from", "[email protected]");
In our case, we want bounce backs to be redirected to multiple email addresses. In fact, we even tried few other options like providing a list of addresses separated by commas, etc., but none of them are working.
My question here is, is it possible to redirect bounce backs to multiple email addresses? I'm not able to find the right answer/solution even after googling.
Any alternative/workaround solution are also appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于根据定义/RFC,SMTP 协议只允许“MAIL FROM:”阶段中的一个地址(即退回邮件地址),因此将退回邮件发送到多个收件人的唯一方法是从单个退回邮件地址到多个目标地址的转发器。
但是,所有退回邮件都来自空发件人,因此如果转发因任何原因失败,您将不会收到任何通知,这将创建“双重退回邮件”,并且邮件将被删除。
因此,我建议将退回邮件存储在 imap 文件夹中,并为所有需要的人员或应用程序提供访问权限(例如,轮询退回邮件而不是转发)(如果这在您的环境中可行)。
Since by definition/RFC the SMTP protocol allows only one address in "MAIL FROM:" Stage (which is the bounce address), the only way of having bounces sent to multiple recipients would be a forwarder from a single bounce address to multiple target adresses.
however, all bounces by would come from the null sender, so you wouln't get any notification if that forwarding fails for any reaseon, it would create a "double-bounce", and the messages would be deleted.
Therefore, I recommend storing the bounces in an imap folder and give all required people or applications access to that (eg. polling the bounces instead of forwarding), if that is feasible in your environment.
Apache Commons Email 允许退回。但不幸的是它需要单个字符串并且不允许收集 InternetAddress。
HtmlEmail 电子邮件 = new HtmlEmail();
email.setBounceAddress("[电子邮件受保护]");
希望这有帮助
Apache Commons Email allows bounce off. But unfortunately it takes single String and does not allow Collection of InternetAddress.
HtmlEmail email = new HtmlEmail();
email.setBounceAddress("[email protected]");
Hope this helps