Ruby net::imap 向电子邮件添加颜色类别

Ruby net::imap adding color categorys to emails

我每天都在使用 net::imap 阅读大量电子邮件 https://ruby-doc.org/stdlib-2.5.1/libdoc/net/imap/rdoc/Net/IMAP.html

我似乎找不到向邮件添加彩色类别的方法。

例如

imap.search(["ON","26-APR-2021"]).each do |message_id|
# my code...
# at the end of the code
  message_id.AddCatagory(blue)...
end

方法名称在ruby 中应该是add_category。但这不存在,因为颜色不是 IMAP 中的概念。标志确实存在,而且我知道一些客户使用颜色来表示标志...因此您可能正在寻找的代码类似于

imap.uid_store(uids, "+flags", [:Blue])

当然,你必须定义蓝色。或重要的,标记的或其他东西。 Flagged 被许多客户端用于模糊重要的消息。