class Loader < Source
yaml_properties :uri, :cur_offset, :usual, :archived, :id, :labels
+ attr_accessor :labels
## uri_or_fp is horrific. need to refactor.
def initialize uri_or_fp, start_offset=nil, usual=true, archived=false, id=nil, labels=[]
if File.dirname(path) =~ /\b(var|usr|spool)\b/
[]
else
- [File.basename(path).intern]
+ [File.basename(path).downcase.intern]
end
end
begin
RMail::Mailbox::MBoxReader.new(@f).each_message do |input|
m = RMail::Parser.read(input)
- if m.body
+ if m.body && m.body.is_a?(String)
m.body.gsub!(/^>From /, "From ")
end
return m
end
self.cur_offset = next_offset
- [returned_offset, (@labels + [:unread]).uniq]
+ [returned_offset, (self.labels + [:unread]).uniq]
end
end