10 self.class.i_am_the_instance self
13 def self.source_name; "sup://sent"; end
14 def self.source_id; 9998; end
15 def new_source; @source = Recoverable.new SentLoader.new; end
17 def write_sent_message date, from_email
18 need_blank = File.exists?(@fn) && !File.zero?(@fn)
19 File.open(@fn, "a") do |f|
21 f.puts "From #{from_email} #{date}"
25 PollManager.add_messages_from(@source) do |m, o, e|
26 m.remove_label :unread
32 class SentLoader < MBox::Loader
33 yaml_properties :cur_offset
35 def initialize cur_offset=0
36 @filename = Redwood::SENT_FN
37 File.open(@filename, "w") { } unless File.exists? @filename
38 super "mbox://" + @filename, cur_offset, true, true
41 def file_path; @filename end
43 def uri; SentManager.source_name; end
44 def to_s; SentManager.source_name; end
45 def id; SentManager.source_id; end
46 def labels; [:sent, :inbox]; end