tmail/sample/parse-test.rb

#!/usr/local/bin/ruby
#
# parser test
#

require 'tmail/tmail'

puts "testing parser --------------------------------"
puts

TMail::Mail.loadfrom( 'm/normal' ).each_header do |key, field|
  if field.respond_to? :parse, true then
    field.instance_eval do
      parse
      @written = true
    end
  end
  printf "%s ok\n", field.name
  # puts field.decoded
end