diff --git a/Rakefile b/Rakefile index cd843cd..034caf4 100644 --- a/Rakefile +++ b/Rakefile @@ -7,9 +7,9 @@ begin # First, we use a few ruby things... require 'rubygems' - require 'rake/gempackagetask' + require 'rubygems/package_task' end -require 'rake/rdoctask' +require 'rdoc/task' require 'rake/testtask' require 'shellwords' @@ -171,7 +171,7 @@ if defined?(Gem) # # Use our Gem::Specification to make some package tasks. # - Rake::GemPackageTask.new(spec) do |pkg| + Gem::PackageTask.new(spec) do |pkg| pkg.need_zip = true pkg.need_tar = true end diff --git a/lib/rmail/address.rb b/lib/rmail/address.rb index 8265823..c1e932b 100644 --- a/lib/rmail/address.rb +++ b/lib/rmail/address.rb @@ -703,7 +703,7 @@ def get_tokenize @sym = SYM_DOMAIN_LITERAL @lexeme = $1.gsub(/(^|[^\\])[\r\n\t ]+/, '\1').gsub(/\\(.)/, '\1') break - when /\A[\200-\377\w!$%&\'*+\/=?^_\`{\}|~#-]+/nm + when /\A[[:ascii:]\w!$%&\'*+\/=?^_\`{\}|~#-]+/m # This is just like SYM_ATOM, but includes all characters # with high bits. This is so we can allow such tokens in # the display name portion of an address even though it diff --git a/lib/rmail/header.rb b/lib/rmail/header.rb index ca4d0b6..ffd8392 100644 --- a/lib/rmail/header.rb +++ b/lib/rmail/header.rb @@ -73,11 +73,20 @@ class Header class Field # :nodoc: # fixme, document methadology for this (RFC2822) - EXTRACT_FIELD_NAME_RE = /\A([^\x00-\x1f\x7f-\xff :]+):\s*/no + + # ASCII version + #EXTRACT_FIELD_NAME_RE = /\A([^\x00-\x1f\x7f-\xff :]+):\s*/o + + # universal version + # + # accoring to RFC2822 the header field name can consist of any + # ASCII char between and including 33 and 126. + EXTRACT_FIELD_NAME_RE = /\A(^\w[-\w]+):\s*/o class << self def parse(field) field = field.to_str + if field =~ EXTRACT_FIELD_NAME_RE [ $1, $'.chomp ] else