## these next three can occur multiple times, and we want the
## first one
- when /^(Delivered-To):\s+(.*)$/i,
- /^(X-Original-To):\s+(.*)$/i,
- /^(Envelope-To):\s+(.*)$/i: header[last = $1] ||= $2
+ when /^(Delivered-To):\s*(.*)$/i,
+ /^(X-Original-To):\s*(.*)$/i,
+ /^(Envelope-To):\s*(.*)$/i: header[last = $1] ||= $2
- when /^$/: break
- when /^\S+: /: last = nil # some other header we don't care about
+ when /^\r*$/: break
+ when /^\S+:/: last = nil # some other header we don't care about
else
header[last] += " " + line.chomp.gsub(/^\s+/, "") if last
end