actionmailer 1.0.1 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of actionmailer might be problematic. Click here for more details.

Files changed (37) hide show
  1. data/CHANGELOG +34 -0
  2. data/lib/action_mailer.rb +2 -4
  3. data/lib/action_mailer/adv_attr_accessor.rb +0 -29
  4. data/lib/action_mailer/base.rb +141 -44
  5. data/lib/action_mailer/helpers.rb +3 -3
  6. data/lib/action_mailer/mail_helper.rb +5 -3
  7. data/lib/action_mailer/part.rb +35 -3
  8. data/lib/action_mailer/part_container.rb +18 -1
  9. data/lib/action_mailer/quoting.rb +8 -48
  10. data/lib/action_mailer/vendor/text/format.rb +33 -14
  11. data/lib/action_mailer/vendor/tmail/address.rb +22 -3
  12. data/lib/action_mailer/vendor/tmail/attachments.rb +3 -1
  13. data/lib/action_mailer/vendor/tmail/base64.rb +22 -3
  14. data/lib/action_mailer/vendor/tmail/config.rb +22 -3
  15. data/lib/action_mailer/vendor/tmail/encode.rb +22 -3
  16. data/lib/action_mailer/vendor/tmail/facade.rb +22 -3
  17. data/lib/action_mailer/vendor/tmail/header.rb +27 -6
  18. data/lib/action_mailer/vendor/tmail/info.rb +22 -3
  19. data/lib/action_mailer/vendor/tmail/mail.rb +22 -3
  20. data/lib/action_mailer/vendor/tmail/mailbox.rb +22 -3
  21. data/lib/action_mailer/vendor/tmail/net.rb +22 -3
  22. data/lib/action_mailer/vendor/tmail/obsolete.rb +22 -3
  23. data/lib/action_mailer/vendor/tmail/parser.rb +22 -3
  24. data/lib/action_mailer/vendor/tmail/port.rb +22 -3
  25. data/lib/action_mailer/vendor/tmail/quoting.rb +6 -5
  26. data/lib/action_mailer/vendor/tmail/scanner.rb +22 -3
  27. data/lib/action_mailer/vendor/tmail/scanner_r.rb +22 -3
  28. data/lib/action_mailer/vendor/tmail/stringio.rb +22 -5
  29. data/lib/action_mailer/vendor/tmail/utils.rb +22 -3
  30. data/lib/action_mailer/version.rb +9 -0
  31. data/rakefile +5 -4
  32. data/test/fixtures/raw_email12 +32 -0
  33. data/test/mail_render_test.rb +48 -0
  34. data/test/mail_service_test.rb +62 -5
  35. data/test/quoting_test.rb +48 -0
  36. data/test/tmail_test.rb +17 -0
  37. metadata +8 -3
@@ -1,5 +1,22 @@
1
1
  module ActionMailer
2
- module PartContainer #:nodoc:
2
+ # Accessors and helpers that ActionMailer::Base and ActionMailer::Part have
3
+ # in common. Using these helpers you can easily add subparts or attachments
4
+ # to your message:
5
+ #
6
+ # def my_mail_message(...)
7
+ # ...
8
+ # part "text/plain" do |p|
9
+ # p.body "hello, world"
10
+ # p.transfer_encoding "base64"
11
+ # end
12
+ #
13
+ # attachment "image/jpg" do |a|
14
+ # a.body = File.read("hello.jpg")
15
+ # a.filename = "hello.jpg"
16
+ # end
17
+ # end
18
+ module PartContainer
19
+ # The list of subparts of this container
3
20
  attr_reader :parts
4
21
 
5
22
  # Add a part to a multipart message, with the given content-type. The
@@ -3,57 +3,17 @@ module ActionMailer
3
3
  # Convert the given text into quoted printable format, with an instruction
4
4
  # that the text be eventually interpreted in the given charset.
5
5
  def quoted_printable(text, charset)
6
- text = text.gsub( /[^a-z ]/i ) { "=%02x" % $&[0] }.gsub( / /, "_" )
6
+ text = text.gsub( /[^a-z ]/i ) { quoted_printable_encode($&) }.
7
+ gsub( / /, "_" )
7
8
  "=?#{charset}?Q?#{text}?="
8
9
  end
9
10
 
10
- # A quick-and-dirty regexp for determining whether a string contains any
11
- # characters that need escaping.
12
- CHARS_NEEDING_QUOTING = /[\000-\011\013\014\016-\037\177-\377]/
13
-
14
- # Quote the given text if it contains any "illegal" characters
15
- def quote_if_necessary(text, charset)
16
- (text =~ CHARS_NEEDING_QUOTING) ?
17
- quoted_printable(text, charset) :
18
- text
19
- end
20
-
21
- # Quote any of the given strings if they contain any "illegal" characters
22
- def quote_any_if_necessary(charset, *args)
23
- args.map { |v| quote_if_necessary(v, charset) }
24
- end
25
-
26
- # Quote the given address if it needs to be. The address may be a
27
- # regular email address, or it can be a phrase followed by an address in
28
- # brackets. The phrase is the only part that will be quoted, and only if
29
- # it needs to be. This allows extended characters to be used in the
30
- # "to", "from", "cc", and "bcc" headers.
31
- def quote_address_if_necessary(address, charset)
32
- if Array === address
33
- address.map { |a| quote_address_if_necessary(a, charset) }
34
- elsif address =~ /^(\S.*)\s+(<.*>)$/
35
- address = $2
36
- phrase = quote_if_necessary($1.gsub(/^['"](.*)['"]$/, '\1'), charset)
37
- "\"#{phrase}\" #{address}"
38
- else
39
- address
40
- end
41
- end
42
-
43
- # Quote any of the given addresses, if they need to be.
44
- def quote_any_address_if_necessary(charset, *args)
45
- args.map { |v| quote_address_if_necessary(v, charset) }
46
- end
47
- end
48
- end
49
-
50
- module ActionMailer
51
- module Quoting #:nodoc:
52
- # Convert the given text into quoted printable format, with an instruction
53
- # that the text be eventually interpreted in the given charset.
54
- def quoted_printable(text, charset)
55
- text = text.gsub( /[^a-z ]/i ) { "=%02x" % $&[0] }.gsub( / /, "_" )
56
- "=?#{charset}?Q?#{text}?="
11
+ # Convert the given character to quoted printable format, taking into
12
+ # account multi-byte characters (if executing with $KCODE="u", for instance)
13
+ def quoted_printable_encode(character)
14
+ result = ""
15
+ character.each_byte { |b| result << "=%02x" % b }
16
+ result
57
17
  end
58
18
 
59
19
  # A quick-and-dirty regexp for determining whether a string contains any
@@ -47,20 +47,39 @@
47
47
  #++
48
48
 
49
49
  module Text #:nodoc:
50
- # = Introduction
51
- #
52
- # Text::Format provides the ability to nicely format fixed-width text with
53
- # knowledge of the writeable space (number of columns), margins, and
54
- # indentation settings.
55
- #
56
- # Copyright:: Copyright (c) 2002 - 2003 by Austin Ziegler
57
- # Version:: 0.63
58
- # Based On:: Perl
59
- # Text::Format[http://search.cpan.org/author/GABOR/Text-Format0.52/lib/Text/Format.pm],
60
- # Copyright (c) 1998 G�bor Egressy
61
- # Licence:: Ruby's, Perl Artistic, or GPL version 2 (or later)
62
- #
63
- class Format
50
+ # Text::Format for Ruby is copyright 2002 - 2005 by Austin Ziegler. It
51
+ # is available under Ruby's licence, the Perl Artistic licence, or the
52
+ # GNU GPL version 2 (or at your option, any later version). As a
53
+ # special exception, for use with official Rails (provided by the
54
+ # rubyonrails.org development team) and any project created with
55
+ # official Rails, the following alternative MIT-style licence may be
56
+ # used:
57
+ #
58
+ # == Text::Format Licence for Rails and Rails Applications
59
+ # Permission is hereby granted, free of charge, to any person
60
+ # obtaining a copy of this software and associated documentation files
61
+ # (the "Software"), to deal in the Software without restriction,
62
+ # including without limitation the rights to use, copy, modify, merge,
63
+ # publish, distribute, sublicense, and/or sell copies of the Software,
64
+ # and to permit persons to whom the Software is furnished to do so,
65
+ # subject to the following conditions:
66
+ #
67
+ # * The names of its contributors may not be used to endorse or
68
+ # promote products derived from this software without specific prior
69
+ # written permission.
70
+ #
71
+ # The above copyright notice and this permission notice shall be
72
+ # included in all copies or substantial portions of the Software.
73
+ #
74
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
75
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
76
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
77
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
78
+ # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
79
+ # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
80
+ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
81
+ # SOFTWARE.
82
+ class Format
64
83
  VERSION = '0.63'
65
84
 
66
85
  # Local abbreviations. More can be added with Text::Format.abbreviations
@@ -1,12 +1,31 @@
1
1
  #
2
2
  # address.rb
3
3
  #
4
+ #--
4
5
  # Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
5
6
  #
6
- # This program is free software.
7
- # You can distribute/modify this program under the terms of
8
- # the GNU Lesser General Public License version 2 or later.
7
+ # Permission is hereby granted, free of charge, to any person obtaining
8
+ # a copy of this software and associated documentation files (the
9
+ # "Software"), to deal in the Software without restriction, including
10
+ # without limitation the rights to use, copy, modify, merge, publish,
11
+ # distribute, sublicense, and/or sell copies of the Software, and to
12
+ # permit persons to whom the Software is furnished to do so, subject to
13
+ # the following conditions:
9
14
  #
15
+ # The above copyright notice and this permission notice shall be
16
+ # included in all copies or substantial portions of the Software.
17
+ #
18
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
+ #
26
+ # Note: Originally licensed under LGPL v2+. Using MIT license for Rails
27
+ # with permission of Minero Aoki.
28
+ #++
10
29
 
11
30
  require 'tmail/encode'
12
31
  require 'tmail/parser'
@@ -15,7 +15,9 @@ module TMail
15
15
  parts.collect { |part|
16
16
  if part.header["content-type"].main_type != "text"
17
17
  content = part.body # unquoted automatically by TMail#body
18
- file_name = part.sub_header("content-type", "name") ||
18
+ file_name = (part['content-location'] &&
19
+ part['content-location'].body) ||
20
+ part.sub_header("content-type", "name") ||
19
21
  part.sub_header("content-disposition", "filename")
20
22
 
21
23
  next if file_name.blank? || content.blank?
@@ -1,12 +1,31 @@
1
1
  #
2
2
  # base64.rb
3
3
  #
4
+ #--
4
5
  # Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
5
6
  #
6
- # This program is free software.
7
- # You can distribute/modify this program under the terms of
8
- # the GNU Lesser General Public License version 2 or later.
7
+ # Permission is hereby granted, free of charge, to any person obtaining
8
+ # a copy of this software and associated documentation files (the
9
+ # "Software"), to deal in the Software without restriction, including
10
+ # without limitation the rights to use, copy, modify, merge, publish,
11
+ # distribute, sublicense, and/or sell copies of the Software, and to
12
+ # permit persons to whom the Software is furnished to do so, subject to
13
+ # the following conditions:
9
14
  #
15
+ # The above copyright notice and this permission notice shall be
16
+ # included in all copies or substantial portions of the Software.
17
+ #
18
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
+ #
26
+ # Note: Originally licensed under LGPL v2+. Using MIT license for Rails
27
+ # with permission of Minero Aoki.
28
+ #++
10
29
 
11
30
  module TMail
12
31
 
@@ -1,12 +1,31 @@
1
1
  #
2
2
  # config.rb
3
3
  #
4
+ #--
4
5
  # Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
5
6
  #
6
- # This program is free software.
7
- # You can distribute/modify this program under the terms of
8
- # the GNU Lesser General Public License version 2 or later.
7
+ # Permission is hereby granted, free of charge, to any person obtaining
8
+ # a copy of this software and associated documentation files (the
9
+ # "Software"), to deal in the Software without restriction, including
10
+ # without limitation the rights to use, copy, modify, merge, publish,
11
+ # distribute, sublicense, and/or sell copies of the Software, and to
12
+ # permit persons to whom the Software is furnished to do so, subject to
13
+ # the following conditions:
9
14
  #
15
+ # The above copyright notice and this permission notice shall be
16
+ # included in all copies or substantial portions of the Software.
17
+ #
18
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
+ #
26
+ # Note: Originally licensed under LGPL v2+. Using MIT license for Rails
27
+ # with permission of Minero Aoki.
28
+ #++
10
29
 
11
30
  module TMail
12
31
 
@@ -1,12 +1,31 @@
1
1
  #
2
2
  # encode.rb
3
3
  #
4
+ #--
4
5
  # Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
5
6
  #
6
- # This program is free software.
7
- # You can distribute/modify this program under the terms of
8
- # the GNU Lesser General Public License version 2 or later.
7
+ # Permission is hereby granted, free of charge, to any person obtaining
8
+ # a copy of this software and associated documentation files (the
9
+ # "Software"), to deal in the Software without restriction, including
10
+ # without limitation the rights to use, copy, modify, merge, publish,
11
+ # distribute, sublicense, and/or sell copies of the Software, and to
12
+ # permit persons to whom the Software is furnished to do so, subject to
13
+ # the following conditions:
9
14
  #
15
+ # The above copyright notice and this permission notice shall be
16
+ # included in all copies or substantial portions of the Software.
17
+ #
18
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
+ #
26
+ # Note: Originally licensed under LGPL v2+. Using MIT license for Rails
27
+ # with permission of Minero Aoki.
28
+ #++
10
29
 
11
30
  require 'nkf'
12
31
  require 'tmail/base64.rb'
@@ -1,12 +1,31 @@
1
1
  #
2
2
  # facade.rb
3
3
  #
4
+ #--
4
5
  # Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
5
6
  #
6
- # This program is free software.
7
- # You can distribute/modify this program under the terms of
8
- # the GNU Lesser General Public License version 2 or later.
7
+ # Permission is hereby granted, free of charge, to any person obtaining
8
+ # a copy of this software and associated documentation files (the
9
+ # "Software"), to deal in the Software without restriction, including
10
+ # without limitation the rights to use, copy, modify, merge, publish,
11
+ # distribute, sublicense, and/or sell copies of the Software, and to
12
+ # permit persons to whom the Software is furnished to do so, subject to
13
+ # the following conditions:
9
14
  #
15
+ # The above copyright notice and this permission notice shall be
16
+ # included in all copies or substantial portions of the Software.
17
+ #
18
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
+ #
26
+ # Note: Originally licensed under LGPL v2+. Using MIT license for Rails
27
+ # with permission of Minero Aoki.
28
+ #++
10
29
 
11
30
  require 'tmail/utils'
12
31
 
@@ -1,12 +1,31 @@
1
1
  #
2
2
  # header.rb
3
3
  #
4
+ #--
4
5
  # Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
5
6
  #
6
- # This program is free software.
7
- # You can distribute/modify this program under the terms of
8
- # the GNU Lesser General Public License version 2 or later.
7
+ # Permission is hereby granted, free of charge, to any person obtaining
8
+ # a copy of this software and associated documentation files (the
9
+ # "Software"), to deal in the Software without restriction, including
10
+ # without limitation the rights to use, copy, modify, merge, publish,
11
+ # distribute, sublicense, and/or sell copies of the Software, and to
12
+ # permit persons to whom the Software is furnished to do so, subject to
13
+ # the following conditions:
9
14
  #
15
+ # The above copyright notice and this permission notice shall be
16
+ # included in all copies or substantial portions of the Software.
17
+ #
18
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
+ #
26
+ # Note: Originally licensed under LGPL v2+. Using MIT license for Rails
27
+ # with permission of Minero Aoki.
28
+ #++
10
29
 
11
30
  require 'tmail/encode'
12
31
  require 'tmail/address'
@@ -754,9 +773,11 @@ module TMail
754
773
  strategy.meta @main
755
774
  end
756
775
  @params.each do |k,v|
757
- strategy.meta ';'
758
- strategy.space
759
- strategy.kv_pair k, v
776
+ if v
777
+ strategy.meta ';'
778
+ strategy.space
779
+ strategy.kv_pair k, v
780
+ end
760
781
  end
761
782
  end
762
783
 
@@ -1,12 +1,31 @@
1
1
  #
2
2
  # info.rb
3
3
  #
4
+ #--
4
5
  # Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
5
6
  #
6
- # This program is free software.
7
- # You can distribute/modify this program under the terms of
8
- # the GNU Lesser General Public License version 2 or later.
7
+ # Permission is hereby granted, free of charge, to any person obtaining
8
+ # a copy of this software and associated documentation files (the
9
+ # "Software"), to deal in the Software without restriction, including
10
+ # without limitation the rights to use, copy, modify, merge, publish,
11
+ # distribute, sublicense, and/or sell copies of the Software, and to
12
+ # permit persons to whom the Software is furnished to do so, subject to
13
+ # the following conditions:
9
14
  #
15
+ # The above copyright notice and this permission notice shall be
16
+ # included in all copies or substantial portions of the Software.
17
+ #
18
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
+ #
26
+ # Note: Originally licensed under LGPL v2+. Using MIT license for Rails
27
+ # with permission of Minero Aoki.
28
+ #++
10
29
 
11
30
  module TMail
12
31
 
@@ -1,12 +1,31 @@
1
1
  #
2
2
  # mail.rb
3
3
  #
4
+ #--
4
5
  # Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
5
6
  #
6
- # This program is free software.
7
- # You can distribute/modify this program under the terms of
8
- # the GNU Lesser General Public License version 2 or later.
7
+ # Permission is hereby granted, free of charge, to any person obtaining
8
+ # a copy of this software and associated documentation files (the
9
+ # "Software"), to deal in the Software without restriction, including
10
+ # without limitation the rights to use, copy, modify, merge, publish,
11
+ # distribute, sublicense, and/or sell copies of the Software, and to
12
+ # permit persons to whom the Software is furnished to do so, subject to
13
+ # the following conditions:
9
14
  #
15
+ # The above copyright notice and this permission notice shall be
16
+ # included in all copies or substantial portions of the Software.
17
+ #
18
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
+ #
26
+ # Note: Originally licensed under LGPL v2+. Using MIT license for Rails
27
+ # with permission of Minero Aoki.
28
+ #++
10
29
 
11
30
  require 'tmail/facade'
12
31
  require 'tmail/encode'