Rails 6 + ActionMailbox (mail.decoded) 失败,带有表情符号任何其他意外输入

问题描述

我正在尝试从电子邮件获取纯文本(无 HTML)。

当我发送带有纯文本的电子邮件(例如“嘿,这很好用”)时它会起作用

当我在电子邮件正文中包含表情符号时它不起作用,它在日志中给出以下错误

ActionMailBox::RoutingJob (Job ID: c9ca878b-) from Async(default) in 32.86ms: 
NoMethodError (Can not decode an entire message,try calling #decoded on the varIoUs fields and body or parts if it is a multipart message.):

我的代码很简单:

我正在使用 ma​​il.decoded 是否有任何其他功能可以与解码一起使用以去除任何不需要的字符

def process
        category.posts.create(user: user,cat_id: @cat.id,body: mail.decoded)
      end

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)