最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

haskell - How can I tell if an email bounced? - Stack Overflow

programmeradmin6浏览0评论

I'm using the smtp-mail library to send emails from my application with the sendMailWithLogin' function.

I would like to know if the email was successfully delivered or if it bounced. And if it bounced, with what error code? All of the functions return IO () and digging through the code it's a lot of layers of IO (). Is there some way to get this information with this library? Or is there perhaps some other library that can be used?

I'm using the smtp-mail library to send emails from my application with the sendMailWithLogin' function.

I would like to know if the email was successfully delivered or if it bounced. And if it bounced, with what error code? All of the functions return IO () and digging through the code it's a lot of layers of IO (). Is there some way to get this information with this library? Or is there perhaps some other library that can be used?

Share Improve this question asked 5 hours ago The HoffThe Hoff 9741 gold badge12 silver badges24 bronze badges 1
  • "All of the functions return IO ()" really? – cafce25 Commented 4 hours ago
Add a comment  | 

1 Answer 1

Reset to default 3

Unfortunately your software will have to become significantly more complex to support this. If you want to discover a bounce notification, you will at minimum need to be able to receive mail, which is not the purview of SMTP; you will need to make a POP or IMAP client. Also keep in mind that

  1. I'm pretty sure there's no obligation for an SMTP server to notify you of a bounce.
  2. A failed sending is retried, often for several days, before giving up.
  3. There is, as far as I know, no standard mechanism for bounce notification, so you will be solving a somewhat difficult problem. Getting coverage of all the formats used by all the world's email servers likely has a very long tail; perhaps a more modern version of this would be using some AI (e.g. an LLM) or statistical model (e.g. one of the standardish spam filtering techniques, but retooled for detecting bounces instead of spam) to try to actually understand the text inside emails you get back.
发布评论

评论列表(0)

  1. 暂无评论