Sha256: 0e83055d68e53510b34cda9e3b8e47d3b3352e60d7111fd57737ef2296d2d2fb
Contents?: true
Size: 1.21 KB
Versions: 4
Compression:
Stored size: 1.21 KB
Contents
module Redwood class SentManager include Redwood::Singleton attr_reader :source, :source_uri def initialize source_uri @source = nil @source_uri = source_uri end def source_id; @source.id; end def source= s raise FatalSourceError.new("Configured sent_source [#{s.uri}] can't store mail. Correct your configuration.") unless s.respond_to? :store_message @source_uri = s.uri @source = s end def default_source @source = SentLoader.new @source_uri = @source.uri @source end def write_sent_message date, from_email, &block ::Thread.new do debug "store the sent message (locking sent source..)" @source.synchronize do @source.store_message date, from_email, &block end PollManager.poll_from @source end end end class SentLoader < MBox yaml_properties def initialize @filename = Redwood::SENT_FN File.open(@filename, "w") { } unless File.exists? @filename super "mbox://" + @filename, true, $config[:archive_sent] end def file_path; @filename end def to_s; 'sup://sent'; end def uri; 'sup://sent' end def id; 9998; end def labels; [:inbox, :sent]; end def default_labels; []; end def read?; true; end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
sup-0.20.0 | lib/sup/sent.rb |
sup-0.19.0 | lib/sup/sent.rb |
sup-0.18.0 | lib/sup/sent.rb |
sup-0.17.0 | lib/sup/sent.rb |