migrate mailr 2.2.2 to 2.3.2
This commit is contained in:
parent
56039cc595
commit
ae789b1d84
23 changed files with 5 additions and 48 deletions
38
lib/webmail/imap_message.rb
Normal file
38
lib/webmail/imap_message.rb
Normal file
|
@ -0,0 +1,38 @@
|
|||
require 'mail2screen'
|
||||
class ImapMessage < ActiveRecord::Base
|
||||
include Mail2Screen
|
||||
|
||||
def set_folder(folder)
|
||||
@folder = folder
|
||||
end
|
||||
|
||||
def full_body
|
||||
@folder.mailbox.imap.uid_fetch(uid, "BODY[]").first.attr["BODY[]"]
|
||||
end
|
||||
|
||||
def from_addr=(fa)
|
||||
self.from = fa.to_yaml
|
||||
self.from_flat = short_address(fa)
|
||||
end
|
||||
|
||||
def from_addr
|
||||
begin
|
||||
YAML::load(from)
|
||||
rescue Object
|
||||
from
|
||||
end
|
||||
end
|
||||
|
||||
def to_addr=(ta)
|
||||
self.to = ta.to_yaml
|
||||
self.to_flat = short_address(ta)
|
||||
end
|
||||
|
||||
def to_addr
|
||||
begin
|
||||
YAML::load(to)
|
||||
rescue Object
|
||||
to
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue