mail 2.3.3 → 2.4.0

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

Potentially problematic release.


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

Files changed (38) hide show
  1. data/CHANGELOG.rdoc +26 -0
  2. data/CONTRIBUTING.md +45 -0
  3. data/Gemfile +2 -8
  4. data/Gemfile.lock +31 -0
  5. data/README.md +649 -0
  6. data/Rakefile +4 -30
  7. data/lib/VERSION +2 -2
  8. data/lib/mail.rb +3 -1
  9. data/lib/mail/attachments_list.rb +2 -3
  10. data/lib/mail/body.rb +1 -2
  11. data/lib/mail/configuration.rb +3 -3
  12. data/lib/mail/core_extensions/nil.rb +4 -0
  13. data/lib/mail/core_extensions/shellwords.rb +57 -0
  14. data/lib/mail/core_extensions/string.rb +6 -4
  15. data/lib/mail/core_extensions/string/access.rb +41 -0
  16. data/lib/mail/encodings.rb +8 -8
  17. data/lib/mail/field.rb +2 -0
  18. data/lib/mail/fields/common/parameter_hash.rb +1 -1
  19. data/lib/mail/fields/unstructured_field.rb +1 -1
  20. data/lib/mail/matchers/has_sent_mail.rb +124 -0
  21. data/lib/mail/message.rb +72 -19
  22. data/lib/mail/multibyte/chars.rb +2 -2
  23. data/lib/mail/multibyte/utils.rb +1 -1
  24. data/lib/mail/network/delivery_methods/exim.rb +5 -38
  25. data/lib/mail/network/delivery_methods/file_delivery.rb +2 -2
  26. data/lib/mail/network/delivery_methods/sendmail.rb +3 -3
  27. data/lib/mail/network/delivery_methods/smtp.rb +20 -4
  28. data/lib/mail/network/retriever_methods/imap.rb +4 -2
  29. data/lib/mail/parsers/rfc2822.treetop +1 -1
  30. data/lib/mail/parsers/rfc2822_obsolete.rb +14 -3
  31. data/lib/mail/parsers/rfc2822_obsolete.treetop +2 -2
  32. data/lib/mail/parts_list.rb +4 -0
  33. data/lib/mail/utilities.rb +6 -2
  34. data/lib/mail/version_specific/ruby_1_8.rb +1 -1
  35. data/lib/mail/version_specific/ruby_1_9.rb +8 -4
  36. metadata +18 -12
  37. data/README.rdoc +0 -563
  38. data/lib/mail/core_extensions/shell_escape.rb +0 -56
@@ -1,56 +0,0 @@
1
- # encoding: utf-8
2
-
3
- # The following is an adaptation of ruby 1.9.2's shellwords.rb file,
4
- # it is modified to include '+' in the allowed list to allow for
5
- # sendmail to accept email addresses as the sender with a + in them
6
- #
7
- module Mail
8
- module ShellEscape
9
- # Escapes a string so that it can be safely used in a Bourne shell
10
- # command line.
11
- #
12
- # Note that a resulted string should be used unquoted and is not
13
- # intended for use in double quotes nor in single quotes.
14
- #
15
- # open("| grep #{Shellwords.escape(pattern)} file") { |pipe|
16
- # # ...
17
- # }
18
- #
19
- # +String#shellescape+ is a shorthand for this function.
20
- #
21
- # open("| grep #{pattern.shellescape} file") { |pipe|
22
- # # ...
23
- # }
24
- #
25
- def escape_for_shell(str)
26
- # An empty argument will be skipped, so return empty quotes.
27
- return "''" if str.empty?
28
-
29
- str = str.dup
30
-
31
- # Process as a single byte sequence because not all shell
32
- # implementations are multibyte aware.
33
- str.gsub!(/([^A-Za-z0-9_\s\+\-.,:\/@\n])/n, "\\\\\\1")
34
-
35
- # A LF cannot be escaped with a backslash because a backslash + LF
36
- # combo is regarded as line continuation and simply ignored.
37
- str.gsub!(/\n/, "'\n'")
38
-
39
- return str
40
- end
41
-
42
- module_function :escape_for_shell
43
- end
44
- end
45
-
46
- class String
47
- # call-seq:
48
- # str.shellescape => string
49
- #
50
- # Escapes +str+ so that it can be safely used in a Bourne shell
51
- # command line. See +Shellwords::shellescape+ for details.
52
- #
53
- def escape_for_shell
54
- Mail::ShellEscape.escape_for_shell(self)
55
- end
56
- end