Permalink
Browse files

Bundle tmail 1.2.3

  • Loading branch information...
1 parent b433093 commit 762295e0ae9d67450403596412bb8489893378d9 @jeremy jeremy committed May 20, 2008
Showing with 38 additions and 13 deletions.
  1. +2 −2 actionmailer/lib/action_mailer/vendor.rb
  2. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail.rb
  3. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/address.rb
  4. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/attachments.rb
  5. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/base64.rb
  6. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/compat.rb
  7. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/config.rb
  8. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/core_extensions.rb
  9. +26 −6 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/encode.rb
  10. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/header.rb
  11. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/index.rb
  12. +6 −1 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/interface.rb
  13. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/loader.rb
  14. +2 −2 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/mail.rb
  15. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/mailbox.rb
  16. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/main.rb
  17. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/mbox.rb
  18. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/net.rb
  19. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/obsolete.rb
  20. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/parser.rb
  21. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/port.rb
  22. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/quoting.rb
  23. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/require_arch.rb
  24. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/scanner.rb
  25. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/scanner_r.rb
  26. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/stringio.rb
  27. +1 −1 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/utils.rb
  28. +1 −1 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/version.rb
@@ -2,9 +2,9 @@
require 'rubygems'
begin
- gem 'tmail', '~> 1.2.2'
+ gem 'tmail', '~> 1.2.3'
rescue Gem::LoadError
- $:.unshift "#{File.dirname(__FILE__)}/vendor/tmail-1.2.2"
+ $:.unshift "#{File.dirname(__FILE__)}/vendor/tmail-1.2.3"
end
begin
@@ -339,22 +339,36 @@ def encode_value( str )
def scanadd( str, force = false )
types = ''
strs = []
-
+ if str.respond_to?(:encoding)
+ enc = str.encoding
+ str.force_encoding(Encoding::ASCII_8BIT)
+ end
until str.empty?
if m = /\A[^\e\t\r\n ]+/.match(str)
types << (force ? 'j' : 'a')
- strs.push m[0]
-
+ if str.respond_to?(:encoding)
+ strs.push m[0].force_encoding(enc)
+ else
+ strs.push m[0]
+ end
elsif m = /\A[\t\r\n ]+/.match(str)
types << 's'
- strs.push m[0]
+ if str.respond_to?(:encoding)
+ strs.push m[0].force_encoding(enc)
+ else
+ strs.push m[0]
+ end
elsif m = /\A\e../.match(str)
esc = m[0]
str = m.post_match
if esc != "\e(B" and m = /\A[^\e]+/.match(str)
types << 'j'
- strs.push m[0]
+ if str.respond_to?(:encoding)
+ strs.push m[0].force_encoding(enc)
+ else
+ strs.push m[0]
+ end
end
else
@@ -453,7 +467,13 @@ def extract_J( chunksize, str )
size = max_bytes(chunksize, str.size) - 6
size = (size % 2 == 0) ? (size) : (size - 1)
return nil if size <= 0
- "\e$B#{str.slice!(0, size)}\e(B"
+ if str.respond_to?(:encoding)
+ enc = str.encoding
+ str.force_encoding(Encoding::ASCII_8BIT)
+ "\e$B#{str.slice!(0, size)}\e(B".force_encoding(enc)
+ else
+ "\e$B#{str.slice!(0, size)}\e(B"
+ end
end
def extract_A( chunksize, str )
@@ -591,12 +591,17 @@ def message_id( default = nil )
end
# Destructively sets the message ID of the mail object instance to the passed in string
+ #
+ # Invalid message IDs are ignored (silently, unless configured otherwise) and result in
+ # a nil message ID. Left and right angle brackets are required.
#
# Example:
#
# mail = TMail::Mail.new
+ # mail.message_id = "<348F04F142D69C21-291E56D292BC@xxxx.net>"
+ # mail.message_id #=> "<348F04F142D69C21-291E56D292BC@xxxx.net>"
# mail.message_id = "this_is_my_badly_formatted_message_id"
- # mail.message_id #=> "this_is_my_badly_formatted_message_id"
+ # mail.message_id #=> nil
def message_id=( str )
set_string_attr 'Message-Id', str
end
@@ -408,8 +408,8 @@ def parse_header( f )
when /\AFrom (\S+)/
unixfrom = $1
- when /^charset=.*/
-
+ when /^charset=.*/
+
else
raise SyntaxError, "wrong mail header: '#{line.inspect}'"
end
@@ -118,7 +118,7 @@ module TextUtils
ATOM_UNSAFE = /[#{Regexp.quote aspecial}#{control}#{lwsp}]/n
PHRASE_UNSAFE = /[#{Regexp.quote aspecial}#{control}]/n
TOKEN_UNSAFE = /[#{Regexp.quote tspecial}#{control}#{lwsp}]/n
-
+
# Returns true if the string supplied is free from characters not allowed as an ATOM
def atom_safe?( str )
not ATOM_UNSAFE === str
@@ -32,7 +32,7 @@ module TMail
module VERSION
MAJOR = 1
MINOR = 2
- TINY = 2
+ TINY = 3
STRING = [MAJOR, MINOR, TINY].join('.')
end

0 comments on commit 762295e

Please sign in to comment.