1 require "sup/mbox/loader"
2 require "sup/mbox/ssh-file"
3 require "sup/mbox/ssh-loader"
7 ## some utility functions
15 ## i do it in this weird way because i am trying to speed things up
16 ## when scanning over large mbox files.
19 when /^(From):\s+(.*)$/i,
23 /^(Subject):\s+(.*)$/i,
25 /^(Message-Id):\s+<(.*)>$/i,
26 /^(References):\s+(.*)$/i,
27 /^(In-Reply-To):\s+(.*)$/i,
28 /^(Reply-To):\s+(.*)$/i,
29 /^(List-Post):\s+(.*)$/i,
30 /^(Status):\s+(.*)$/i: header[last = $1] = $2
32 ## these next three can occur multiple times, and we want the
34 when /^(Delivered-To):\s+(.*)$/i,
35 /^(X-Original-To):\s+(.*)$/i,
36 /^(Envelope-To):\s+(.*)$/i: header[last = $1.downcase] ||= $2
41 header[last] += " " + line.chomp.gsub(/^\s+/, "") if last
50 break if l =~ BREAK_RE
56 module_function :read_header, :read_body