6 attr_reader :source, :source_uri
8 def initialize source_uri
10 @source_uri = source_uri
13 def source_id; @source.id; end
16 raise FatalSourceError.new("Configured sent_source [#{s.uri}] can't store mail. Correct your configuration.") unless s.respond_to? :store_message
22 @source = Recoverable.new SentLoader.new
23 @source_uri = @source.uri
27 def write_sent_message date, from_email, &block
28 @source.store_message date, from_email, &block
30 PollManager.each_message_from(@source) do |m|
31 m.remove_label :unread
32 PollManager.add_new_message m
37 class SentLoader < MBox::Loader
38 yaml_properties :cur_offset
40 def initialize cur_offset=0
41 @filename = Redwood::SENT_FN
42 File.open(@filename, "w") { } unless File.exists? @filename
43 super "mbox://" + @filename, cur_offset, true, true
46 def file_path; @filename end
48 def to_s; 'sup://sent'; end
49 def uri; 'sup://sent' end
52 def labels; [:inbox, :sent]; end