Allow downloading emails.

This commit is contained in:
Samuel Cochran 2011-05-27 21:40:16 +08:00
parent 3e954599ff
commit ca89f36ab6
1 changed files with 10 additions and 0 deletions

View File

@ -89,6 +89,16 @@ module MailCatcher
end
end
get "/messages/:id.eml" do
id = params[:id].to_i
if message = MailCatcher::Mail.message(id)
content_type "message/rfc822"
message["source"]
else
not_found
end
end
get "/messages/:id/:cid" do
id = params[:id].to_i
if part = MailCatcher::Mail.message_part_cid(id, params[:cid])