おぉ。これを使えば、メーリングリストのアーカイブをスレッド表示とか簡単にできるなあ。 とりあえず、Message-ID: と In-reply-To: あたりから parent_id を割り出しておいて、 roots なレコードから再帰的に children をたどれば OK。
app/views/.../thread.rhtml:
<%= render :partial => "thread", :locals => {:articles => @articles}>
app/views/.../_thread.rhtml:
<% unless articles.empty? -%>
<ul>
<% articles.each do |article| -%>
<li><%=h article.subject %></li>
<render :partial => "thread", :locals => {:articles => article.children} %>
<% end -%>
</ul>
<% end -%>
それっぽく表示されてます。なんとなく DRY じゃないけど。
こういうのには対応してないのかな。
#<TMail::ContentDispositionHeader "attachment;\n filename*=iso-2022-jp''%1B%24B%24%5B%242%24%5B%242%1B%28B%2Epng">
filename*= の * がなければ、とりあえずエラーにはならないけど。
[追記]: あぅ。$KCODE が "EUC" か "SJIS" でないとダメ、か。"UTF8" でやってた orz。
--- tmail/textutils.rb~
+++ tmail/textutils.rb
@@ -178,6 +178,9 @@ module TMail
'EUC' => '-e -m',
'SJIS' => '-s -m'
}
+ if defined? NKF::UTF8
+ NKF_FLAGS.store('UTF8', '-w -m')
+ end
def to_kcode(str)
flag = NKF_FLAGS[$KCODE] or return str