debian/0000755000000000000000000000000012224311567007171 5ustar debian/ruby-rubymail.install0000644000000000000000000000004011765211160013353 0ustar lib/* usr/lib/ruby/vendor_ruby/ debian/doc-base.ruby-rubymail-doc0000644000000000000000000000062311765211160014134 0ustar Document: ruby-rubymail-doc Title: Debian ruby-rubymail Manual Author: Matt Armstrong Abstract: RubyMail is a lightweight mail library containing various utility classes and modules that allow Ruby scripts to parse, modify, and generate MIME mail messages. Section: Programming/Ruby Format: HTML Index: /usr/share/doc/ruby-rubymail-doc/html/index.html Files: /usr/share/doc/ruby-rubymail-doc/html/* debian/ruby-rubymail.docs0000644000000000000000000000003711773052452012651 0ustar guide NOTES README THANKS TODO debian/compat0000644000000000000000000000000211765211160010364 0ustar 7 debian/changelog0000644000000000000000000000616612224311567011054 0ustar ruby-rubymail (1.0.0-2) unstable; urgency=low * Team upload * Added patches for Ruby 2.0 compatibility (Closes: #720253): - debian/patches/0007-Create-Explicit-Binary-Regexp.patch - debian/patches/0008-fix-testbase-for-ruby2.0.patch - debian/patches/0009-fix-testaddress-for-ruby2.0.patch - debian/patches/0010-fix-testmessage-for-ruby2.0.patch * Standards-Version bumped to 3.9.4; no changes needed. * Drop old transition packages as they are not needed anymore -- Antonio Terceiro Sun, 06 Oct 2013 13:30:43 -0300 ruby-rubymail (1.0.0-1) unstable; urgency=low * New maintainer. Closes: #676346 * New upstream release. * Use source format 3.0 (quilt). * Set unapply-patches in debian/source/local-options. * Bump standards version to 3.9.3 (no changes necessary). * Migrate to new Ruby policy - Build depend on debhelper >= 7.0.50~ and gem2deb >= 0.2.16~. - Rename source and binary packages. - Create transitional packages. - Add Vcs-* fields. - Add Homepage field. - Build for all Ruby versions. - Migrate debian/rules to a minimal straight forward debhelper makefile. - Run all tests when building a package. * Add patch to reintroduce removed docs. * Add patch for running tests under both Ruby 1.8 and 1.9. * Add patch for to parse messages with "\r\n" as linefeed. * Add patch to remove rubygems require. Closes: #431557 * Add watch file. * Change doc-base section to Programming/Ruby. * Add patch for testing header params without order guarantee. * debian/copyright: - Change format to DEP5. - Source is BSD licensed, updated accordingly. * debian/rules: - Install upstream changelog (don't install with ruby-rubymail.docs). - Add -O--buildsystem=ruby to dh in overrides. -- Per Andersson Thu, 28 Jun 2012 13:37:01 +0200 librmail-ruby (0.17-1.1) unstable; urgency=low * Non-maintainer upload. * Apply patch from upstream BTS to avoid quoting existing parameters twice in Header::set_boundary(). Addresses part of #431557, which requested for all patches in upstream BTS to be applied to the package. * Add a build-dependency on quilt and the 3-line magic in debian/rules to apply the above patch. -- Adeodato Simó Sun, 12 Jul 2009 10:24:45 +0200 librmail-ruby (0.17-1) unstable; urgency=low * New upstream version. * New maintainer. * Removed sub-package librmail-ruby1.6. -- Shugo Maeda Wed, 22 Jun 2005 00:17:12 +0900 librmail-ruby (0.15-1) unstable; urgency=low * new upstream version. (closes: #220787) * new sub-package librmail-ruby1.6, librmail-ruby1.8 and librmail-ruby-doc. * Build-Depends on ruby1.8, ruby1.8-dev, ruby1.6 and ruby1.6-dev. -- akira yamada Sun, 16 Nov 2003 18:42:32 +0900 librmail-ruby (0.14-1) unstable; urgency=low * new upstream version. -- akira yamada Fri, 29 Aug 2003 15:02:41 +0900 librmail-ruby (0.8-1) unstable; urgency=low * Initial Release. * uploaded to Debian, closes: #164164. -- akira yamada Fri, 11 Oct 2002 00:56:28 +0900 debian/copyright0000644000000000000000000000474311773052452011137 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: RubyMail Source: Files: * Copyright: 2001, 2002 Matt Armstrong License: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Files: debian/* Copyright: 2002, 2003 Akira Yamada 2005 Shugo Maeda 2012 Per Andersson License: GPL-3+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . . On Debian systems, the complete text of the GNU General Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". debian/control0000644000000000000000000000264012224311543010570 0ustar Source: ruby-rubymail Section: ruby Priority: optional Maintainer: Debian Ruby Extras Maintainers Uploaders: Per Andersson Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.2.16~) Standards-Version: 3.9.4 Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-rubymail.git Vcs-Browser: http://anonscm.debian.org/gitweb?p=pkg-ruby-extras/ruby-rubymail.git;a=summary Homepage: http://rubyforge.org/projects/rubymail/ XS-Ruby-Versions: all Package: ruby-rubymail-doc Section: doc Architecture: all Depends: ${misc:Depends} Suggests: ruby-rubymail Replaces: librmail-ruby-doc (<< 1.0.0-1~) Breaks: librmail-ruby-doc (<< 1.0.0-1~) Provides: librmail-ruby-doc Description: lightweight mail library for Ruby (documentation) RubyMail is a lightweight mail library containing various utility classes and modules that allow Ruby scripts to parse, modify, and generate MIME mail messages. Package: ruby-rubymail Architecture: all XB-Ruby-Versions: ${ruby:Versions} Depends: ${misc:Depends}, ruby | ruby-interpreter Suggests: ruby-rubymail-doc Replaces: librmail-ruby1.8 (<< 1.0.0-1~) Breaks: librmail-ruby1.8 (<< 1.0.0-1~) Provides: librmail-ruby1.8 Description: lightweight mail library for Ruby This is RubyMail, a lightweight mail library containing various utility classes and modules that allow Ruby scripts to parse, modify, and generate MIME mail messages. debian/rules0000755000000000000000000000126411773052452010257 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 # # Uncomment to ignore all test failures (but the tests will run anyway) #export DH_RUBY_IGNORE_TESTS=all # # Uncomment to ignore some test failures (but the tests will run anyway). # Valid values: #export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems # # If you need to specify the .gemspec (eg there is more than one) #export DH_RUBY_GEMSPEC=gem.gemspec %: dh $@ --buildsystem=ruby --with ruby override_dh_auto_install: dh_auto_install -O--buildsystem=ruby # Remove script files from ruby-rubymail-doc -rm -rf $(CURDIR)/debian/ruby-rubymail-doc/usr/lib override_dh_installchangelogs: dh_installchangelogs -O--buildsystem=ruby NEWS debian/ruby-tests.rb0000644000000000000000000000011111765211160011625 0ustar $: << 'lib' << 'test' << '.' Dir['test/test*.rb'].each { |f| require f } debian/source/0000755000000000000000000000000011765211160010466 5ustar debian/source/format0000644000000000000000000000001411765211160011674 0ustar 3.0 (quilt) debian/watch0000644000000000000000000000013511765211160010216 0ustar version=3 http://rubyforge.org/frs/?group_id=446 \ /frs/download.php/\d+/rmail-(.*).tgz debian/patches/0000755000000000000000000000000012224307741010617 5ustar debian/patches/0007-Create-Explicit-Binary-Regexp.patch0000644000000000000000000000265012224307731017662 0ustar Author: Antonio Terceiro Description: Create explicit binary regexp Ruby 2.0 chokes on those regexes saying they are not valid syntax. This specific solution is based on the discussion at http://www.velocityreviews.com/forums/t856762-ruby-1-9-1-invalid-multibyte-escape-xc0-xdf-regexperror.html diff --git a/lib/rmail/address.rb b/lib/rmail/address.rb index 8227841..ae99d16 100644 --- a/lib/rmail/address.rb +++ b/lib/rmail/address.rb @@ -691,7 +691,7 @@ module RMail @sym = SYM_DOMAIN_LITERAL @lexeme = $1.gsub(/(^|[^\\])[\r\n\t ]+/, '\1').gsub(/\\(.)/, '\1') break - when /\A[\200-\377\w!$%&\'*+\/=?^_\`{\}|~#-]+/m + when Regexp.new('\A[\200-\377\w!$%&\'*+\/=?^_\`{\}|~#-]+', Regexp::MULTILINE, 'n') # 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 9102f28..9d5c9b2 100644 --- a/lib/rmail/header.rb +++ b/lib/rmail/header.rb @@ -73,7 +73,7 @@ module RMail class Field # :nodoc: # fixme, document methadology for this (RFC2822) - EXTRACT_FIELD_NAME_RE = /\A([^\x00-\x1f\x7f-\xff :]+):\s*/o + EXTRACT_FIELD_NAME_RE = Regexp.new '\A([^\x00-\x1f\x7f-\xff :]+):\s*', nil, 'n' class << self def parse(field) debian/patches/0010-fix-testmessage-for-ruby2.0.patch0000644000000000000000000000041412224307741017310 0ustar --- a/test/testmessage.rb +++ b/test/testmessage.rb @@ -141,7 +141,7 @@ Second body line def test_decode message = RMail::Message.new - all_bytes = '' + all_bytes = ''.force_encoding('ASCII-8BIT') 0.upto(255) do |i| all_bytes << i end debian/patches/0005-Patch-out-require-rubygems.patch0000644000000000000000000000071511765211160017374 0ustar From: Per Andersson Date: Wed, 6 Jun 2012 18:19:57 +0200 Subject: Patch out require rubygems. --- Rakefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Rakefile b/Rakefile index 55246d0..176d2df 100644 --- a/Rakefile +++ b/Rakefile @@ -6,7 +6,7 @@ begin # First, we use a few ruby things... - require 'rubygems' + #require 'rubygems' require 'rake/gempackagetask' end require 'rake/rdoctask' -- debian/patches/0003-Implement-compatibility-wrapper-for-retrieving-test-.patch0000644000000000000000000000301511765211160024466 0ustar From: Per Andersson Date: Wed, 6 Jun 2012 17:47:15 +0200 Subject: Implement compatibility wrapper for retrieving test name. In RubyUnit 1.9 the method #name was removed from Test::Unit::TestCase. Implement wrapper for compatibility with both RubyUnit 1.8 and 1.9. --- test/testbase.rb | 12 +++++++++++- test/testtestbase.rb | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/test/testbase.rb b/test/testbase.rb index 0dfb8af..c17ba4e 100644 --- a/test/testbase.rb +++ b/test/testbase.rb @@ -102,8 +102,18 @@ class TestBase < Test::Unit::TestCase end end + # In RubyUnit 1.9 the method #name was removed. Implement wrapper here for + # compatibility with both RubyUnit 1.8 and 1.9. + def get_test_name + if (RUBY_VERSION.to_f < 1.9) + name + else + "#{self.__name__}(#{self.class})" + end + end + def setup - @scratch_dir = File.join(Dir.getwd, "_scratch_" + name) + @scratch_dir = File.join(Dir.getwd, "_scratch_" + get_test_name) @data_dir = File.join(Dir.getwd, "test", "data") @scratch_hash = {} diff --git a/test/testtestbase.rb b/test/testtestbase.rb index 4ae2b39..254b357 100644 --- a/test/testtestbase.rb +++ b/test/testtestbase.rb @@ -76,8 +76,8 @@ class TestTestBase < TestBase end def test_name - assert_match(/\btest_name\b/, name) - assert_match(/\bTestTestBase\b/, name) + assert_match(/\btest_name\b/, get_test_name) + assert_match(/\bTestTestBase\b/, get_test_name) end def test_scratch_dir -- debian/patches/0008-fix-testbase-for-ruby2.0.patch0000644000000000000000000000030512224307741016604 0ustar --- a/test/testbase.rb +++ b/test/testbase.rb @@ -39,7 +39,7 @@ rescue LoadError end class TestBase < Test::Unit::TestCase - include Config + include RbConfig attr_reader :scratch_dir debian/patches/0009-fix-testaddress-for-ruby2.0.patch0000644000000000000000000000164412224307741017327 0ustar --- a/test/testaddress.rb +++ b/test/testaddress.rb @@ -797,14 +797,14 @@ class TestRMailAddress < TestBase def test_invalid_addresses() # The display name isn't encoded -- bad, but we parse it. validate_case\ - ["\322\315\322 \312\353\363\341 ", - [ { :name => "\322\315\322 \312\353\363\341", - :display_name => "\322\315\322 \312\353\363\341", + ["\322\315\322 \312\353\363\341 ".force_encoding('ASCII-8BIT'), + [ { :name => "\322\315\322 \312\353\363\341".force_encoding("ASCII-8BIT"), + :display_name => "\322\315\322 \312\353\363\341".force_encoding("ASCII-8BIT"), :address => 'bar@foo.invalid', :comments => nil, :domain => 'foo.invalid', :local => 'bar', - :format => "\"\322\315\322 \312\353\363\341\" ", + :format => "\"\322\315\322 \312\353\363\341\" ".force_encoding("ASCII-8BIT"), } ] ] end debian/patches/0004-Parse-messages-with-r-n-as-linefeed.patch0000644000000000000000000000216111765211160020713 0ustar From: Per Andersson Date: Wed, 6 Jun 2012 18:05:19 +0200 Subject: Parse messages with "\r\n" as linefeed. Patch fetched from upstream bug tracker. http://rubyforge.org/tracker/index.php?func=detail&aid=2821&group_id=446&atid=1756 --- lib/rmail/parser.rb | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/rmail/parser.rb b/lib/rmail/parser.rb index 84626a4..bc68f08 100644 --- a/lib/rmail/parser.rb +++ b/lib/rmail/parser.rb @@ -213,15 +213,17 @@ module RMail # headers. The body part starts directly after this # newline. rest = data[1..-1] + elsif data[0] == ?\r && data[1] == ?\n + rest = data[2..-1] else - header, rest = data.split(/\n\n/, 2) + header, rest = data.split(/\r?\n\r?\n/, 2) end break if rest end input.pushback(rest) if header mime = false - fields = header.split(/\n(?!\s)/) + fields = header.split(/\r?\n(?!\s)/) if fields.first =~ /^From / @handler.mbox_from(fields.first) fields.shift -- debian/patches/series0000644000000000000000000000073412224307741012040 0ustar 0001-Do-not-quote-params-twice-in-a-set-boundary.patch 0002-Reintroduce-doc-from-0.17-that-was-removed-in-1.0.0.patch 0003-Implement-compatibility-wrapper-for-retrieving-test-.patch 0004-Parse-messages-with-r-n-as-linefeed.patch 0005-Patch-out-require-rubygems.patch 0006-Test-header-params-without-order-guarantee.patch 0007-Create-Explicit-Binary-Regexp.patch 0008-fix-testbase-for-ruby2.0.patch 0009-fix-testaddress-for-ruby2.0.patch 0010-fix-testmessage-for-ruby2.0.patch debian/patches/0006-Test-header-params-without-order-guarantee.patch0000644000000000000000000000201011765211160022423 0ustar From: Per Andersson Date: Thu, 7 Jun 2012 19:37:41 +0200 Subject: Test header params without order guarantee. --- test/testheader.rb | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/test/testheader.rb b/test/testheader.rb index 3c759dc..3e03b08 100644 --- a/test/testheader.rb +++ b/test/testheader.rb @@ -209,7 +209,12 @@ class TestRMailHeader < TestBase # Test the params argument h = RMail::Header.new h.add("name", "value", nil, 'param1' => 'value1', 'param2' => '+value2') - assert_equal('value; param1=value1; param2="+value2"', h['name']) + # Param order can not be guaranteed since they are given as dict to the + # function. + #assert_equal('value; param1=value1; param2="+value2"', h['name']) + header_check = (h['name'] == 'value; param1=value1; param2="+value2"' or + h['name'] == 'value; param2="+value2"; param1=value1') + assert(header_check) h = RMail::Header.new h.add_raw("MIME-Version: 1.0") -- debian/patches/0002-Reintroduce-doc-from-0.17-that-was-removed-in-1.0.0.patch0000644000000000000000000127203411765211160023023 0ustar From: Per Andersson Date: Sat, 2 Jun 2012 01:48:03 +0200 Subject: Reintroduce doc from 0.17 that was removed in 1.0.0 --- doc/classes/RMail.html | 123 ++ doc/classes/RMail/Address.html | 447 +++++++ doc/classes/RMail/Address.src/M000104.html | 28 + doc/classes/RMail/Address.src/M000105.html | 22 + doc/classes/RMail/Address.src/M000106.html | 15 + doc/classes/RMail/Address.src/M000107.html | 16 + doc/classes/RMail/Address.src/M000108.html | 15 + doc/classes/RMail/Address.src/M000109.html | 16 + doc/classes/RMail/Address.src/M000110.html | 15 + doc/classes/RMail/Address.src/M000111.html | 19 + doc/classes/RMail/Address.src/M000112.html | 15 + doc/classes/RMail/Address.src/M000113.html | 15 + doc/classes/RMail/Address.src/M000114.html | 26 + doc/classes/RMail/Address.src/M000115.html | 15 + doc/classes/RMail/Address.src/M000116.html | 20 + doc/classes/RMail/Address.src/M000117.html | 19 + doc/classes/RMail/Address.src/M000118.html | 57 + doc/classes/RMail/Address.src/M000120.html | 15 + doc/classes/RMail/Address/List.html | 171 +++ doc/classes/RMail/Address/List.src/M000123.html | 15 + doc/classes/RMail/Address/List.src/M000124.html | 15 + doc/classes/RMail/Address/List.src/M000125.html | 15 + doc/classes/RMail/Address/List.src/M000126.html | 15 + doc/classes/RMail/Address/List.src/M000127.html | 15 + doc/classes/RMail/Address/List.src/M000128.html | 15 + doc/classes/RMail/Address/Parser.html | 123 ++ doc/classes/RMail/Address/Parser.src/M000121.html | 15 + doc/classes/RMail/Address/Parser.src/M000122.html | 25 + doc/classes/RMail/Header.html | 1340 ++++++++++++++++++++ doc/classes/RMail/Header.src/M000040.html | 15 + doc/classes/RMail/Header.src/M000041.html | 24 + doc/classes/RMail/Header.src/M000042.html | 18 + doc/classes/RMail/Header.src/M000043.html | 18 + doc/classes/RMail/Header.src/M000044.html | 17 + doc/classes/RMail/Header.src/M000045.html | 21 + doc/classes/RMail/Header.src/M000046.html | 15 + doc/classes/RMail/Header.src/M000048.html | 29 + doc/classes/RMail/Header.src/M000049.html | 31 + doc/classes/RMail/Header.src/M000050.html | 15 + doc/classes/RMail/Header.src/M000055.html | 19 + doc/classes/RMail/Header.src/M000056.html | 16 + doc/classes/RMail/Header.src/M000057.html | 18 + doc/classes/RMail/Header.src/M000058.html | 17 + doc/classes/RMail/Header.src/M000060.html | 17 + doc/classes/RMail/Header.src/M000062.html | 17 + doc/classes/RMail/Header.src/M000063.html | 15 + doc/classes/RMail/Header.src/M000064.html | 22 + doc/classes/RMail/Header.src/M000065.html | 17 + doc/classes/RMail/Header.src/M000067.html | 36 + doc/classes/RMail/Header.src/M000068.html | 16 + doc/classes/RMail/Header.src/M000069.html | 16 + doc/classes/RMail/Header.src/M000070.html | 16 + doc/classes/RMail/Header.src/M000071.html | 17 + doc/classes/RMail/Header.src/M000072.html | 17 + doc/classes/RMail/Header.src/M000073.html | 15 + doc/classes/RMail/Header.src/M000074.html | 30 + doc/classes/RMail/Header.src/M000075.html | 20 + doc/classes/RMail/Header.src/M000076.html | 23 + doc/classes/RMail/Header.src/M000077.html | 15 + doc/classes/RMail/Header.src/M000078.html | 15 + doc/classes/RMail/Header.src/M000079.html | 23 + doc/classes/RMail/Header.src/M000080.html | 23 + doc/classes/RMail/Header.src/M000081.html | 23 + doc/classes/RMail/Header.src/M000082.html | 25 + doc/classes/RMail/Header.src/M000083.html | 24 + doc/classes/RMail/Header.src/M000084.html | 21 + doc/classes/RMail/Header.src/M000085.html | 23 + doc/classes/RMail/Header.src/M000086.html | 16 + doc/classes/RMail/Header.src/M000087.html | 15 + doc/classes/RMail/Header.src/M000088.html | 15 + doc/classes/RMail/Header.src/M000089.html | 15 + doc/classes/RMail/Header.src/M000090.html | 15 + doc/classes/RMail/Header.src/M000091.html | 15 + doc/classes/RMail/Header.src/M000092.html | 15 + doc/classes/RMail/Header.src/M000093.html | 15 + doc/classes/RMail/Header.src/M000094.html | 15 + doc/classes/RMail/Header.src/M000095.html | 15 + doc/classes/RMail/Header.src/M000096.html | 15 + doc/classes/RMail/Header.src/M000097.html | 15 + doc/classes/RMail/Header.src/M000098.html | 61 + doc/classes/RMail/Header.src/M000099.html | 15 + doc/classes/RMail/Header.src/M000100.html | 15 + doc/classes/RMail/Header.src/M000101.html | 19 + doc/classes/RMail/Header.src/M000102.html | 27 + doc/classes/RMail/Header.src/M000103.html | 31 + doc/classes/RMail/Mailbox.html | 99 ++ doc/classes/RMail/Mailbox.src/M000001.html | 26 + doc/classes/RMail/Mailbox/MBoxReader.html | 201 +++ .../RMail/Mailbox/MBoxReader.src/M000002.html | 27 + .../RMail/Mailbox/MBoxReader.src/M000003.html | 29 + .../RMail/Mailbox/MBoxReader.src/M000004.html | 16 + .../RMail/Mailbox/MBoxReader.src/M000005.html | 15 + .../RMail/Mailbox/MBoxReader.src/M000006.html | 18 + doc/classes/RMail/Message.html | 323 +++++ doc/classes/RMail/Message.src/M000010.html | 18 + doc/classes/RMail/Message.src/M000011.html | 18 + doc/classes/RMail/Message.src/M000012.html | 15 + doc/classes/RMail/Message.src/M000013.html | 15 + doc/classes/RMail/Message.src/M000014.html | 15 + doc/classes/RMail/Message.src/M000015.html | 15 + doc/classes/RMail/Message.src/M000016.html | 21 + doc/classes/RMail/Message.src/M000017.html | 23 + doc/classes/RMail/Message.src/M000018.html | 17 + doc/classes/RMail/Message.src/M000019.html | 16 + doc/classes/RMail/Message.src/M000020.html | 18 + doc/classes/RMail/Message.src/M000021.html | 19 + doc/classes/RMail/Parser.html | 182 +++ doc/classes/RMail/Parser.src/M000023.html | 15 + doc/classes/RMail/Parser.src/M000024.html | 19 + doc/classes/RMail/Parser.src/M000025.html | 15 + doc/classes/RMail/Parser/Error.html | 73 ++ doc/classes/RMail/Serialize.html | 148 +++ doc/classes/RMail/Serialize.src/M000037.html | 16 + doc/classes/RMail/Serialize.src/M000038.html | 16 + doc/classes/RMail/Serialize.src/M000039.html | 15 + doc/classes/RMail/StreamHandler.html | 326 +++++ doc/classes/RMail/StreamHandler.src/M000026.html | 14 + doc/classes/RMail/StreamHandler.src/M000027.html | 14 + doc/classes/RMail/StreamHandler.src/M000028.html | 14 + doc/classes/RMail/StreamHandler.src/M000029.html | 14 + doc/classes/RMail/StreamHandler.src/M000030.html | 14 + doc/classes/RMail/StreamHandler.src/M000031.html | 14 + doc/classes/RMail/StreamHandler.src/M000032.html | 14 + doc/classes/RMail/StreamHandler.src/M000033.html | 14 + doc/classes/RMail/StreamHandler.src/M000034.html | 14 + doc/classes/RMail/StreamHandler.src/M000035.html | 14 + doc/classes/RMail/StreamHandler.src/M000036.html | 14 + doc/classes/RMail/StreamParser.html | 103 ++ doc/classes/RMail/StreamParser.src/M000022.html | 15 + doc/classes/RMail/Utils.html | 113 ++ doc/classes/RMail/Utils.src/M000007.html | 19 + doc/classes/RMail/Utils.src/M000008.html | 15 + doc/classes/RMail/Utils.src/M000009.html | 15 + doc/created.rid | 1 + doc/files/NEWS.html | 495 ++++++++ doc/files/README.html | 143 +++ doc/files/THANKS.html | 95 ++ doc/files/TODO.html | 229 ++++ doc/files/guide/Intro_txt.html | 218 ++++ doc/files/guide/MIME_txt.html | 61 + doc/files/guide/TableOfContents_txt.html | 72 ++ doc/files/lib/rmail/address_rb.html | 81 ++ doc/files/lib/rmail/header_rb.html | 86 ++ doc/files/lib/rmail/mailbox/mboxreader_rb.html | 83 ++ doc/files/lib/rmail/mailbox_rb.html | 82 ++ doc/files/lib/rmail/message_rb.html | 83 ++ doc/files/lib/rmail/parser/multipart_rb.html | 81 ++ doc/files/lib/rmail/parser/pushbackreader_rb.html | 75 ++ doc/files/lib/rmail/parser_rb.html | 87 ++ doc/files/lib/rmail/serialize_rb.html | 76 ++ doc/files/lib/rmail/utils_rb.html | 76 ++ doc/files/lib/rmail_rb.html | 98 ++ doc/fr_class_index.html | 51 + doc/fr_file_index.html | 55 + doc/fr_method_index.html | 165 +++ doc/index.html | 22 + doc/rdoc-style.css | 99 ++ 157 files changed, 8607 insertions(+), 0 deletions(-) create mode 100644 doc/classes/RMail.html create mode 100644 doc/classes/RMail/Address.html create mode 100644 doc/classes/RMail/Address.src/M000104.html create mode 100644 doc/classes/RMail/Address.src/M000105.html create mode 100644 doc/classes/RMail/Address.src/M000106.html create mode 100644 doc/classes/RMail/Address.src/M000107.html create mode 100644 doc/classes/RMail/Address.src/M000108.html create mode 100644 doc/classes/RMail/Address.src/M000109.html create mode 100644 doc/classes/RMail/Address.src/M000110.html create mode 100644 doc/classes/RMail/Address.src/M000111.html create mode 100644 doc/classes/RMail/Address.src/M000112.html create mode 100644 doc/classes/RMail/Address.src/M000113.html create mode 100644 doc/classes/RMail/Address.src/M000114.html create mode 100644 doc/classes/RMail/Address.src/M000115.html create mode 100644 doc/classes/RMail/Address.src/M000116.html create mode 100644 doc/classes/RMail/Address.src/M000117.html create mode 100644 doc/classes/RMail/Address.src/M000118.html create mode 100644 doc/classes/RMail/Address.src/M000120.html create mode 100644 doc/classes/RMail/Address/List.html create mode 100644 doc/classes/RMail/Address/List.src/M000123.html create mode 100644 doc/classes/RMail/Address/List.src/M000124.html create mode 100644 doc/classes/RMail/Address/List.src/M000125.html create mode 100644 doc/classes/RMail/Address/List.src/M000126.html create mode 100644 doc/classes/RMail/Address/List.src/M000127.html create mode 100644 doc/classes/RMail/Address/List.src/M000128.html create mode 100644 doc/classes/RMail/Address/Parser.html create mode 100644 doc/classes/RMail/Address/Parser.src/M000121.html create mode 100644 doc/classes/RMail/Address/Parser.src/M000122.html create mode 100644 doc/classes/RMail/Header.html create mode 100644 doc/classes/RMail/Header.src/M000040.html create mode 100644 doc/classes/RMail/Header.src/M000041.html create mode 100644 doc/classes/RMail/Header.src/M000042.html create mode 100644 doc/classes/RMail/Header.src/M000043.html create mode 100644 doc/classes/RMail/Header.src/M000044.html create mode 100644 doc/classes/RMail/Header.src/M000045.html create mode 100644 doc/classes/RMail/Header.src/M000046.html create mode 100644 doc/classes/RMail/Header.src/M000048.html create mode 100644 doc/classes/RMail/Header.src/M000049.html create mode 100644 doc/classes/RMail/Header.src/M000050.html create mode 100644 doc/classes/RMail/Header.src/M000055.html create mode 100644 doc/classes/RMail/Header.src/M000056.html create mode 100644 doc/classes/RMail/Header.src/M000057.html create mode 100644 doc/classes/RMail/Header.src/M000058.html create mode 100644 doc/classes/RMail/Header.src/M000060.html create mode 100644 doc/classes/RMail/Header.src/M000062.html create mode 100644 doc/classes/RMail/Header.src/M000063.html create mode 100644 doc/classes/RMail/Header.src/M000064.html create mode 100644 doc/classes/RMail/Header.src/M000065.html create mode 100644 doc/classes/RMail/Header.src/M000067.html create mode 100644 doc/classes/RMail/Header.src/M000068.html create mode 100644 doc/classes/RMail/Header.src/M000069.html create mode 100644 doc/classes/RMail/Header.src/M000070.html create mode 100644 doc/classes/RMail/Header.src/M000071.html create mode 100644 doc/classes/RMail/Header.src/M000072.html create mode 100644 doc/classes/RMail/Header.src/M000073.html create mode 100644 doc/classes/RMail/Header.src/M000074.html create mode 100644 doc/classes/RMail/Header.src/M000075.html create mode 100644 doc/classes/RMail/Header.src/M000076.html create mode 100644 doc/classes/RMail/Header.src/M000077.html create mode 100644 doc/classes/RMail/Header.src/M000078.html create mode 100644 doc/classes/RMail/Header.src/M000079.html create mode 100644 doc/classes/RMail/Header.src/M000080.html create mode 100644 doc/classes/RMail/Header.src/M000081.html create mode 100644 doc/classes/RMail/Header.src/M000082.html create mode 100644 doc/classes/RMail/Header.src/M000083.html create mode 100644 doc/classes/RMail/Header.src/M000084.html create mode 100644 doc/classes/RMail/Header.src/M000085.html create mode 100644 doc/classes/RMail/Header.src/M000086.html create mode 100644 doc/classes/RMail/Header.src/M000087.html create mode 100644 doc/classes/RMail/Header.src/M000088.html create mode 100644 doc/classes/RMail/Header.src/M000089.html create mode 100644 doc/classes/RMail/Header.src/M000090.html create mode 100644 doc/classes/RMail/Header.src/M000091.html create mode 100644 doc/classes/RMail/Header.src/M000092.html create mode 100644 doc/classes/RMail/Header.src/M000093.html create mode 100644 doc/classes/RMail/Header.src/M000094.html create mode 100644 doc/classes/RMail/Header.src/M000095.html create mode 100644 doc/classes/RMail/Header.src/M000096.html create mode 100644 doc/classes/RMail/Header.src/M000097.html create mode 100644 doc/classes/RMail/Header.src/M000098.html create mode 100644 doc/classes/RMail/Header.src/M000099.html create mode 100644 doc/classes/RMail/Header.src/M000100.html create mode 100644 doc/classes/RMail/Header.src/M000101.html create mode 100644 doc/classes/RMail/Header.src/M000102.html create mode 100644 doc/classes/RMail/Header.src/M000103.html create mode 100644 doc/classes/RMail/Mailbox.html create mode 100644 doc/classes/RMail/Mailbox.src/M000001.html create mode 100644 doc/classes/RMail/Mailbox/MBoxReader.html create mode 100644 doc/classes/RMail/Mailbox/MBoxReader.src/M000002.html create mode 100644 doc/classes/RMail/Mailbox/MBoxReader.src/M000003.html create mode 100644 doc/classes/RMail/Mailbox/MBoxReader.src/M000004.html create mode 100644 doc/classes/RMail/Mailbox/MBoxReader.src/M000005.html create mode 100644 doc/classes/RMail/Mailbox/MBoxReader.src/M000006.html create mode 100644 doc/classes/RMail/Message.html create mode 100644 doc/classes/RMail/Message.src/M000010.html create mode 100644 doc/classes/RMail/Message.src/M000011.html create mode 100644 doc/classes/RMail/Message.src/M000012.html create mode 100644 doc/classes/RMail/Message.src/M000013.html create mode 100644 doc/classes/RMail/Message.src/M000014.html create mode 100644 doc/classes/RMail/Message.src/M000015.html create mode 100644 doc/classes/RMail/Message.src/M000016.html create mode 100644 doc/classes/RMail/Message.src/M000017.html create mode 100644 doc/classes/RMail/Message.src/M000018.html create mode 100644 doc/classes/RMail/Message.src/M000019.html create mode 100644 doc/classes/RMail/Message.src/M000020.html create mode 100644 doc/classes/RMail/Message.src/M000021.html create mode 100644 doc/classes/RMail/Parser.html create mode 100644 doc/classes/RMail/Parser.src/M000023.html create mode 100644 doc/classes/RMail/Parser.src/M000024.html create mode 100644 doc/classes/RMail/Parser.src/M000025.html create mode 100644 doc/classes/RMail/Parser/Error.html create mode 100644 doc/classes/RMail/Serialize.html create mode 100644 doc/classes/RMail/Serialize.src/M000037.html create mode 100644 doc/classes/RMail/Serialize.src/M000038.html create mode 100644 doc/classes/RMail/Serialize.src/M000039.html create mode 100644 doc/classes/RMail/StreamHandler.html create mode 100644 doc/classes/RMail/StreamHandler.src/M000026.html create mode 100644 doc/classes/RMail/StreamHandler.src/M000027.html create mode 100644 doc/classes/RMail/StreamHandler.src/M000028.html create mode 100644 doc/classes/RMail/StreamHandler.src/M000029.html create mode 100644 doc/classes/RMail/StreamHandler.src/M000030.html create mode 100644 doc/classes/RMail/StreamHandler.src/M000031.html create mode 100644 doc/classes/RMail/StreamHandler.src/M000032.html create mode 100644 doc/classes/RMail/StreamHandler.src/M000033.html create mode 100644 doc/classes/RMail/StreamHandler.src/M000034.html create mode 100644 doc/classes/RMail/StreamHandler.src/M000035.html create mode 100644 doc/classes/RMail/StreamHandler.src/M000036.html create mode 100644 doc/classes/RMail/StreamParser.html create mode 100644 doc/classes/RMail/StreamParser.src/M000022.html create mode 100644 doc/classes/RMail/Utils.html create mode 100644 doc/classes/RMail/Utils.src/M000007.html create mode 100644 doc/classes/RMail/Utils.src/M000008.html create mode 100644 doc/classes/RMail/Utils.src/M000009.html create mode 100644 doc/created.rid create mode 100644 doc/files/NEWS.html create mode 100644 doc/files/README.html create mode 100644 doc/files/THANKS.html create mode 100644 doc/files/TODO.html create mode 100644 doc/files/guide/Intro_txt.html create mode 100644 doc/files/guide/MIME_txt.html create mode 100644 doc/files/guide/TableOfContents_txt.html create mode 100644 doc/files/lib/rmail/address_rb.html create mode 100644 doc/files/lib/rmail/header_rb.html create mode 100644 doc/files/lib/rmail/mailbox/mboxreader_rb.html create mode 100644 doc/files/lib/rmail/mailbox_rb.html create mode 100644 doc/files/lib/rmail/message_rb.html create mode 100644 doc/files/lib/rmail/parser/multipart_rb.html create mode 100644 doc/files/lib/rmail/parser/pushbackreader_rb.html create mode 100644 doc/files/lib/rmail/parser_rb.html create mode 100644 doc/files/lib/rmail/serialize_rb.html create mode 100644 doc/files/lib/rmail/utils_rb.html create mode 100644 doc/files/lib/rmail_rb.html create mode 100644 doc/fr_class_index.html create mode 100644 doc/fr_file_index.html create mode 100644 doc/fr_method_index.html create mode 100644 doc/index.html create mode 100644 doc/rdoc-style.css diff --git a/doc/classes/RMail.html b/doc/classes/RMail.html new file mode 100644 index 0000000..78f557d --- /dev/null +++ b/doc/classes/RMail.html @@ -0,0 +1,123 @@ + + + + + + Module: RMail + + + + + + + + + + + + +
+ Module RMail + + + + + + +
In: + +lib/rmail/utils.rb + +
+ +lib/rmail/serialize.rb + +
+ +lib/rmail/mailbox.rb + +
+ +lib/rmail/parser/pushbackreader.rb + +
+ +lib/rmail/parser/multipart.rb + +
+ +lib/rmail/address.rb + +
+ +lib/rmail/mailbox/mboxreader.rb + +
+ +lib/rmail/header.rb + +
+ +lib/rmail/message.rb + +
+ +lib/rmail/parser.rb + +
+ +lib/rmail.rb + +
+
+
+ + + + +

+The RMail module contains all of the RubyMail +classes, but has no useful API of its own. +

+

+See guide/Intro.txt for a +general overview of RubyMail. +

+
+ + + + + + + +
Classes and Modules
+ + + + + + \ No newline at end of file diff --git a/doc/classes/RMail/Address.html b/doc/classes/RMail/Address.html new file mode 100644 index 0000000..0adfd69 --- /dev/null +++ b/doc/classes/RMail/Address.html @@ -0,0 +1,447 @@ + + + + + + Class: RMail::Address + + + + + + + + + + + + +
+ Class RMail::Address + + + + + + + + + + +
In: + +lib/rmail/address.rb + +
+
Parent: +Object +
+
+ + + + +

+This class provides the following functionality: +

+ +
+ + + + +
Methods
+
+<=>    +address    +comments    +comments=    +display_name    +display_name=    +domain    +domain=    +eql?    +format    +hash    +local    +local=    +name    +new    +parse    +to_str    +
+ + + + + +
Classes and Modules
+ + + + +
Included modules
+
+ Comparable +
+ + + +
Public Class methods
+ + +
+ + +new(string = nil) + +
+
+

+Create a new address. If the string argument is not nil, it is +parsed for mail addresses and if one is found, it is used to initialize +this object. +

+
+ + +
+ + +parse(string) + +
+
+

+Given a string, this function attempts to extract mailing addresses from it +and returns an RMail::Address::List of +those addresses (RMail::Address::List is a +subclass of Array). +

+

+This is identical to using a RMail::Address::Parser directly like this: +

+
+ RMail::Address::Parser.new(string).parse
+
+
+ + +
Public Instance methods
+ + +
+ + +<=>(other) + +
+
+

+Compare this address with another based on the email address portion only +(any display name and comments are ignored). If the other object is not an +RMail::Address, it is coerced into a string with +its to_str method and then parsed into +an RMail::Address object. +

+
+ + +
+ + +hash() + +
+
+

+Return a hash value for this address. This is based solely on the email +address portion (any display name and comments are ignored). +

+
+ + +
+ + +eql?(other) + +
+
+

+Return true if the two objects are equal. Do this based solely on the email +address portion (any display name and comments are ignored). Fails if the +other object is not an RMail::Address object. +

+
+ + +
+ + +local() + +
+
+

+Retrieve the local portion of the mail address. This is the portion that +precedes the @ sign. +

+
+ + +
+ + +local=(l) + +
+
+

+Assign the local portion of the mail address. This is the portion that +precedes the @ sign. +

+
+ + +
+ + +display_name() + +
+
+

+Returns the display name of this address. The display name is present only +for "angle addr" style addresses such as: +

+
+  John Doe <johnd@example.net>
+
+

+In this case, the display name will be "John Doe". In particular +this old style address has no display name: +

+
+  bobs@example.net (Bob Smith)
+
+

+See also display_name=, #name +

+
+ + +
+ + +display_name=(str) + +
+
+

+Assign a display name to this address. See display_name for a definition of what this +is. +

+

+See also display_name +

+
+ + +
+ + +name() + +
+
+

+Returns a best guess at a display name for this email address. This +function first checks if the address has a true display name (see display_name) and returns it if so. +Otherwise, if the address has any comments, the last comment will be +returned. +

+

+In most cases, this will behave reasonably. For example, it will return +"Bob Smith" for this address: +

+
+  bobs@example.net (Bob Smith)
+
+

+See also display_name, #comments, #comments= +

+
+ + +
+ + +comments() + +
+
+

+Returns the comments in this address as an array of strings. +

+
+ + +
+ + +comments=(comments) + +
+
+

+Set the comments for this address. The comments argument can be a +string, or an array of strings. In either case, any existing comments are +replaced. +

+

+See also #comments, #name +

+
+ + +
+ + +domain() + +
+
+

+Retrieve to the domain portion of the mail address. This is the portion +after the @ sign. +

+
+ + +
+ + +domain=(domain) + +
+
+

+Assign a domain name to this address. This is the portion after the +@ sign. Any existing domain name will be changed. +

+
+ + +
+ + +address() + +
+
+

+Returns the email address portion of the address (i.e. without a display +name, angle addresses, or comments). +

+

+The string returned is not suitable for insertion into an e-mail. RFC2822 +quoting rules are not followed. The raw address is returned instead. +

+

+For example, if the local part requires quoting, this function will not +perform the quoting (see #format +for that). So this function can returns strings such as: +

+
+ "address with no quoting@example.net"
+
+

+See also #format +

+
+ + +
+ + +format() + +
+
+

+Return this address as a String formated as appropriate for insertion into +a mail message. +

+
+
+This method is also aliased as +to_str +
+ + +
+ +to_str() +
+
+

+Alias for #format +

+
+ + + \ No newline at end of file diff --git a/doc/classes/RMail/Address.src/M000104.html b/doc/classes/RMail/Address.src/M000104.html new file mode 100644 index 0000000..5652082 --- /dev/null +++ b/doc/classes/RMail/Address.src/M000104.html @@ -0,0 +1,28 @@ + + + + + +new (RMail::Address) + + + +
# File lib/rmail/address.rb, line 52
+    def initialize(string = nil)
+
+      @local = @domain = @comments = @display_name = nil
+
+      if string.kind_of?(String)
+        addrs = Address.parse(string)
+        if addrs.length > 0
+          @local = addrs[0].local
+          @domain = addrs[0].domain
+          @comments = addrs[0].comments
+          @display_name = addrs[0].display_name
+        end
+      else
+        raise ArgumentError unless string.nil?
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address.src/M000105.html b/doc/classes/RMail/Address.src/M000105.html new file mode 100644 index 0000000..d06544f --- /dev/null +++ b/doc/classes/RMail/Address.src/M000105.html @@ -0,0 +1,22 @@ + + + + + +<=> (RMail::Address) + + + +
# File lib/rmail/address.rb, line 74
+    def <=>(other)
+      if !other.kind_of?(RMail::Address)
+        other = RMail::Address.new(other.to_str)
+      end
+      cmp = (@local || '') <=> (other.local || '')
+      if cmp == 0
+        cmp = (@domain || '') <=> (other.domain || '')
+      end
+      return cmp
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address.src/M000106.html b/doc/classes/RMail/Address.src/M000106.html new file mode 100644 index 0000000..a7a68d9 --- /dev/null +++ b/doc/classes/RMail/Address.src/M000106.html @@ -0,0 +1,15 @@ + + + + + +hash (RMail::Address) + + + +
# File lib/rmail/address.rb, line 89
+    def hash
+      address.hash
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address.src/M000107.html b/doc/classes/RMail/Address.src/M000107.html new file mode 100644 index 0000000..7e67eaf --- /dev/null +++ b/doc/classes/RMail/Address.src/M000107.html @@ -0,0 +1,16 @@ + + + + + +eql? (RMail::Address) + + + +
# File lib/rmail/address.rb, line 97
+    def eql?(other)
+      raise TypeError unless other.kind_of?(RMail::Address)
+      @local.eql?(other.local) and @domain.eql?(other.domain)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address.src/M000108.html b/doc/classes/RMail/Address.src/M000108.html new file mode 100644 index 0000000..14ac528 --- /dev/null +++ b/doc/classes/RMail/Address.src/M000108.html @@ -0,0 +1,15 @@ + + + + + +local (RMail::Address) + + + +
# File lib/rmail/address.rb, line 104
+    def local
+      @local
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address.src/M000109.html b/doc/classes/RMail/Address.src/M000109.html new file mode 100644 index 0000000..5419b7f --- /dev/null +++ b/doc/classes/RMail/Address.src/M000109.html @@ -0,0 +1,16 @@ + + + + + +local= (RMail::Address) + + + +
# File lib/rmail/address.rb, line 110
+    def local=(l)
+      raise ArgumentError unless l.nil? || l.kind_of?(String)
+      @local = l
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address.src/M000110.html b/doc/classes/RMail/Address.src/M000110.html new file mode 100644 index 0000000..40bbbb7 --- /dev/null +++ b/doc/classes/RMail/Address.src/M000110.html @@ -0,0 +1,15 @@ + + + + + +display_name (RMail::Address) + + + +
# File lib/rmail/address.rb, line 126
+    def display_name
+      @display_name
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address.src/M000111.html b/doc/classes/RMail/Address.src/M000111.html new file mode 100644 index 0000000..8e2a4f2 --- /dev/null +++ b/doc/classes/RMail/Address.src/M000111.html @@ -0,0 +1,19 @@ + + + + + +display_name= (RMail::Address) + + + +
# File lib/rmail/address.rb, line 134
+    def display_name=(str)
+      unless str.nil? || str.kind_of?(String)
+        raise ArgumentError, 'not a string'
+      end
+      @display_name = str
+      @display_name = nil if @display_name == ''
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address.src/M000112.html b/doc/classes/RMail/Address.src/M000112.html new file mode 100644 index 0000000..de43d7f --- /dev/null +++ b/doc/classes/RMail/Address.src/M000112.html @@ -0,0 +1,15 @@ + + + + + +name (RMail::Address) + + + +
# File lib/rmail/address.rb, line 153
+    def name
+      @display_name || (@comments && @comments.last)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address.src/M000113.html b/doc/classes/RMail/Address.src/M000113.html new file mode 100644 index 0000000..7c6f600 --- /dev/null +++ b/doc/classes/RMail/Address.src/M000113.html @@ -0,0 +1,15 @@ + + + + + +comments (RMail::Address) + + + +
# File lib/rmail/address.rb, line 158
+    def comments
+      @comments
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address.src/M000114.html b/doc/classes/RMail/Address.src/M000114.html new file mode 100644 index 0000000..2abee05 --- /dev/null +++ b/doc/classes/RMail/Address.src/M000114.html @@ -0,0 +1,26 @@ + + + + + +comments= (RMail::Address) + + + +
# File lib/rmail/address.rb, line 167
+    def comments=(comments)
+      case comments
+      when nil
+        @comments = comments
+      when Array
+        @comments = comments
+      when String
+        @comments = [ comments ]
+      else
+        raise TypeError, "Argument to RMail::Address#comments= must be " +
+          "String, Array or nil, was #{comments.type}."
+      end
+      @comments.freeze
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address.src/M000115.html b/doc/classes/RMail/Address.src/M000115.html new file mode 100644 index 0000000..ce4f718 --- /dev/null +++ b/doc/classes/RMail/Address.src/M000115.html @@ -0,0 +1,15 @@ + + + + + +domain (RMail::Address) + + + +
# File lib/rmail/address.rb, line 184
+    def domain
+      @domain
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address.src/M000116.html b/doc/classes/RMail/Address.src/M000116.html new file mode 100644 index 0000000..a49a576 --- /dev/null +++ b/doc/classes/RMail/Address.src/M000116.html @@ -0,0 +1,20 @@ + + + + + +domain= (RMail::Address) + + + +
# File lib/rmail/address.rb, line 190
+    def domain=(domain)
+      @domain = if domain.nil? or domain == ''
+                  nil
+                else
+                  raise ArgumentError unless domain.kind_of?(String)
+                  domain.strip
+                end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address.src/M000117.html b/doc/classes/RMail/Address.src/M000117.html new file mode 100644 index 0000000..55660a1 --- /dev/null +++ b/doc/classes/RMail/Address.src/M000117.html @@ -0,0 +1,19 @@ + + + + + +address (RMail::Address) + + + +
# File lib/rmail/address.rb, line 213
+    def address
+      if @domain.nil?
+        @local
+      else
+        @local + '@' + @domain
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address.src/M000118.html b/doc/classes/RMail/Address.src/M000118.html new file mode 100644 index 0000000..d0d1df6 --- /dev/null +++ b/doc/classes/RMail/Address.src/M000118.html @@ -0,0 +1,57 @@ + + + + + +format (RMail::Address) + + + +
# File lib/rmail/address.rb, line 223
+    def format
+      display_name = if @display_name.nil?
+                       nil
+                     elsif @display_name =~ /^[-\/\w=!#\$%&'*+?^`{|}~ ]+$/
+                       @display_name
+                     else
+                       '"' + @display_name.gsub(/["\\]/, '\\\\\&') + '"'
+                     end
+      local = if (@local !~ /^[-\w=!#\$%&'*+?^`{|}~\.\/]+$/ ||
+                  @local =~ /^\./ ||
+                  @local =~ /\.$/ ||
+                  @local =~ /\.\./)
+                '"' + @local.gsub(/["\\]/, '\\\\\&') + '"'
+              else
+                @local
+              end
+      domain = if (!@domain.nil? and
+                   (@domain !~ /^[-\w=!#\$%&'*+?^`{|}~\.\/]+$/ ||
+                    @domain =~ /^\./ ||
+                    @domain =~ /\.$/ ||
+                    @domain =~ /\.\./))
+               then
+                 '[' + if @domain =~ /^\[(.*)\]$/
+                         $1
+                       else
+                         @domain
+                       end.gsub(/[\[\]\\]/, '\\\\\&') + ']'
+               else
+                 @domain
+               end
+      address = if domain.nil?
+                  local
+                elsif !display_name.nil? or domain[-1] == ?]
+                  '<' + local + '@' + domain + '>'
+                else
+                  local + '@' + domain
+                end
+      comments = nil
+      comments = unless @comments.nil?
+                   @comments.collect { |c|
+          '(' + c.gsub(/[()\\]/, '\\\\\&') + ')'
+        }.join(' ')
+                 end
+      [display_name, address, comments].compact.join(' ')
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address.src/M000120.html b/doc/classes/RMail/Address.src/M000120.html new file mode 100644 index 0000000..32ac991 --- /dev/null +++ b/doc/classes/RMail/Address.src/M000120.html @@ -0,0 +1,15 @@ + + + + + +parse (RMail::Address) + + + +
# File lib/rmail/address.rb, line 776
+    def Address.parse(string)
+      Parser.new(string).parse
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address/List.html b/doc/classes/RMail/Address/List.html new file mode 100644 index 0000000..ee7cfe7 --- /dev/null +++ b/doc/classes/RMail/Address/List.html @@ -0,0 +1,171 @@ + + + + + + Class: RMail::Address::List + + + + + + + + + + + + +
+ Class RMail::Address::List + + + + + + + + + + +
In: + +lib/rmail/address.rb + +
+
Parent: +Array +
+
+ + + + +

+RMail::Address::List is a simple subclass of the +Array class that provides convenience methods for accessing the RMail::Address objects it contains. +

+
+ + + + +
Methods
+
+addresses    +display_names    +domains    +format    +locals    +names    +
+ + + + + + + +
Public Instance methods
+ + +
+ + +locals() + +
+
+

+Returns an array of strings — the result of calling +RMail::Address#local on each element of the list. +

+
+ + +
+ + +display_names() + +
+
+

+Returns an array of strings — the result of calling +RMail::Address#display_name on each element of the list. +

+
+ + +
+ + +names() + +
+
+

+Returns an array of strings — the result of calling +RMail::Address#name on each element of the list. +

+
+ + +
+ + +domains() + +
+
+

+Returns an array of strings — the result of calling +RMail::Address#domain on each element of the list. +

+
+ + +
+ + +addresses() + +
+
+

+Returns an array of strings — the result of calling +RMail::Address#address on each element of the list. +

+
+ + +
+ + +format() + +
+
+

+Returns an array of strings — the result of calling +RMail::Address#format on each element of the list. +

+
+ + + \ No newline at end of file diff --git a/doc/classes/RMail/Address/List.src/M000123.html b/doc/classes/RMail/Address/List.src/M000123.html new file mode 100644 index 0000000..3400178 --- /dev/null +++ b/doc/classes/RMail/Address/List.src/M000123.html @@ -0,0 +1,15 @@ + + + + + +locals (RMail::Address::List) + + + +
# File lib/rmail/address.rb, line 787
+      def locals
+        collect { |a| a.local }
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address/List.src/M000124.html b/doc/classes/RMail/Address/List.src/M000124.html new file mode 100644 index 0000000..241b99a --- /dev/null +++ b/doc/classes/RMail/Address/List.src/M000124.html @@ -0,0 +1,15 @@ + + + + + +display_names (RMail::Address::List) + + + +
# File lib/rmail/address.rb, line 793
+      def display_names
+        collect { |a| a.display_name }
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address/List.src/M000125.html b/doc/classes/RMail/Address/List.src/M000125.html new file mode 100644 index 0000000..66e17c6 --- /dev/null +++ b/doc/classes/RMail/Address/List.src/M000125.html @@ -0,0 +1,15 @@ + + + + + +names (RMail::Address::List) + + + +
# File lib/rmail/address.rb, line 799
+      def names
+        collect { |a| a.name }
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address/List.src/M000126.html b/doc/classes/RMail/Address/List.src/M000126.html new file mode 100644 index 0000000..5aa575f --- /dev/null +++ b/doc/classes/RMail/Address/List.src/M000126.html @@ -0,0 +1,15 @@ + + + + + +domains (RMail::Address::List) + + + +
# File lib/rmail/address.rb, line 805
+      def domains
+        collect { |a| a.domain }
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address/List.src/M000127.html b/doc/classes/RMail/Address/List.src/M000127.html new file mode 100644 index 0000000..9cba2eb --- /dev/null +++ b/doc/classes/RMail/Address/List.src/M000127.html @@ -0,0 +1,15 @@ + + + + + +addresses (RMail::Address::List) + + + +
# File lib/rmail/address.rb, line 811
+      def addresses
+        collect { |a| a.address }
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address/List.src/M000128.html b/doc/classes/RMail/Address/List.src/M000128.html new file mode 100644 index 0000000..d92b42f --- /dev/null +++ b/doc/classes/RMail/Address/List.src/M000128.html @@ -0,0 +1,15 @@ + + + + + +format (RMail::Address::List) + + + +
# File lib/rmail/address.rb, line 817
+      def format
+        collect { |a| a.format }
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address/Parser.html b/doc/classes/RMail/Address/Parser.html new file mode 100644 index 0000000..f22119d --- /dev/null +++ b/doc/classes/RMail/Address/Parser.html @@ -0,0 +1,123 @@ + + + + + + Class: RMail::Address::Parser + + + + + + + + + + + + +
+ Class RMail::Address::Parser + + + + + + + + + + +
In: + +lib/rmail/address.rb + +
+
Parent: +Object +
+
+ + + + +

+This class provides a facility to parse a string containing one or more +RFC2822 addresses into an array of RMail::Address objects. You can use it directly, +but it is more conveniently used with the RMail::Address.parse method. +

+
+ + + + +
Methods
+
+new    +parse    +
+ + + + + + + +
Public Class methods
+ + +
+ + +new(string) + +
+
+

+Create a RMail::Address::Parser object that will +parse string. See also the RMail::Address.parse method. +

+
+ + +
Public Instance methods
+ + +
+ + +parse() + +
+
+

+This function attempts to extract mailing addresses from the string passed +to #new. The function returns an RMail::Address::List of RMail::Address objects (RMail::Address::List is a subclass of Array). A +malformed input string will not generate an exception. Instead, the array +returned will simply not contained the malformed addresses. +

+

+The string is expected to be in a valid format as documented in +RFC2822’s mailbox-list grammar. This will work for lists of addresses +in the To:, From:, etc. headers in email. +

+
+ + + \ No newline at end of file diff --git a/doc/classes/RMail/Address/Parser.src/M000121.html b/doc/classes/RMail/Address/Parser.src/M000121.html new file mode 100644 index 0000000..c80be2b --- /dev/null +++ b/doc/classes/RMail/Address/Parser.src/M000121.html @@ -0,0 +1,15 @@ + + + + + +new (RMail::Address::Parser) + + + +
# File lib/rmail/address.rb, line 280
+      def initialize(string)
+        @string = string
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Address/Parser.src/M000122.html b/doc/classes/RMail/Address/Parser.src/M000122.html new file mode 100644 index 0000000..65091fa --- /dev/null +++ b/doc/classes/RMail/Address/Parser.src/M000122.html @@ -0,0 +1,25 @@ + + + + + +parse (RMail::Address::Parser) + + + +
# File lib/rmail/address.rb, line 296
+      def parse
+        @lexemes = []
+        @tokens = []
+        @addresses = RMail::Address::List.new
+        @errors = 0
+        new_address
+        get
+        address_list
+        reset_errors
+        @addresses.delete_if { |a|
+          !a.local || !a.domain
+        }
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.html b/doc/classes/RMail/Header.html new file mode 100644 index 0000000..612c663 --- /dev/null +++ b/doc/classes/RMail/Header.html @@ -0,0 +1,1340 @@ + + + + + + Class: RMail::Header + + + + + + + + + + + + +
+ Class RMail::Header + + + + + + + + + + +
In: + +lib/rmail/header.rb + +
+
Parent: +Object +
+
+ + + + +

Overview

+

+The RMail::Header class supports the creation and +manipulation of RFC2822 mail headers. +

+

+A mail header is a little bit like a Hash. The fields are keyed by a string +field name. It is also a little bit like an Array, since the fields are in +a specific order. This class provides many of the methods of both the Hash +and Array class. It also includes the Enumerable module. +

+

Terminology

+ + + + + +
header:The entire header. Each RMail::Header object is +one mail header. + +
field:An element of the header. Fields have a name and a value. For example, the +field "Subject: Hi Mom!" has a name of "Subject" and a +value of "Hi Mom!" + +
name:A name of a field. For example: "Subject" or "From". + +
value:The value of a field. + +
+

Conventions

+

+The header’s fields are stored in a particular order. Methods such as +#each process the headers in this order. +

+

+When field names or values are added to the object they are frozen. This +helps prevent accidental modification to what is stored in the object. +

+
+ + + + +
Methods
+
+==    +[]    +[]=    +add    +add_message_id    +add_raw    +address_list_assign    +address_list_fetch    +bcc    +bcc=    +cc    +cc=    +clear    +clone    +content_type    +date    +date=    +delete    +delete_at    +delete_if    +dup    +each    +each_key    +each_name    +each_pair    +each_value    +empty?    +fetch    +fetch_all    +field?    +from    +from=    +has_key?    +include?    +key?    +keys    +length    +match    +match?    +mbox_from    +mbox_from=    +media_type    +member?    +message_id    +names    +new    +param    +params    +recipients    +replace    +reply_to    +reply_to=    +select    +set    +set_boundary    +size    +subject    +subject=    +subtype    +to    +to=    +to_a    +to_s    +to_string    +
+ + + + +
Attributes
+ + + + + + +
fields [RW] 
+ + + + +
Included modules
+
+ Enumerable +
+ + + +
Public Class methods
+ + +
+ + +new() + +
+
+

+Creates a new empty header object. +

+
+ + +
Public Instance methods
+ + +
+ + +[](name_or_index) + +
+
+

+Return the value of the first matching field of a field name, or nil if +none found. If passed a Fixnum, returns the header indexed by the number. +

+
+ + +
+ + +dup() + +
+
+

+Creates a copy of this header object. A new RMail::Header is created and the instance data is +copied over. However, the new object will still reference the same strings +held in the original object. Since these strings are frozen, this usually +won’t matter. +

+
+ + +
+ + +clone() + +
+
+

+Creates a complete copy of this header object, including any singleton +methods and strings. The returned object will be a complete and unrelated +duplicate of the original. +

+
+ + +
+ + +clear() + +
+
+

+Delete all fields in this object. Returns self. +

+
+ + +
+ + +replace(other) + +
+
+

+Replaces the contents of this header with that of another header object. +Returns self. +

+
+ + +
+ + +length() + +
+
+

+Return the number of fields in this object. +

+
+
+This method is also aliased as +size +
+ + +
+ +size() +
+
+

+Alias for #length +

+
+ + +
+ + +fetch(name, *rest) {|name| ...} + +
+
+

+Return the value of the first matching field of a given name. If there is +no such field, the value returned by the supplied block is returned. If no +block is passed, the value of default_value is returned. If no +default_value is specified, an IndexError exception is raised. +

+
+ + +
+ + +fetch_all(name, *rest) {|name| ...} + +
+
+

+Returns the values of every field named name. If there are no such +fields, the value returned by the block is returned. If no block is passed, +the value of default_value is returned. If no +default_value is specified, an IndexError exception is raised. +

+
+ + +
+ + +field?(name) + +
+
+

+Returns true if the message has a field named ‘name’. +

+
+
+This method is also aliased as +member? +include? +has_key? +key? +
+ + +
+ +member?(name) +
+
+

+Alias for #field? +

+
+ + +
+ +include?(name) +
+
+

+Alias for #field? +

+
+ + +
+ +has_key?(name) +
+
+

+Alias for #field? +

+
+ + +
+ +key?(name) +
+
+

+Alias for #field? +

+
+ + +
+ + +delete(name) + +
+
+

+Deletes all fields with name. Returns self. +

+
+ + +
+ + +delete_at(index) + +
+
+

+Deletes the field at the specified index and returns its value. +

+
+ + +
+ + +delete_if() {|name, value| ...} + +
+
+

+Deletes the field if the passed block returns true. Returns self. +

+
+ + +
+ + +each() {|name, value| ...} + +
+
+

+Executes block once for each field in the header, passing the key and value +as parameters. +

+

+Returns self. +

+
+
+This method is also aliased as +each_pair +
+ + +
+ +each_pair() +
+
+

+Alias for #each +

+
+ + +
+ + +each_name() {|i.name| ...} + +
+
+

+Executes block once for each field in the header, passing the field’s +name as a parameter. +

+

+Returns self +

+
+
+This method is also aliased as +each_key +
+ + +
+ +each_key() +
+
+

+Alias for #each_name +

+
+ + +
+ + +each_value() {|i.value| ...} + +
+
+

+Executes block once for each field in the header, passing the field’s +value as a parameter. +

+

+Returns self +

+
+ + +
+ + +empty?() + +
+
+

+Returns true if the header contains no fields +

+
+ + +
+ + +select(*names) + +
+
+

+Returns an array of pairs [ name, value ] for all fields with one of the +names passed. +

+
+ + +
+ + +names() + +
+
+

+Returns an array consisting of the names of every field in this header. +

+
+
+This method is also aliased as +keys +
+ + +
+ +keys() +
+
+

+Alias for #names +

+
+ + +
+ + +add(name, value, index = nil, params = nil) + +
+
+

+Add a new field with name and value. When index +is nil (the default if not specified) the line is appended to the header, +otherwise it is inserted at the specified index. E.g. an index of +0 will prepend the header line. +

+

+You can pass additional parameters for the header as a hash table +params. Every key of the hash will be the name of the parameter, +and every key’s value the parameter value. +

+

+E.g. +

+
+   header.add('Content-Type', 'multipart/mixed', nil,
+              'boundary' => 'the boundary')
+
+

+will add this header +

+
+   Content-Type: multipart/mixed; boundary="the boundary"
+
+

+Always returns self. +

+
+ + +
+ + +add_raw(raw) + +
+
+

+Add a new field as a raw string together with a parsed name/value. This +method is used mainly by the parser and regular programs should stick to #add. +

+
+ + +
+ + +set(name, value, params = nil) + +
+
+

+First delete any fields with name, then append a new field with +name, value, and params as in #add. +

+
+ + +
+ + +[]=(name, value) + +
+
+

+Append a new field with name and value. If you want +control of where the field is inserted, see #add. +

+

+Returns value. +

+
+ + +
+ + +==(other) + +
+
+

+Returns true if the two objects have the same number of fields, in the same +order, with the same values. +

+
+ + +
+ + +to_a() + +
+
+

+Returns a new array holding one [ name, value ] array per field in the +header. +

+
+ + +
+ + +to_s() + +
+
+

+Converts the header to a string, including any mbox from line. Equivalent +to header.to_string(true). +

+
+ + +
+ + +to_string(mbox_from = false) + +
+
+

+Converts the header to a string. If mbox_from is true, then the mbox from +line is also included. +

+
+ + +
+ + +match?(name, value) + +
+
+

+Determine if there is any fields that match the given name and +value. +

+

+If name is a String, all fields of that name are tested. If +name is a Regexp the field names are matched against the regexp +(the field names are converted to lower case first). Use the regexp // if +you want to test all field names. +

+

+If value is a String, it is converted to a case insensitive Regexp +that matches the string. Otherwise, it must be a Regexp. Note that the +field value may be folded across many lines, so you should use a multi-line +Regexp. Also consider using a case insensitive Regexp. Use the regexp // if +you want to match all possible field values. +

+

+Returns true if there is a match, false otherwise. +

+

+Example: +

+
+   if h.match?('x-ml-name', /ruby-dev/im)
+     # do something
+   end
+
+

+See also: #match +

+
+ + +
+ + +match(name, value) + +
+
+

+Find all fields that match the given +name and value. +

+

+If name is a String, all fields of that name are tested. If +name is a Regexp, the field names are matched against the regexp +(the field names are converted to lower case first). Use the regexp // if +you want to test all field names. +

+

+If value is a String, it is converted to a case insensitive Regexp +that matches the string. Otherwise, it must be a Regexp. Note that the +field value may be folded across many lines, so you may need to use a +multi-line Regexp. Also consider using a case insensitive Regexp. Use the +regexp // if you want to match all possible field values. +

+

+Returns a new RMail::Header holding all matching +headers. +

+

+Examples: +

+
+ received = header.match('Received', //)
+ destinations = header.match(/^(to|cc|bcc)$/, //)
+ bigfoot_received = header.match('received',
+                                 /from.*by.*bigfoot\.com.*LiteMail/im)
+
+

+See also: #match? +

+
+ + +
+ + +mbox_from=(value) + +
+
+

+Sets the "From " line commonly used in the Unix mbox mailbox +format. The value supplied should be the entire "From " +line. +

+
+ + +
+ + +mbox_from() + +
+
+

+Gets the "From " line previously set with mbox_from=, or nil. +

+
+ + +
+ + +content_type(default = nil) {|| ...} + +
+
+

+This returns the full content type of this message converted to lower case. +

+

+If there is no content type header, returns the passed block is executed +and its return value is returned. If no block is passed, the value of the +default argument is returned. +

+
+ + +
+ + +media_type(default = nil) {|| ...} + +
+
+

+This returns the main media type for this message converted to lower case. +This is the first portion of the content type. E.g. a content type of +text/plain has a media type of text. +

+

+If there is no content type field, returns the passed block is executed and +its return value is returned. If no block is passed, the value of the +default argument is returned. +

+
+ + +
+ + +subtype(default = nil) {|| ...} + +
+
+

+This returns the media subtype for this message, converted to lower case. +This is the second portion of the content type. E.g. a content type of +text/plain has a media subtype of plain. +

+

+If there is no content type field, returns the passed block is executed and +its return value is returned. If no block is passed, the value of the +default argument is returned. +

+
+ + +
+ + +params(field_name, default = nil) {|field_name| ...} + +
+
+

+This returns a hash of parameters. Each key in the hash is the name of the +parameter in lower case and each value in the hash is the unquoted +parameter value. If a parameter has no value, its value in the hash will be +true. +

+

+If the field or parameter does not exist or it is malformed in a way that +makes it impossible to parse, then the passed block is executed and its +return value is returned. If no block is passed, the value of the +default argument is returned. +

+
+ + +
+ + +param(field_name, param_name, default = nil) {|field_name, param_name| ...} + +
+
+

+This returns the parameter value for the given parameter in the given +field. The value returned is unquoted. +

+

+If the field or parameter does not exist or it is malformed in a way that +makes it impossible to parse, then the passed block is executed and its +return value is returned. If no block is passed, the value of the +default argument is returned. +

+
+ + +
+ + +set_boundary(boundary) + +
+
+

+Set the boundary parameter of this message’s Content-Type: field. +

+
+ + +
+ + +date() + +
+
+

+Return the value of the Date: field, parsed into a Time object. Returns nil +if there is no Date: field or the field value could not be parsed. +

+
+ + +
+ + +date=(time) + +
+
+

+Deletes any existing Date: fields and appends a new one corresponding to +the given Time object. +

+
+ + +
+ + +from() + +
+
+

+Returns the value of the From: header as an Array of RMail::Address objects. +

+

+See #address_list_fetch for details on +what is returned. +

+

+This method does not return a single RMail::Address value because it is legal to have +multiple addresses in a From: header. +

+

+This method always returns at least the empty list. So if you are always +only interested in the first from address (most likely the case), you can +safely say: +

+
+   header.from.first
+
+
+ + +
+ + +from=(addresses) + +
+
+

+Sets the From: field to the supplied address or addresses. +

+

+See #address_list_assign for information +on valid values for addresses. +

+

+Note that the From: header usually contains only one address, but it is +legal to have more than one. +

+
+ + +
+ + +to() + +
+
+

+Returns the value of the To: field as an Array of RMail::Address objects. +

+

+See #address_list_fetch for details on +what is returned. +

+
+ + +
+ + +to=(addresses) + +
+
+

+Sets the To: field to the supplied address or addresses. +

+

+See #address_list_assign for information +on valid values for addresses. +

+
+ + +
+ + +cc() + +
+
+

+Returns the value of the Cc: field as an Array of RMail::Address objects. +

+

+See #address_list_fetch for details on +what is returned. +

+
+ + +
+ + +cc=(addresses) + +
+
+

+Sets the Cc: field to the supplied address or addresses. +

+

+See #address_list_assign for information +on valid values for addresses. +

+
+ + +
+ + +bcc() + +
+
+

+Returns the value of the Bcc: field as an Array of RMail::Address objects. +

+

+See #address_list_fetch for details on +what is returned. +

+
+ + +
+ + +bcc=(addresses) + +
+
+

+Sets the Bcc: field to the supplied address or addresses. +

+

+See #address_list_assign for information +on valid values for addresses. +

+
+ + +
+ + +reply_to() + +
+
+

+Returns the value of the Reply-To: header as an Array of RMail::Address objects. +

+
+ + +
+ + +reply_to=(addresses) + +
+
+

+Sets the Reply-To: field to the supplied address or addresses. +

+

+See #address_list_assign for information +on valid values for addresses. +

+
+ + +
+ + +message_id() + +
+
+

+Returns the value of this object’s Message-Id: field. +

+
+ + +
+ + +add_message_id(fqdn = nil) + +
+
+

+Sets the value of this object’s Message-Id: field to a new random value. +

+

+If you don’t supply a fqdn (fully qualified domain name) +then one will be randomly generated for you. If a valid address exists in +the From: field, its domain will be used as a basis. +

+

+Part of the randomness in the header is taken from the header itself, so it +is best to call this method after adding other fields to the header — +especially those that make it unique (Subject:, To:, Cc:, etc). +

+
+ + +
+ + +subject() + +
+
+

+Return the subject of this message. +

+
+ + +
+ + +subject=(string) + +
+
+

+Set the subject of this message +

+
+ + +
+ + +recipients() + +
+
+

+Returns an RMail::Address::List array +holding all the recipients of this message. This uses the contents of the +To, Cc, and Bcc fields. Duplicate addresses are eliminated. +

+
+ + +
+ + +address_list_fetch(field_name) + +
+
+

+Retrieve a given field’s value as an RMail::Address::List of RMail::Address objects. +

+

+This method is used to implement many of the convenience methods such as #from, #to, etc. +

+
+ + +
+ + +address_list_assign(field_name, addresses) + +
+
+

+Set a given field to a list of supplied addresses. +

+

+The addresses may be a String, RMail::Address, or Array. If a String, it is parsed +for valid email addresses and those found are used. If an RMail::Address, the result of RMail::Address#format +is used. If an Array, each element of the array must be either a String or +RMail::Address and is treated as above. +

+

+This method is used to implement many of the convenience methods such as #from=, #to=, etc. +

+
+ + + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000040.html b/doc/classes/RMail/Header.src/M000040.html new file mode 100644 index 0000000..0589c55 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000040.html @@ -0,0 +1,15 @@ + + + + + +new (RMail::Header) + + + +
# File lib/rmail/header.rb, line 131
+    def initialize()
+      clear()
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000041.html b/doc/classes/RMail/Header.src/M000041.html new file mode 100644 index 0000000..4fd7dad --- /dev/null +++ b/doc/classes/RMail/Header.src/M000041.html @@ -0,0 +1,24 @@ + + + + + +[] (RMail::Header) + + + +
# File lib/rmail/header.rb, line 138
+    def [](name_or_index)
+      if name_or_index.kind_of? Fixnum
+        temp = @fields[name_or_index]
+        temp = temp.value unless temp.nil?
+      else
+        name = Field.name_canonicalize(name_or_index)
+        result = detect { |n, v|
+          if n.downcase == name then true else false end
+        }
+        if result.nil? then nil else result[1] end
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000042.html b/doc/classes/RMail/Header.src/M000042.html new file mode 100644 index 0000000..ff66f50 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000042.html @@ -0,0 +1,18 @@ + + + + + +dup (RMail::Header) + + + +
# File lib/rmail/header.rb, line 156
+    def dup
+      h = super
+      h.fields = @fields.dup
+      h.mbox_from = @mbox_from
+      h
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000043.html b/doc/classes/RMail/Header.src/M000043.html new file mode 100644 index 0000000..bea52f6 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000043.html @@ -0,0 +1,18 @@ + + + + + +clone (RMail::Header) + + + +
# File lib/rmail/header.rb, line 166
+    def clone
+      h = super
+      h.fields = Marshal::load(Marshal::dump(@fields))
+      h.mbox_from = Marshal::load(Marshal::dump(@mbox_from))
+      h
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000044.html b/doc/classes/RMail/Header.src/M000044.html new file mode 100644 index 0000000..1872e8f --- /dev/null +++ b/doc/classes/RMail/Header.src/M000044.html @@ -0,0 +1,17 @@ + + + + + +clear (RMail::Header) + + + +
# File lib/rmail/header.rb, line 174
+    def clear()
+      @fields = []
+      @mbox_from = nil
+      self
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000045.html b/doc/classes/RMail/Header.src/M000045.html new file mode 100644 index 0000000..e8d1b56 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000045.html @@ -0,0 +1,21 @@ + + + + + +replace (RMail::Header) + + + +
# File lib/rmail/header.rb, line 182
+    def replace(other)
+      unless other.kind_of?(RMail::Header)
+        raise TypeError, "#{other.class.to_s} is not of type RMail::Header"
+      end
+      temp = other.dup
+      @fields = temp.fields
+      @mbox_from = temp.mbox_from
+      self
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000046.html b/doc/classes/RMail/Header.src/M000046.html new file mode 100644 index 0000000..12d1774 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000046.html @@ -0,0 +1,15 @@ + + + + + +length (RMail::Header) + + + +
# File lib/rmail/header.rb, line 193
+    def length
+      @fields.length
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000048.html b/doc/classes/RMail/Header.src/M000048.html new file mode 100644 index 0000000..5124d75 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000048.html @@ -0,0 +1,29 @@ + + + + + +fetch (RMail::Header) + + + +
# File lib/rmail/header.rb, line 203
+    def fetch(name, *rest)
+      if rest.length > 1
+        raise ArgumentError, "wrong # of arguments(#{rest.length + 1} for 2)"
+      end
+      result = self[name]
+      if result.nil?
+        if block_given?
+          yield name
+        elsif rest.length == 1
+          rest[0]
+        else
+          raise IndexError, 'name not found'
+        end
+      else
+        result
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000049.html b/doc/classes/RMail/Header.src/M000049.html new file mode 100644 index 0000000..a5edfa0 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000049.html @@ -0,0 +1,31 @@ + + + + + +fetch_all (RMail::Header) + + + +
# File lib/rmail/header.rb, line 226
+    def fetch_all name, *rest
+      if rest.length > 1
+        raise ArgumentError, "wrong # of arguments(#{rest.length + 1} for 2)"
+      end
+      result = select(name)
+      if result.nil?
+        if block_given?
+          yield name
+        elsif rest.length == 1
+          rest[0]
+        else
+          raise IndexError, 'name not found'
+        end
+      else
+        result.collect { |n, v|
+          v
+        }
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000050.html b/doc/classes/RMail/Header.src/M000050.html new file mode 100644 index 0000000..9413156 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000050.html @@ -0,0 +1,15 @@ + + + + + +field? (RMail::Header) + + + +
# File lib/rmail/header.rb, line 247
+    def field?(name)
+      ! self[name].nil?
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000055.html b/doc/classes/RMail/Header.src/M000055.html new file mode 100644 index 0000000..a8909a4 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000055.html @@ -0,0 +1,19 @@ + + + + + +delete (RMail::Header) + + + +
# File lib/rmail/header.rb, line 256
+    def delete(name)
+      name = Field.name_canonicalize(name.to_str)
+      delete_if { |n, v|
+        n.downcase == name
+      }
+      self
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000056.html b/doc/classes/RMail/Header.src/M000056.html new file mode 100644 index 0000000..a4dbcdb --- /dev/null +++ b/doc/classes/RMail/Header.src/M000056.html @@ -0,0 +1,16 @@ + + + + + +delete_at (RMail::Header) + + + +
# File lib/rmail/header.rb, line 265
+    def delete_at(index)
+      @fields[index, 1] = nil
+      self
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000057.html b/doc/classes/RMail/Header.src/M000057.html new file mode 100644 index 0000000..7345283 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000057.html @@ -0,0 +1,18 @@ + + + + + +delete_if (RMail::Header) + + + +
# File lib/rmail/header.rb, line 272
+    def delete_if # yields: name, value
+      @fields.delete_if { |i|
+        yield i.name, i.value
+      }
+      self
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000058.html b/doc/classes/RMail/Header.src/M000058.html new file mode 100644 index 0000000..ff86e14 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000058.html @@ -0,0 +1,17 @@ + + + + + +each (RMail::Header) + + + +
# File lib/rmail/header.rb, line 283
+    def each                    # yields: name, value
+      @fields.each { |i|
+        yield(i.name, i.value)
+      }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000060.html b/doc/classes/RMail/Header.src/M000060.html new file mode 100644 index 0000000..8217ca6 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000060.html @@ -0,0 +1,17 @@ + + + + + +each_name (RMail::Header) + + + +
# File lib/rmail/header.rb, line 294
+    def each_name
+      @fields.each { |i|
+        yield(i.name)
+      }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000062.html b/doc/classes/RMail/Header.src/M000062.html new file mode 100644 index 0000000..bb80132 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000062.html @@ -0,0 +1,17 @@ + + + + + +each_value (RMail::Header) + + + +
# File lib/rmail/header.rb, line 305
+    def each_value
+      @fields.each { |i|
+        yield(i.value)
+      }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000063.html b/doc/classes/RMail/Header.src/M000063.html new file mode 100644 index 0000000..a128a6f --- /dev/null +++ b/doc/classes/RMail/Header.src/M000063.html @@ -0,0 +1,15 @@ + + + + + +empty? (RMail::Header) + + + +
# File lib/rmail/header.rb, line 312
+    def empty?
+      @fields.empty?
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000064.html b/doc/classes/RMail/Header.src/M000064.html new file mode 100644 index 0000000..4d4f28f --- /dev/null +++ b/doc/classes/RMail/Header.src/M000064.html @@ -0,0 +1,22 @@ + + + + + +select (RMail::Header) + + + +
# File lib/rmail/header.rb, line 318
+    def select(*names)
+      result = []
+      names.each { |name|
+        name = Field.name_canonicalize(name)
+        result.concat(find_all { |n, v|
+                        n.downcase == name
+                      })
+      }
+      result
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000065.html b/doc/classes/RMail/Header.src/M000065.html new file mode 100644 index 0000000..d261171 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000065.html @@ -0,0 +1,17 @@ + + + + + +names (RMail::Header) + + + +
# File lib/rmail/header.rb, line 331
+    def names
+      collect { |n, v|
+        n
+      }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000067.html b/doc/classes/RMail/Header.src/M000067.html new file mode 100644 index 0000000..6923cb2 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000067.html @@ -0,0 +1,36 @@ + + + + + +add (RMail::Header) + + + +
# File lib/rmail/header.rb, line 357
+    def add(name, value, index = nil, params = nil)
+      value = value.to_str
+      if params
+        value = value.dup
+        sep = "; "
+        params.each do |n, v|
+          value << sep
+          value << n.to_s
+          value << '='
+          v = v.to_s
+          if v =~ /^\w+$/
+            value << v
+          else
+            value << '"'
+            value << v
+            value << '"'
+          end
+        end
+      end
+      field = Field.new(name, value)
+      index ||= @fields.length
+      @fields[index, 0] = field
+      self
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000068.html b/doc/classes/RMail/Header.src/M000068.html new file mode 100644 index 0000000..5f040f3 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000068.html @@ -0,0 +1,16 @@ + + + + + +add_raw (RMail::Header) + + + +
# File lib/rmail/header.rb, line 385
+    def add_raw(raw)
+      @fields << Field.new(raw)
+      self
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000069.html b/doc/classes/RMail/Header.src/M000069.html new file mode 100644 index 0000000..48b501b --- /dev/null +++ b/doc/classes/RMail/Header.src/M000069.html @@ -0,0 +1,16 @@ + + + + + +set (RMail::Header) + + + +
# File lib/rmail/header.rb, line 392
+    def set(name, value, params = nil)
+      delete(name)
+      add(name, value, nil, params)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000070.html b/doc/classes/RMail/Header.src/M000070.html new file mode 100644 index 0000000..a106c5e --- /dev/null +++ b/doc/classes/RMail/Header.src/M000070.html @@ -0,0 +1,16 @@ + + + + + +[]= (RMail::Header) + + + +
# File lib/rmail/header.rb, line 401
+    def []=(name, value)
+      add(name, value)
+      value
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000071.html b/doc/classes/RMail/Header.src/M000071.html new file mode 100644 index 0000000..3b9eec9 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000071.html @@ -0,0 +1,17 @@ + + + + + +== (RMail::Header) + + + +
# File lib/rmail/header.rb, line 408
+    def ==(other)
+      return other.kind_of?(self.class) &&
+        @fields == other.fields &&
+        @mbox_from == other.mbox_from
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000072.html b/doc/classes/RMail/Header.src/M000072.html new file mode 100644 index 0000000..9006654 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000072.html @@ -0,0 +1,17 @@ + + + + + +to_a (RMail::Header) + + + +
# File lib/rmail/header.rb, line 416
+    def to_a
+      @fields.collect { |field|
+        [ field.name, field.value ]
+      }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000073.html b/doc/classes/RMail/Header.src/M000073.html new file mode 100644 index 0000000..9c3ccaf --- /dev/null +++ b/doc/classes/RMail/Header.src/M000073.html @@ -0,0 +1,15 @@ + + + + + +to_s (RMail::Header) + + + +
# File lib/rmail/header.rb, line 424
+    def to_s
+      to_string(true)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000074.html b/doc/classes/RMail/Header.src/M000074.html new file mode 100644 index 0000000..1eb22b0 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000074.html @@ -0,0 +1,30 @@ + + + + + +to_string (RMail::Header) + + + +
# File lib/rmail/header.rb, line 430
+    def to_string(mbox_from = false)
+      s = ""
+      if mbox_from && ! @mbox_from.nil?
+        s << @mbox_from
+        s << "\n" unless @mbox_from[-1] == ?\n
+      end
+      @fields.each { |field|
+        if field.raw
+          s << field.raw
+        else
+          s << field.name
+          s << ': '
+          s << field.value
+        end
+        s << "\n" unless s[-1] == ?\n
+      }
+      s
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000075.html b/doc/classes/RMail/Header.src/M000075.html new file mode 100644 index 0000000..9cf13a0 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000075.html @@ -0,0 +1,20 @@ + + + + + +match? (RMail::Header) + + + +
# File lib/rmail/header.rb, line 473
+    def match?(name, value)
+      massage_match_args(name, value) { |name, value|
+        match = detect {|n, v|
+          n =~ name && v =~ value
+        }
+        ! match.nil?
+      }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000076.html b/doc/classes/RMail/Header.src/M000076.html new file mode 100644 index 0000000..6964b9d --- /dev/null +++ b/doc/classes/RMail/Header.src/M000076.html @@ -0,0 +1,23 @@ + + + + + +match (RMail::Header) + + + +
# File lib/rmail/header.rb, line 506
+    def match(name, value)
+      massage_match_args(name, value) { |name, value|
+        header = RMail::Header.new
+        found = each { |n, v|
+          if n.downcase =~ name  &&  value =~ v
+            header[n] = v
+          end
+        }
+        header
+      }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000077.html b/doc/classes/RMail/Header.src/M000077.html new file mode 100644 index 0000000..999ac0f --- /dev/null +++ b/doc/classes/RMail/Header.src/M000077.html @@ -0,0 +1,15 @@ + + + + + +mbox_from= (RMail::Header) + + + +
# File lib/rmail/header.rb, line 520
+    def mbox_from=(value)
+      @mbox_from = value
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000078.html b/doc/classes/RMail/Header.src/M000078.html new file mode 100644 index 0000000..ee1be6e --- /dev/null +++ b/doc/classes/RMail/Header.src/M000078.html @@ -0,0 +1,15 @@ + + + + + +mbox_from (RMail::Header) + + + +
# File lib/rmail/header.rb, line 525
+    def mbox_from
+      @mbox_from
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000079.html b/doc/classes/RMail/Header.src/M000079.html new file mode 100644 index 0000000..a6c4afe --- /dev/null +++ b/doc/classes/RMail/Header.src/M000079.html @@ -0,0 +1,23 @@ + + + + + +content_type (RMail::Header) + + + +
# File lib/rmail/header.rb, line 535
+    def content_type(default = nil)
+      if value = self['content-type']
+        value.strip.split(/\s*;\s*/)[0].downcase
+      else
+        if block_given?
+          yield
+        else
+          default
+        end
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000080.html b/doc/classes/RMail/Header.src/M000080.html new file mode 100644 index 0000000..798ed1b --- /dev/null +++ b/doc/classes/RMail/Header.src/M000080.html @@ -0,0 +1,23 @@ + + + + + +media_type (RMail::Header) + + + +
# File lib/rmail/header.rb, line 555
+    def media_type(default = nil)
+      if value = content_type
+        value.split('/')[0]
+      else
+        if block_given?
+          yield
+        else
+          default
+        end
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000081.html b/doc/classes/RMail/Header.src/M000081.html new file mode 100644 index 0000000..ee6bc6f --- /dev/null +++ b/doc/classes/RMail/Header.src/M000081.html @@ -0,0 +1,23 @@ + + + + + +subtype (RMail::Header) + + + +
# File lib/rmail/header.rb, line 575
+    def subtype(default = nil)
+      if value = content_type
+        value.split('/')[1]
+      else
+        if block_given? then
+          yield
+        else
+          default
+        end
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000082.html b/doc/classes/RMail/Header.src/M000082.html new file mode 100644 index 0000000..1880de6 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000082.html @@ -0,0 +1,25 @@ + + + + + +params (RMail::Header) + + + +
# File lib/rmail/header.rb, line 596
+    def params(field_name, default = nil)
+      if params = params_quoted(field_name)
+        params.each { |name, value|
+          params[name] = value ? Utils.unquote(value) : nil
+        }
+      else
+        if block_given?
+          yield field_name
+        else
+          default
+        end
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000083.html b/doc/classes/RMail/Header.src/M000083.html new file mode 100644 index 0000000..a97135e --- /dev/null +++ b/doc/classes/RMail/Header.src/M000083.html @@ -0,0 +1,24 @@ + + + + + +param (RMail::Header) + + + +
# File lib/rmail/header.rb, line 617
+    def param(field_name, param_name, default = nil)
+      if field?(field_name)
+        params = params_quoted(field_name)
+        value = params[param_name]
+        return Utils.unquote(value) if value
+      end
+      if block_given?
+        yield field_name, param_name
+      else
+        default
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000084.html b/doc/classes/RMail/Header.src/M000084.html new file mode 100644 index 0000000..38e8965 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000084.html @@ -0,0 +1,21 @@ + + + + + +set_boundary (RMail::Header) + + + +
# File lib/rmail/header.rb, line 632
+    def set_boundary(boundary)
+      params = params_quoted('content-type')
+      params ||= {}
+      params['boundary'] = boundary
+      content_type = content_type()
+      content_type ||= "multipart/mixed"
+      delete('Content-Type')
+      add('Content-Type', content_type, nil, params)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000085.html b/doc/classes/RMail/Header.src/M000085.html new file mode 100644 index 0000000..7ade1b0 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000085.html @@ -0,0 +1,23 @@ + + + + + +date (RMail::Header) + + + +
# File lib/rmail/header.rb, line 645
+    def date
+      if value = self['date']
+        begin
+          # Rely on Ruby's standard time.rb to parse the time.
+          (Time.rfc2822(value) rescue Time.parse(value)).localtime
+        rescue
+          # Exceptions during time parsing just cause nil to be
+          # returned.
+        end
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000086.html b/doc/classes/RMail/Header.src/M000086.html new file mode 100644 index 0000000..3d89b50 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000086.html @@ -0,0 +1,16 @@ + + + + + +date= (RMail::Header) + + + +
# File lib/rmail/header.rb, line 659
+    def date=(time)
+      delete('Date')
+      add('Date', time.rfc2822)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000087.html b/doc/classes/RMail/Header.src/M000087.html new file mode 100644 index 0000000..83aaa2a --- /dev/null +++ b/doc/classes/RMail/Header.src/M000087.html @@ -0,0 +1,15 @@ + + + + + +from (RMail::Header) + + + +
# File lib/rmail/header.rb, line 678
+    def from
+      address_list_fetch('from')
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000088.html b/doc/classes/RMail/Header.src/M000088.html new file mode 100644 index 0000000..bcbca45 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000088.html @@ -0,0 +1,15 @@ + + + + + +from= (RMail::Header) + + + +
# File lib/rmail/header.rb, line 689
+    def from=(addresses)
+      address_list_assign('From', addresses)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000089.html b/doc/classes/RMail/Header.src/M000089.html new file mode 100644 index 0000000..3eb351e --- /dev/null +++ b/doc/classes/RMail/Header.src/M000089.html @@ -0,0 +1,15 @@ + + + + + +to (RMail::Header) + + + +
# File lib/rmail/header.rb, line 697
+    def to
+      address_list_fetch('to')
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000090.html b/doc/classes/RMail/Header.src/M000090.html new file mode 100644 index 0000000..64f0fc8 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000090.html @@ -0,0 +1,15 @@ + + + + + +to= (RMail::Header) + + + +
# File lib/rmail/header.rb, line 705
+    def to=(addresses)
+      address_list_assign('To', addresses)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000091.html b/doc/classes/RMail/Header.src/M000091.html new file mode 100644 index 0000000..badb2bb --- /dev/null +++ b/doc/classes/RMail/Header.src/M000091.html @@ -0,0 +1,15 @@ + + + + + +cc (RMail::Header) + + + +
# File lib/rmail/header.rb, line 713
+    def cc
+      address_list_fetch('cc')
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000092.html b/doc/classes/RMail/Header.src/M000092.html new file mode 100644 index 0000000..c4c3dd6 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000092.html @@ -0,0 +1,15 @@ + + + + + +cc= (RMail::Header) + + + +
# File lib/rmail/header.rb, line 721
+    def cc=(addresses)
+      address_list_assign('Cc', addresses)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000093.html b/doc/classes/RMail/Header.src/M000093.html new file mode 100644 index 0000000..a6f73f8 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000093.html @@ -0,0 +1,15 @@ + + + + + +bcc (RMail::Header) + + + +
# File lib/rmail/header.rb, line 729
+    def bcc
+      address_list_fetch('bcc')
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000094.html b/doc/classes/RMail/Header.src/M000094.html new file mode 100644 index 0000000..dbd7ce7 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000094.html @@ -0,0 +1,15 @@ + + + + + +bcc= (RMail::Header) + + + +
# File lib/rmail/header.rb, line 737
+    def bcc=(addresses)
+      address_list_assign('Bcc', addresses)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000095.html b/doc/classes/RMail/Header.src/M000095.html new file mode 100644 index 0000000..275e6f9 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000095.html @@ -0,0 +1,15 @@ + + + + + +reply_to (RMail::Header) + + + +
# File lib/rmail/header.rb, line 743
+    def reply_to
+      address_list_fetch('reply-to')
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000096.html b/doc/classes/RMail/Header.src/M000096.html new file mode 100644 index 0000000..0d51890 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000096.html @@ -0,0 +1,15 @@ + + + + + +reply_to= (RMail::Header) + + + +
# File lib/rmail/header.rb, line 751
+    def reply_to=(addresses)
+      address_list_assign('Reply-To', addresses)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000097.html b/doc/classes/RMail/Header.src/M000097.html new file mode 100644 index 0000000..5c6681d --- /dev/null +++ b/doc/classes/RMail/Header.src/M000097.html @@ -0,0 +1,15 @@ + + + + + +message_id (RMail::Header) + + + +
# File lib/rmail/header.rb, line 756
+    def message_id
+      self['message-id']
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000098.html b/doc/classes/RMail/Header.src/M000098.html new file mode 100644 index 0000000..3024cbf --- /dev/null +++ b/doc/classes/RMail/Header.src/M000098.html @@ -0,0 +1,61 @@ + + + + + +add_message_id (RMail::Header) + + + +
# File lib/rmail/header.rb, line 771
+    def add_message_id(fqdn = nil)
+
+      # If they don't supply a fqdn, we supply one for them.
+      #
+      # First grab the From: field and see if we can use a domain from
+      # there.  If so, use that domain name plus the hash of the From:
+      # field's value (this guarantees that bob@example.com and
+      # sally@example.com will never have clashes).
+      #
+      # If there is no From: field, grab the current host name and use
+      # some randomness from Ruby's random number generator.  Since
+      # Ruby's random number generator is fairly good this will
+      # suffice so long as it is seeded corretly.
+      #
+      # P.S. There is no portable way to get the fully qualified
+      # domain name of the current host.  Those truly interested in
+      # generating "correct" message-ids should pass it in.  We
+      # generate a hopefully random and unique domain name.
+      unless fqdn
+        unless fqdn = from.domains.first
+          require 'socket'
+          fqdn = sprintf("%s.invalid", Socket.gethostname)
+        end
+      else
+        raise ArgumentError, "fqdn must have at least one dot" unless
+          fqdn.index('.')
+      end
+
+      # Hash the header we have so far.
+      md5 = Digest::MD5.new
+      starting_digest = md5.digest
+      @fields.each { |f|
+        if f.raw
+          md5.update(f.raw)
+        else
+          md5.update(f.name) if f.name
+          md5.update(f.value) if f.value
+        end
+      }
+      if (digest = md5.digest) == starting_digest
+        digest = 0
+      end
+
+      set('Message-Id', sprintf("<%s.%s.%s.rubymail@%s>",
+                                base36(Time.now.to_i),
+                                base36(rand(MESSAGE_ID_MAXRAND)),
+                                base36(digest),
+                                fqdn))
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000099.html b/doc/classes/RMail/Header.src/M000099.html new file mode 100644 index 0000000..4e911b3 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000099.html @@ -0,0 +1,15 @@ + + + + + +subject (RMail::Header) + + + +
# File lib/rmail/header.rb, line 822
+    def subject
+      self['subject']
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000100.html b/doc/classes/RMail/Header.src/M000100.html new file mode 100644 index 0000000..e00bc1e --- /dev/null +++ b/doc/classes/RMail/Header.src/M000100.html @@ -0,0 +1,15 @@ + + + + + +subject= (RMail::Header) + + + +
# File lib/rmail/header.rb, line 827
+    def subject=(string)
+      set('Subject', string)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000101.html b/doc/classes/RMail/Header.src/M000101.html new file mode 100644 index 0000000..2c32d73 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000101.html @@ -0,0 +1,19 @@ + + + + + +recipients (RMail::Header) + + + +
# File lib/rmail/header.rb, line 834
+    def recipients
+      retval = RMail::Address::List.new
+      retval.concat(to)
+      retval.concat(cc)
+      retval.concat(bcc)
+      retval.uniq
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000102.html b/doc/classes/RMail/Header.src/M000102.html new file mode 100644 index 0000000..dce8563 --- /dev/null +++ b/doc/classes/RMail/Header.src/M000102.html @@ -0,0 +1,27 @@ + + + + + +address_list_fetch (RMail::Header) + + + +
# File lib/rmail/header.rb, line 849
+    def address_list_fetch(field_name)
+      if values = fetch_all(field_name, nil)
+        list = nil
+        values.each { |value|
+          if list
+            list.concat(Address.parse(value))
+          else
+            list = Address.parse(value)
+          end
+        }
+        if list and !list.empty?
+          list
+        end
+      end or RMail::Address::List.new
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Header.src/M000103.html b/doc/classes/RMail/Header.src/M000103.html new file mode 100644 index 0000000..d73535c --- /dev/null +++ b/doc/classes/RMail/Header.src/M000103.html @@ -0,0 +1,31 @@ + + + + + +address_list_assign (RMail::Header) + + + +
# File lib/rmail/header.rb, line 876
+    def address_list_assign(field_name, addresses)
+      if addresses.kind_of?(Array)
+        value = addresses.collect { |e|
+          if e.kind_of?(RMail::Address)
+            e.format
+          else
+            RMail::Address.parse(e.to_str).collect { |a|
+              a.format
+            }
+          end
+        }.flatten.join(", ")
+        set(field_name, value)
+      elsif addresses.kind_of?(RMail::Address)
+        set(field_name, addresses.format)
+      else
+        address_list_assign(field_name,
+                            RMail::Address.parse(addresses.to_str))
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Mailbox.html b/doc/classes/RMail/Mailbox.html new file mode 100644 index 0000000..52b5d75 --- /dev/null +++ b/doc/classes/RMail/Mailbox.html @@ -0,0 +1,99 @@ + + + + + + Module: RMail::Mailbox + + + + + + + + + + + + +
+ Module RMail::Mailbox + + + + + + +
In: + +lib/rmail/mailbox.rb + +
+ +lib/rmail/mailbox/mboxreader.rb + +
+
+
+ + + + +

+The RMail::Mailbox module contains a few methods +that are useful for working with mailboxes. +

+
+ + + + +
Methods
+
+parse_mbox    +
+ + + + + +
Classes and Modules
+ + + + + +
Public Class methods
+ + +
+ + +parse_mbox(input, line_separator = $/) {|raw_message| ...} + +
+
+

+Parse a Unix mbox style mailbox. These mailboxes searate individual +messages with a line beginning with the string "From ". +

+

+If a block is given, yields to the block with the raw message (a string), +otherwise an array of raw message strings is returned. +

+
+ + + \ No newline at end of file diff --git a/doc/classes/RMail/Mailbox.src/M000001.html b/doc/classes/RMail/Mailbox.src/M000001.html new file mode 100644 index 0000000..1fc3ea4 --- /dev/null +++ b/doc/classes/RMail/Mailbox.src/M000001.html @@ -0,0 +1,26 @@ + + + + + +parse_mbox (RMail::Mailbox) + + + +
# File lib/rmail/mailbox.rb, line 45
+      def parse_mbox(input, line_separator = $/)
+        require 'rmail/mailbox/mboxreader'
+        retval = []
+        RMail::Mailbox::MBoxReader.new(input, line_separator).each_message {
+          |reader|
+          raw_message = reader.read(nil)
+          if block_given?
+            yield raw_message
+          else
+            retval << raw_message
+          end
+        }
+        return block_given? ? nil : retval
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Mailbox/MBoxReader.html b/doc/classes/RMail/Mailbox/MBoxReader.html new file mode 100644 index 0000000..76df48f --- /dev/null +++ b/doc/classes/RMail/Mailbox/MBoxReader.html @@ -0,0 +1,201 @@ + + + + + + Class: RMail::Mailbox::MBoxReader + + + + + + + + + + + + +
+ Class RMail::Mailbox::MBoxReader + + + + + + + + + + +
In: + +lib/rmail/mailbox/mboxreader.rb + +
+
Parent: +RMail::Parser::PushbackReader +
+
+ + + + +

+Class that can parse Unix mbox style mailboxes. These mailboxes separate +individual messages with a line beginning with the string "From +". +

+

+Typical usage: +

+
+ File.open("file.mbox") { |file|
+   RMail::Mailbox::MBoxReader.new(file).each_message { |input|
+     message = RMail::Parser.read(input)
+     # do something with the message
+   end
+ }
+
+

+Or see RMail::Mailbox.parse_mbox for a more convenient +interface. +

+
+ + + + +
Methods
+
+each_message    +eof    +new    +next    +read_chunk    +
+ + + + + + + +
Public Class methods
+ + +
+ + +new(input, line_separator = $/) + +
+
+

+Creates a new MBoxReader that reads from +`input’ with lines that end with `line_separator’. +

+

+`input’ can either be an IO source (an object that responds to the +"read" method in the same way as a standard IO object) or a +String. +

+

+`line_separator’ defaults to $/, and useful values are probably +limited to "\n" (Unix) and "\r\n" (DOS/Windows). +

+
+ + +
Public Instance methods
+ + +
+ + +read_chunk(size) + +
+
+

+Reads some data from the current message and returns it. The `size’ +argument is just a suggestion, and the returned string can be larger or +smaller. When `size’ is nil, then the entire message is returned. +

+

+Once all data from the current message has been read, #read returns nil and #next must be called to begin reading +from the next message. You can use #eof to tell if there is any more data +to be read from the input source. +

+
+ + +
+ + +next() + +
+
+

+Advances to the next message to be read. Call this after #read returns nil. +

+

+Note: Once #read returns nil, you can +call #eof before or after calling #next to tell if there actually is a +next message to read. +

+
+ + +
+ + +eof() + +
+
+

+Returns true if the next call to read_chunk will return nil. +

+
+ + +
+ + +each_message() {|self| ...} + +
+
+

+Yield self until eof, calling next after each yield. +

+

+This method makes it simple to read messages successively out of the +mailbox. See the class description for a code example. +

+
+ + + \ No newline at end of file diff --git a/doc/classes/RMail/Mailbox/MBoxReader.src/M000002.html b/doc/classes/RMail/Mailbox/MBoxReader.src/M000002.html new file mode 100644 index 0000000..810330c --- /dev/null +++ b/doc/classes/RMail/Mailbox/MBoxReader.src/M000002.html @@ -0,0 +1,27 @@ + + + + + +new (RMail::Mailbox::MBoxReader) + + + +
# File lib/rmail/mailbox/mboxreader.rb, line 61
+      def initialize(input, line_separator = $/)
+        super(input)
+        @end_of_message = false
+        @chunk_minsize = 0
+        @sep = line_separator
+        @tail = nil
+
+        # This regexp will match a From_ header, or some prefix.
+        re_string = RMail::Parser::PushbackReader.
+          maybe_contains_re("#{@sep}From ")
+        @partial_from_re = Regexp.new(re_string)
+
+        # This regexp will match an entire From_ header.
+        @entire_from_re = /\A#{@sep}From .*?#{@sep}/
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Mailbox/MBoxReader.src/M000003.html b/doc/classes/RMail/Mailbox/MBoxReader.src/M000003.html new file mode 100644 index 0000000..f395043 --- /dev/null +++ b/doc/classes/RMail/Mailbox/MBoxReader.src/M000003.html @@ -0,0 +1,29 @@ + + + + + +read_chunk (RMail::Mailbox::MBoxReader) + + + +
# File lib/rmail/mailbox/mboxreader.rb, line 88
+      def read_chunk(size)
+        chunk = read_chunk_low(size)
+        if chunk
+          if chunk.length > @sep.length
+            @tail = chunk[-@sep.length .. -1]
+          else
+            @tail ||= ''
+            @tail << chunk
+          end
+        elsif @tail
+          if @tail[-@sep.length .. -1] != @sep
+            chunk = @sep
+          end
+          @tail = nil
+        end
+        chunk
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Mailbox/MBoxReader.src/M000004.html b/doc/classes/RMail/Mailbox/MBoxReader.src/M000004.html new file mode 100644 index 0000000..96980b8 --- /dev/null +++ b/doc/classes/RMail/Mailbox/MBoxReader.src/M000004.html @@ -0,0 +1,16 @@ + + + + + +next (RMail::Mailbox::MBoxReader) + + + +
# File lib/rmail/mailbox/mboxreader.rb, line 112
+      def next
+        @end_of_message = false
+        @tail = nil
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Mailbox/MBoxReader.src/M000005.html b/doc/classes/RMail/Mailbox/MBoxReader.src/M000005.html new file mode 100644 index 0000000..e192f93 --- /dev/null +++ b/doc/classes/RMail/Mailbox/MBoxReader.src/M000005.html @@ -0,0 +1,15 @@ + + + + + +eof (RMail::Mailbox::MBoxReader) + + + +
# File lib/rmail/mailbox/mboxreader.rb, line 120
+      def eof
+        parent_eof and @tail.nil?
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Mailbox/MBoxReader.src/M000006.html b/doc/classes/RMail/Mailbox/MBoxReader.src/M000006.html new file mode 100644 index 0000000..fe32678 --- /dev/null +++ b/doc/classes/RMail/Mailbox/MBoxReader.src/M000006.html @@ -0,0 +1,18 @@ + + + + + +each_message (RMail::Mailbox::MBoxReader) + + + +
# File lib/rmail/mailbox/mboxreader.rb, line 128
+      def each_message
+        while !eof
+          yield self
+          self.next
+        end
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Message.html b/doc/classes/RMail/Message.html new file mode 100644 index 0000000..18f7d38 --- /dev/null +++ b/doc/classes/RMail/Message.html @@ -0,0 +1,323 @@ + + + + + + Class: RMail::Message + + + + + + + + + + + + +
+ Class RMail::Message + + + + + + + + + + +
In: + +lib/rmail/message.rb + +
+
Parent: +Object +
+
+ + + + +

+The RMail::Message is an object representation +of a standard Internet email message, including MIME multipart messages. +

+

+An RMail::Message object represents a message +header (held in the contained RMail::Header +object) and a message body. The message body may either be a single String +for single part messages or an Array of RMail::Message objects for MIME multipart messages. +

+
+ + + + +
Methods
+
+==    +add_part    +body    +body=    +decode    +each    +each_part    +header    +multipart?    +new    +part    +to_s    +
+ + + + +
Attributes
+ + + + + + + + + + + +
epilogue [RW] 

+Access the epilogue string for this message. The epilogue string is +relevant only for multipart messages. It is the text that occurs after all +parts of the message and is generally nil. +

+
preamble [RW] 

+Access the preamble string for this message. The preamble string is +relevant only for multipart messages. It is the text that occurs just +before the first part of the message, and is generally nil or simple +English text describing the nature of the message. +

+
+ + + + + +
Public Class methods
+ + +
+ + +new() + +
+
+

+Create a new, empty, RMail::Message. +

+
+ + +
Public Instance methods
+ + +
+ + +==(other) + +
+
+

+Test if this message is structured exactly the same as the other message. +This is useful mainly for testing. +

+
+ + +
+ + +body() + +
+
+

+Returns the body of the message as a String or Array. +

+

+If #multipart? returns true, it will be +an array of RMail::Message objects. Otherwise it +will be a String. +

+

+See also #header. +

+
+ + +
+ + +body=(s) + +
+
+

+Sets the body of the message to the given value. It should either be a +String or an Array of RMail:Message objects. +

+
+ + +
+ + +header() + +
+
+

+Returns the RMail::Header object. +

+

+See also #body. +

+
+ + +
+ + +multipart?() + +
+
+

+Return true if the message consists of multiple parts. +

+
+ + +
+ + +add_part(part) + +
+
+

+Add a part to the message. After this message is called, the #multipart? method will return true and the +#body method will #return an array of +parts. +

+
+ + +
+ + +decode() + +
+
+

+Decode the body of this message. +

+

+If the body of this message is encoded with quoted-printable or +base64, this function will decode the data into its original form +and return it as a String. If the body is not encoded, it is returned +unaltered. +

+

+This only works when the message is not a multipart. The +Content-Transfer-Encoding: header field is consulted to determine +the encoding of the body part. +

+
+ + +
+ + +part(i) + +
+
+

+Get the indicated part from a multipart message. +

+
+ + +
+ + +to_s() + +
+
+

+Returns the entire message in a single string. This uses the RMail::Serialize class. +

+
+ + +
+ + +each_part() {|part| ...} + +
+
+

+Return each part of this message +

+

+FIXME: not tested +

+
+ + +
+ + +each() {|line| ...} + +
+
+

+Call the supplied block for each line of the message. Each line will +contain a trailing newline (\n). +

+
+ + + \ No newline at end of file diff --git a/doc/classes/RMail/Message.src/M000010.html b/doc/classes/RMail/Message.src/M000010.html new file mode 100644 index 0000000..eafcca9 --- /dev/null +++ b/doc/classes/RMail/Message.src/M000010.html @@ -0,0 +1,18 @@ + + + + + +new (RMail::Message) + + + +
# File lib/rmail/message.rb, line 44
+    def initialize
+      @header = RMail::Header.new
+      @body = nil
+      @epilogue = nil
+      @preamble = nil
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Message.src/M000011.html b/doc/classes/RMail/Message.src/M000011.html new file mode 100644 index 0000000..f79629d --- /dev/null +++ b/doc/classes/RMail/Message.src/M000011.html @@ -0,0 +1,18 @@ + + + + + +== (RMail::Message) + + + +
# File lib/rmail/message.rb, line 53
+    def ==(other)
+      @preamble == other.preamble &&
+        @epilogue == other.epilogue &&
+        @header == other.header &&
+        @body == other.body
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Message.src/M000012.html b/doc/classes/RMail/Message.src/M000012.html new file mode 100644 index 0000000..ddd81f8 --- /dev/null +++ b/doc/classes/RMail/Message.src/M000012.html @@ -0,0 +1,15 @@ + + + + + +body (RMail::Message) + + + +
# File lib/rmail/message.rb, line 66
+    def body
+      return @body
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Message.src/M000013.html b/doc/classes/RMail/Message.src/M000013.html new file mode 100644 index 0000000..9416124 --- /dev/null +++ b/doc/classes/RMail/Message.src/M000013.html @@ -0,0 +1,15 @@ + + + + + +body= (RMail::Message) + + + +
# File lib/rmail/message.rb, line 72
+    def body=(s)
+      @body = s
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Message.src/M000014.html b/doc/classes/RMail/Message.src/M000014.html new file mode 100644 index 0000000..07cef37 --- /dev/null +++ b/doc/classes/RMail/Message.src/M000014.html @@ -0,0 +1,15 @@ + + + + + +header (RMail::Message) + + + +
# File lib/rmail/message.rb, line 79
+    def header()
+      return @header
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Message.src/M000015.html b/doc/classes/RMail/Message.src/M000015.html new file mode 100644 index 0000000..7ef4ae7 --- /dev/null +++ b/doc/classes/RMail/Message.src/M000015.html @@ -0,0 +1,15 @@ + + + + + +multipart? (RMail::Message) + + + +
# File lib/rmail/message.rb, line 84
+    def multipart?
+      @body.is_a?(Array)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Message.src/M000016.html b/doc/classes/RMail/Message.src/M000016.html new file mode 100644 index 0000000..0024902 --- /dev/null +++ b/doc/classes/RMail/Message.src/M000016.html @@ -0,0 +1,21 @@ + + + + + +add_part (RMail::Message) + + + +
# File lib/rmail/message.rb, line 91
+    def add_part(part)
+      if @body.nil?
+        @body = [part]
+      elsif @body.is_a?(Array)
+        @body.push(part)
+      else
+        @body = [@body, part]
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Message.src/M000017.html b/doc/classes/RMail/Message.src/M000017.html new file mode 100644 index 0000000..c606be0 --- /dev/null +++ b/doc/classes/RMail/Message.src/M000017.html @@ -0,0 +1,23 @@ + + + + + +decode (RMail::Message) + + + +
# File lib/rmail/message.rb, line 111
+    def decode
+      raise TypeError, "Can not decode a multipart message." if multipart?
+      case header.fetch('content-transfer-encoding', '7bit').strip.downcase
+      when 'quoted-printable'
+        Utils.quoted_printable_decode(@body)
+      when 'base64'
+        Utils.base64_decode(@body)
+      else
+        @body
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Message.src/M000018.html b/doc/classes/RMail/Message.src/M000018.html new file mode 100644 index 0000000..0aaf653 --- /dev/null +++ b/doc/classes/RMail/Message.src/M000018.html @@ -0,0 +1,17 @@ + + + + + +part (RMail::Message) + + + +
# File lib/rmail/message.rb, line 124
+    def part(i)
+      raise TypeError,
+        "Can not get part on a single part message." unless multipart?
+      @body[i]
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Message.src/M000019.html b/doc/classes/RMail/Message.src/M000019.html new file mode 100644 index 0000000..92d3243 --- /dev/null +++ b/doc/classes/RMail/Message.src/M000019.html @@ -0,0 +1,16 @@ + + + + + +to_s (RMail::Message) + + + +
# File lib/rmail/message.rb, line 144
+    def to_s()
+      require 'rmail/serialize'
+      RMail::Serialize.new('').serialize(self)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Message.src/M000020.html b/doc/classes/RMail/Message.src/M000020.html new file mode 100644 index 0000000..c2bba7c --- /dev/null +++ b/doc/classes/RMail/Message.src/M000020.html @@ -0,0 +1,18 @@ + + + + + +each_part (RMail::Message) + + + +
# File lib/rmail/message.rb, line 152
+    def each_part
+      raise TypeError, "not a multipart message" unless multipart?
+      @body.each do |part|
+        yield part
+      end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Message.src/M000021.html b/doc/classes/RMail/Message.src/M000021.html new file mode 100644 index 0000000..d620bad --- /dev/null +++ b/doc/classes/RMail/Message.src/M000021.html @@ -0,0 +1,19 @@ + + + + + +each (RMail::Message) + + + +
# File lib/rmail/message.rb, line 161
+    def each()
+      # FIXME: this is incredibly inefficient!  The only users of this
+      # is RMail::Deliver -- get them to use a RMail::Serialize object.
+      to_s.each("\n") { |line|
+        yield line
+      }
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Parser.html b/doc/classes/RMail/Parser.html new file mode 100644 index 0000000..acc6666 --- /dev/null +++ b/doc/classes/RMail/Parser.html @@ -0,0 +1,182 @@ + + + + + + Class: RMail::Parser + + + + + + + + + + + + +
+ Class RMail::Parser + + + + + + + + + + +
In: + +lib/rmail/parser/pushbackreader.rb + +
+ +lib/rmail/parser/multipart.rb + +
+ +lib/rmail/parser.rb + +
+
Parent: +Object +
+
+ + + + +

+The RMail::Parser class creates RMail::Message objects from Ruby IO objects or +strings. +

+

+To parse from a string: +

+
+  message = RMail::Parser.read(the_string)
+
+

+To parse from an IO object: +

+
+  message = File.open('my-message') { |f|
+    RMail::Parser.read(f)
+  }
+
+

+You can also parse from STDIN, etc. +

+
+  message = RMail::Parser.read(STDIN)
+
+

+In all cases, the parser consumes all input. +

+
+ + + + +
Methods
+
+new    +parse    +read    +
+ + + + +
Attributes
+ + + + + + +
chunk_size [RW] 

+Change the chunk size used to read the message. This is useful mostly for +testing. +

+
+ + + +
Classes and Modules
+ + + + + +
Public Class methods
+ + +
+ + +new() + +
+
+

+Creates a new parser. Messages of message_class will be created by +the parser. By default, the parser will create RMail::Message objects. +

+
+ + +
+ + +read(input) + +
+
+

+Parse a message from the IO object io and return a new message. +The io object can also be a string. This is just shorthand for: +

+
+  RMail::Parser.new.parse(io)
+
+
+ + +
Public Instance methods
+ + +
+ + +parse(input) + +
+
+

+Parse a message from the IO object io and return a new message. +The io object can also be a string. +

+
+ + + \ No newline at end of file diff --git a/doc/classes/RMail/Parser.src/M000023.html b/doc/classes/RMail/Parser.src/M000023.html new file mode 100644 index 0000000..052abe5 --- /dev/null +++ b/doc/classes/RMail/Parser.src/M000023.html @@ -0,0 +1,15 @@ + + + + + +new (RMail::Parser) + + + +
# File lib/rmail/parser.rb, line 321
+    def initialize()
+      @chunk_size = nil
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Parser.src/M000024.html b/doc/classes/RMail/Parser.src/M000024.html new file mode 100644 index 0000000..3e7c258 --- /dev/null +++ b/doc/classes/RMail/Parser.src/M000024.html @@ -0,0 +1,19 @@ + + + + + +parse (RMail::Parser) + + + +
# File lib/rmail/parser.rb, line 327
+    def parse(input)
+      handler = RMail::Parser::Handler.new
+      parser = RMail::StreamParser.new(input, handler)
+      parser.chunk_size = @chunk_size if @chunk_size
+      parser.parse
+      return handler.message
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Parser.src/M000025.html b/doc/classes/RMail/Parser.src/M000025.html new file mode 100644 index 0000000..2ade66f --- /dev/null +++ b/doc/classes/RMail/Parser.src/M000025.html @@ -0,0 +1,15 @@ + + + + + +read (RMail::Parser) + + + +
# File lib/rmail/parser.rb, line 344
+    def Parser.read(input)
+      Parser.new.parse(input)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Parser/Error.html b/doc/classes/RMail/Parser/Error.html new file mode 100644 index 0000000..3e3e537 --- /dev/null +++ b/doc/classes/RMail/Parser/Error.html @@ -0,0 +1,73 @@ + + + + + + Class: RMail::Parser::Error + + + + + + + + + + + + +
+ Class RMail::Parser::Error + + + + + + + + + + +
In: + +lib/rmail/parser/pushbackreader.rb + +
+ +lib/rmail/parser.rb + +
+
Parent: +StandardError +
+
+ + + + +

+This exception class is thrown when the parser encounters an error. +

+

+Note: the parser tries hard to never throw exceptions — this error is +thrown only when the API is used incorrectly and not on invalid input. +

+
+ + + + + + + + + + \ No newline at end of file diff --git a/doc/classes/RMail/Serialize.html b/doc/classes/RMail/Serialize.html new file mode 100644 index 0000000..6ca7cf9 --- /dev/null +++ b/doc/classes/RMail/Serialize.html @@ -0,0 +1,148 @@ + + + + + + Class: RMail::Serialize + + + + + + + + + + + + +
+ Class RMail::Serialize + + + + + + + + + + +
In: + +lib/rmail/serialize.rb + +
+
Parent: +Object +
+
+ + + + +

+The RMail::Serialize class writes an RMail::Message object into an IO object or string. +The result is a standard mail message in text form. +

+

+To do this, you pass the RMail::Message object +to the RMail::Serialize object. RMail::Serialize can write into any object +supporting the << method. +

+

+As a convenience, RMail::Serialize.write is a +class method you can use directly: +

+
+ # Write to a file
+ File.open('my-message', 'w') { |f|
+   RMail::Serialize.write(f, message)
+ }
+
+

+# Write to a new string string = RMail::Serialize.write(’’, message) +

+
+ + + + +
Methods
+
+new    +serialize    +write    +
+ + + + + + + +
Public Class methods
+ + +
+ + +new(output, escape_from = nil) + +
+
+

+Initialize this Serialize object with an +output stream. If escape_from is not nil, lines with a leading From are +escaped. +

+
+ + +
+ + +write(output, message) + +
+
+

+Serialize a message into a given output +object. The output object must support the << method in the same way +that an IO or String object does. +

+
+ + +
Public Instance methods
+ + +
+ + +serialize(message) + +
+
+

+Serialize a given message into this +object’s output object. +

+
+ + + \ No newline at end of file diff --git a/doc/classes/RMail/Serialize.src/M000037.html b/doc/classes/RMail/Serialize.src/M000037.html new file mode 100644 index 0000000..e5b2f82 --- /dev/null +++ b/doc/classes/RMail/Serialize.src/M000037.html @@ -0,0 +1,16 @@ + + + + + +new (RMail::Serialize) + + + +
# File lib/rmail/serialize.rb, line 55
+    def initialize(output, escape_from = nil)
+      @output = output
+      @escape_from = escape_from
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Serialize.src/M000038.html b/doc/classes/RMail/Serialize.src/M000038.html new file mode 100644 index 0000000..2b8623e --- /dev/null +++ b/doc/classes/RMail/Serialize.src/M000038.html @@ -0,0 +1,16 @@ + + + + + +serialize (RMail::Serialize) + + + +
# File lib/rmail/serialize.rb, line 61
+    def serialize(message)
+      calculate_boundaries(message) if message.multipart?
+      serialize_low(message)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Serialize.src/M000039.html b/doc/classes/RMail/Serialize.src/M000039.html new file mode 100644 index 0000000..a7c453b --- /dev/null +++ b/doc/classes/RMail/Serialize.src/M000039.html @@ -0,0 +1,15 @@ + + + + + +write (RMail::Serialize) + + + +
# File lib/rmail/serialize.rb, line 69
+    def Serialize.write(output, message)
+      Serialize.new(output).serialize(message)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/StreamHandler.html b/doc/classes/RMail/StreamHandler.html new file mode 100644 index 0000000..7773076 --- /dev/null +++ b/doc/classes/RMail/StreamHandler.html @@ -0,0 +1,326 @@ + + + + + + Class: RMail::StreamHandler + + + + + + + + + + + + +
+ Class RMail::StreamHandler + + + + + + + + + + +
In: + +lib/rmail/parser.rb + +
+
Parent: +Object +
+
+ + + + +

Overview

+

+An RMail::StreamHandler documents the set +of methods a RMail::StreamParser handler +must implement. See RMail::StreamParser.parse. This is a low level +interface to the RMail message parser. +

+

Order of Method Calls (Grammar)

+

+Calls to the methods of this class follow a specific grammar, described +informally below. The words in all caps are productions in the grammar, +while the lower case words are method calls to this object. +

+ + + + +
MESSAGE:[ #mbox_from ] *( #header_field ) ( BODY / +MULTIPART_BODY ) + +
BODY:*body_begin *( #body_chunk ) #body_end + +
MULTIPART_BODY:#multipart_body_begin *( #preamble_chunk ) *( #part_begin MESSAGE #part_end) *( #epilogue_chunk ) #multipart_body_end + +
+

Order of Method Calls (English)

+

+If the grammar above is not clear, here is a description in English. +

+

+The parser begins calling #header_field, possibly calling #mbox_from for the first line. Then it +determines if the message was a MIME multipart message. +

+

+If the message is a not a MIME multipart, the parser calls #body_begin once, then #body_chunk any number of times, then +#body_end. +

+

+If the message header is a MIME multipart message, then #multipart_body_begin is called, +followed by any number of calls to #preamble_chunk. Then for each part +parsed, #part_begin is called, +followed by a recursive set of calls described by the "MESSAGE" +production above, and then #part_end. After all parts are +parsed, any number of calls to #epilogue_chunk are followed by a +single call to #multipart_body_end. +

+

+The recursive nature of MIME multipart messages is represented by the +recursive invocation of the "MESSAGE" production in the grammar +above. +

+
+ + + + +
Methods
+ + + + + + + + +
Public Instance methods
+ + +
+ + +mbox_from(line) + +
+
+

+This method is called for Unix MBOX "From " lines in the message +header, it calls this method with the text. +

+
+ + +
+ + +header_field(field, name, value) + +
+
+

+This method is called when a header field is parsed. The field is +the full text of the field, the name is the name of the field and +the value is the field’s value with leading and trailing +whitespace removed. Note that both field and value may be +multi-line strings. +

+
+ + +
+ + +body_begin() + +
+
+

+This method is called before a non-multipart message body is about to be +parsed. +

+
+ + +
+ + +body_chunk(chunk) + +
+
+

+This method is called with a string chunk of data from a non-multipart +message body. The string does not necessarily begin or end on any +particular boundary. +

+
+ + +
+ + +body_end() + +
+
+

+This method is called after all of the non-multipart message body has been +parsed. +

+
+ + +
+ + +multipart_body_begin() + +
+
+

+This method is called before a multipart message body is about to be +parsed. +

+
+ + +
+ + +preamble_chunk(chunk) + +
+
+

+This method is called with a chunk of data from a multipart message +body’s preamble. The preamble is any text that appears before the +first part of the multipart message body. +

+
+ + +
+ + +part_begin() + +
+
+

+This method is called when a part of a multipart body begins. +

+
+ + +
+ + +part_end() + +
+
+

+This method is called when a part of a multipart body ends. +

+
+ + +
+ + +epilogue_chunk(chunk) + +
+
+

+This method is called with a chunk of data from a multipart message +body’s epilogue. The epilogue is any text that appears after the last +part of the multipart message body. +

+
+ + +
+ + +multipart_body_end(delimiters, boundary) + +
+
+

+This method is called after a multipart message body has been completely +parsed. +

+

+The delimiters is an Array of strings, one for each boundary +string found in the multipart body. The boundary is the boundary +string used to delimit each part in the multipart body. You can normally +ignore both delimiters and boundary if you are concerned +only about message content. +

+
+ + + \ No newline at end of file diff --git a/doc/classes/RMail/StreamHandler.src/M000026.html b/doc/classes/RMail/StreamHandler.src/M000026.html new file mode 100644 index 0000000..9c19661 --- /dev/null +++ b/doc/classes/RMail/StreamHandler.src/M000026.html @@ -0,0 +1,14 @@ + + + + + +mbox_from (RMail::StreamHandler) + + + +
# File lib/rmail/parser.rb, line 87
+    def mbox_from(line)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/StreamHandler.src/M000027.html b/doc/classes/RMail/StreamHandler.src/M000027.html new file mode 100644 index 0000000..9dbf84a --- /dev/null +++ b/doc/classes/RMail/StreamHandler.src/M000027.html @@ -0,0 +1,14 @@ + + + + + +header_field (RMail::StreamHandler) + + + +
# File lib/rmail/parser.rb, line 95
+    def header_field(field, name, value)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/StreamHandler.src/M000028.html b/doc/classes/RMail/StreamHandler.src/M000028.html new file mode 100644 index 0000000..87b4945 --- /dev/null +++ b/doc/classes/RMail/StreamHandler.src/M000028.html @@ -0,0 +1,14 @@ + + + + + +body_begin (RMail::StreamHandler) + + + +
# File lib/rmail/parser.rb, line 100
+    def body_begin
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/StreamHandler.src/M000029.html b/doc/classes/RMail/StreamHandler.src/M000029.html new file mode 100644 index 0000000..46ead72 --- /dev/null +++ b/doc/classes/RMail/StreamHandler.src/M000029.html @@ -0,0 +1,14 @@ + + + + + +body_chunk (RMail::StreamHandler) + + + +
# File lib/rmail/parser.rb, line 106
+    def body_chunk(chunk)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/StreamHandler.src/M000030.html b/doc/classes/RMail/StreamHandler.src/M000030.html new file mode 100644 index 0000000..93664a2 --- /dev/null +++ b/doc/classes/RMail/StreamHandler.src/M000030.html @@ -0,0 +1,14 @@ + + + + + +body_end (RMail::StreamHandler) + + + +
# File lib/rmail/parser.rb, line 111
+    def body_end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/StreamHandler.src/M000031.html b/doc/classes/RMail/StreamHandler.src/M000031.html new file mode 100644 index 0000000..bf99791 --- /dev/null +++ b/doc/classes/RMail/StreamHandler.src/M000031.html @@ -0,0 +1,14 @@ + + + + + +multipart_body_begin (RMail::StreamHandler) + + + +
# File lib/rmail/parser.rb, line 116
+    def multipart_body_begin
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/StreamHandler.src/M000032.html b/doc/classes/RMail/StreamHandler.src/M000032.html new file mode 100644 index 0000000..5a61ca9 --- /dev/null +++ b/doc/classes/RMail/StreamHandler.src/M000032.html @@ -0,0 +1,14 @@ + + + + + +preamble_chunk (RMail::StreamHandler) + + + +
# File lib/rmail/parser.rb, line 122
+    def preamble_chunk(chunk)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/StreamHandler.src/M000033.html b/doc/classes/RMail/StreamHandler.src/M000033.html new file mode 100644 index 0000000..abd614f --- /dev/null +++ b/doc/classes/RMail/StreamHandler.src/M000033.html @@ -0,0 +1,14 @@ + + + + + +part_begin (RMail::StreamHandler) + + + +
# File lib/rmail/parser.rb, line 126
+    def part_begin
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/StreamHandler.src/M000034.html b/doc/classes/RMail/StreamHandler.src/M000034.html new file mode 100644 index 0000000..a025465 --- /dev/null +++ b/doc/classes/RMail/StreamHandler.src/M000034.html @@ -0,0 +1,14 @@ + + + + + +part_end (RMail::StreamHandler) + + + +
# File lib/rmail/parser.rb, line 130
+    def part_end
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/StreamHandler.src/M000035.html b/doc/classes/RMail/StreamHandler.src/M000035.html new file mode 100644 index 0000000..30dab85 --- /dev/null +++ b/doc/classes/RMail/StreamHandler.src/M000035.html @@ -0,0 +1,14 @@ + + + + + +epilogue_chunk (RMail::StreamHandler) + + + +
# File lib/rmail/parser.rb, line 136
+    def epilogue_chunk(chunk)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/StreamHandler.src/M000036.html b/doc/classes/RMail/StreamHandler.src/M000036.html new file mode 100644 index 0000000..edf84b7 --- /dev/null +++ b/doc/classes/RMail/StreamHandler.src/M000036.html @@ -0,0 +1,14 @@ + + + + + +multipart_body_end (RMail::StreamHandler) + + + +
# File lib/rmail/parser.rb, line 147
+    def multipart_body_end(delimiters, boundary)
+    end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/StreamParser.html b/doc/classes/RMail/StreamParser.html new file mode 100644 index 0000000..d1ab923 --- /dev/null +++ b/doc/classes/RMail/StreamParser.html @@ -0,0 +1,103 @@ + + + + + + Class: RMail::StreamParser + + + + + + + + + + + + +
+ Class RMail::StreamParser + + + + + + + + + + +
In: + +lib/rmail/parser.rb + +
+
Parent: +Object +
+
+ + + + +

+The RMail::StreamParser is a low level +message parsing API. It is useful when you are interested in serially +examining all message content but are not interested in a full object +representation of the object. See StreamParser.parse. +

+
+ + + + +
Methods
+
+parse    +
+ + + + + + + +
Public Class methods
+ + +
+ + +parse(input, handler) + +
+
+

+Parse a message from an input source. This method returns nothing. Instead, +the supplied handler is expected to implement the same methods as +RMail::StreamHandler. The message +structure can be inferred from the methods called on the handler. +The input can be any Ruby IO source or a String. +

+

+This is a low level parsing API. For a message parser that returns an RMail::Message object, see the RMail::Parser class. RMail::Parser is implemented using RMail::StreamParser. +

+
+ + + \ No newline at end of file diff --git a/doc/classes/RMail/StreamParser.src/M000022.html b/doc/classes/RMail/StreamParser.src/M000022.html new file mode 100644 index 0000000..3cdbdfd --- /dev/null +++ b/doc/classes/RMail/StreamParser.src/M000022.html @@ -0,0 +1,15 @@ + + + + + +parse (RMail::StreamParser) + + + +
# File lib/rmail/parser.rb, line 169
+      def parse(input, handler)
+        RMail::StreamParser.new(input, handler).parse
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Utils.html b/doc/classes/RMail/Utils.html new file mode 100644 index 0000000..7a2c4fb --- /dev/null +++ b/doc/classes/RMail/Utils.html @@ -0,0 +1,113 @@ + + + + + + Module: RMail::Utils + + + + + + + + + + + + +
+ Module RMail::Utils + + + + + + +
In: + +lib/rmail/utils.rb + +
+
+
+ + + + +

+The RMail::Utils module is a collection of random +utility methods that are useful for dealing with email. +

+
+ + + + +
Methods
+ + + + + + + + +
Public Class methods
+ + +
+ + +unquote(str) + +
+
+

+Return the given string unquoted if it is quoted. +

+
+ + +
+ + +base64_decode(str) + +
+
+

+Decode the given string as if it were a chunk of base64 data +

+
+ + +
+ + +quoted_printable_decode(str) + +
+
+

+Decode the given string as if it were a chunk of quoted printable data +

+
+ + + \ No newline at end of file diff --git a/doc/classes/RMail/Utils.src/M000007.html b/doc/classes/RMail/Utils.src/M000007.html new file mode 100644 index 0000000..bc3f13d --- /dev/null +++ b/doc/classes/RMail/Utils.src/M000007.html @@ -0,0 +1,19 @@ + + + + + +unquote (RMail::Utils) + + + +
# File lib/rmail/utils.rb, line 38
+      def unquote(str)
+        if str =~ /\s*"(.*?([^\\]|\\\\))"/m
+          $1.gsub(/\\(.)/, '\1')
+        else
+          str
+        end
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Utils.src/M000008.html b/doc/classes/RMail/Utils.src/M000008.html new file mode 100644 index 0000000..9c6d4dc --- /dev/null +++ b/doc/classes/RMail/Utils.src/M000008.html @@ -0,0 +1,15 @@ + + + + + +base64_decode (RMail::Utils) + + + +
# File lib/rmail/utils.rb, line 47
+      def base64_decode(str)
+        str.unpack("m*").first
+      end
+ + \ No newline at end of file diff --git a/doc/classes/RMail/Utils.src/M000009.html b/doc/classes/RMail/Utils.src/M000009.html new file mode 100644 index 0000000..f5a1593 --- /dev/null +++ b/doc/classes/RMail/Utils.src/M000009.html @@ -0,0 +1,15 @@ + + + + + +quoted_printable_decode (RMail::Utils) + + + +
# File lib/rmail/utils.rb, line 53
+      def quoted_printable_decode(str)
+        str.unpack("M*").first
+      end
+ + \ No newline at end of file diff --git a/doc/created.rid b/doc/created.rid new file mode 100644 index 0000000..bda1f47 --- /dev/null +++ b/doc/created.rid @@ -0,0 +1 @@ +Tue Apr 27 22:19:02 PDT 2004 diff --git a/doc/files/NEWS.html b/doc/files/NEWS.html new file mode 100644 index 0000000..1171d6e --- /dev/null +++ b/doc/files/NEWS.html @@ -0,0 +1,495 @@ + + + + + + File: NEWS + + + + + + + + + + +
+ +
NEWS + + + + + + + + +
Path:NEWS
Modified:Tue Apr 27 22:13:36 PDT 2004
+
+ + + + +

Changes in RubyMail 0.17 (released 2004-04-27)

+
    +
  • Handle parsing addresses with non-ASCII display names. We don’t do +anything intelligent with the non-ASCII data, but it is passed through in +its original (invalid) non-encoded form. + +
  • +
  • Look for From_ lines only on the first line when parsing a message. + +
  • +
  • RMail::Header#subject= now sets the header field name to +"Subject" instead of "subject" since some mail reading +software is case sensitive and can’t understand "subject: +foo". + +
  • +
  • The RMail parser now requires only +whitespace after MIME multipart boundary lines. This violates +RFC2046’s "NOTE TO IMPLEMENTORS" documented in +testparsermultipart.rb’s test_multipart_data_12, but it allows +real-world messages created by Eudora to be parsed. + +
  • +
+

Changes in RubyMail 0.16 (released 2003-12-26)

+
    +
  • Ruby 1.8.1 compatibility fixes only. + +
  • +
+

Changes in RubyMail 0.15 (released 2003-09-17)

+
    +
  • Ruby 1.8.0 compatibility fixes only. + +
  • +
+

Changes in RubyMail 0.14 (released 2003-02-08)

+
    +
  • Improve RDoc documentation of the library. + +
      +
    • Add file level comments. + +
    • +
    • No longer document RMail::Parser::PushbackReader and +RMail::Parser::Multipart, as they are used only internally or by those who +really want to dig deep into the library. I also think they might be +changing soon. + +
    • +
    +
  • +
  • Add ability to + +
    +  require 'rmail'
    +
    +

    +and get all of RubyMail. +

    +
  • +
  • Switch to the BSD license, mainly so the license of RubyMail is not +confusing. + +
  • +
+

Changes in RubyMail 0.13 (released 2003-02-01)

+
    +
  • Add convenience methods to RMail::Header that allow easy +manipulation of the To, Cc, Bcc, Reply-To, Date, Subject and Message-Id +fields. This includes unique Message-Id generation code and robust Date +field parsing and formatting. + +
  • +
  • Add RMail::Header#set, to delete existing fields of the same name and then +add a new one. + +
  • +
  • RMail::Address.parse now +returns an RMail::Address::List instead +of an Array (existing code still works, since RMail::Address::List inherits +from Array). + +
  • +
  • Add RMail::Address#<=>, +RMail::Address#hash and RMail::Address#eql? methods. This allows arrays of +RMail::Address to be sorted as +well as allowing RMail::Address +to be placed in a hash (which in turn allows Array#uniq to work when +holding RMail::Address +objects). + +
  • +
  • Add an RMail::Mailbox::MBoxReader.each_message +method. + +
  • +
  • Deleted the rmail/header/field.rb field and incorporated +RMail::Header::Field into rmail/header.rb. + +
  • +
  • Improve uniqueness of the MIME boundary generation by including +Time.now.tv_usec. + +
  • +
  • Correct broken docs for RMail::Header#match and RMail::Header#match? + +
  • +
+

Changes in RubyMail 0.12 (released 2003-01-13)

+
    +
  • Add an install.rb script. + +
  • +
+

Changes in RubyMail 0.11 (released 2003-01-11)

+
    +
  • parse->serialize "transparency" greatly improved. This means +that when you parse a message and then serialize it back out you almost +always get the exact same message back. This is true for all single part +messages as well as all validly formatted multipart MIME messages (and even +the most common invalidly formatted ones). + +

    +The result is that RMail can now be +used safely in mail filters without risking damaging cryptographic +signatures in the mails. +

    +
  • +
  • RMail::Header#add now uses to_str instead of to_s to convert arguments +to strings. This makes it behave more like standard Ruby classes. + +
  • +
  • RMail::Mailbox::MBoxReader +now always makes sure the last piece of data returned for each message is +the end of line terminator, even if one isn’t present in the input. + +
  • +
  • RMail::Parser::PushbackReader#read now takes nil argument to mean +"read all available input." Derived classes should now override +the #read_chunk +method instead of #read. + +
  • +
+

Changes in RubyMail 0.10 (released 2002-12-13)

+
    +
  • Added rmail/mailbox/mboxreader.rb to the distribution. + +
  • +
+

Changes in RubyMail 0.9 (released 2002-11-30)

+
    +
  • New RMail::Mailbox.parse_mbox method that can +be used to conveniently read raw messages out of a Unix mbox mailbox. + +
  • +
  • New RMail::Mailbox::MBoxReader +class in rmail/mailbox/mboxreader.rb. This class can be used to easily read +messages out of a file in Unix "mbox" format. + +
  • +
  • The RMail::Parser::PushbackReader class has been documented. It has moved +out of rmail/parser/multipart.rb into rmail/parser/pushbackreader.rb + +
  • +
  • Various documentation fixes. E.g. RMail::Parser.parse can take a +string as well as an IO object. + +
  • +
  • The RMail::Parser::PushbackReader has a setable chunk size. This is useful +mostly for testing. + +
  • +
  • Fix an uncaught exception when parsing multipart MIME messages that contain +only a preamble and an epilogue but no body parts. + +
  • +
  • Fix a bug where RMail::Parser.multipart? would not +return true if the multipart message actually didn’t have any parts. + +
  • +
+

Changes in RubyMail 0.8 (released 2002-03-18)

+
    +
  • The following has been removed from RubyMail and made part of the +RubyFilter package: + +
      +
    • All scripts that were in the RubyMail 0.7 bin directory. + +
    • +
    • Mail::LDA + +
    • +
    • Mail::Deliver + +
    • +
    • Mail::KeyedMailbox + +
    • +
    • Mail::MTA + +
    • +
    • Mail::AddressTagger + +
    • +
    +

    +This keeps RubyMail a small and simple mail package, and provides +RubyFilter as an example of how to use RubyMail to write a mail filter. +

    +
  • +
  • The Mail module has been renamed to RMail. I think "Mail" should be +reserved for things included in the standard distribution of Ruby. + +
  • +
  • RMail::Header#match and match? don’t require the name or value +arguments to be a case insensitive Regexps. Also, when the value argument +is converted to a string, it is passed through Regexp::escape first. + +
  • +
  • RMail::Parser#parse can now parse from a string. + +
  • +
  • Mail::Address#comments= can now take a simpple string to set just one +comment. + +
  • +
+

Changes in RubyMail 0.7 (released 2002-02-26)

+
    +
  • A new chunked input scheme that makes parsing huge messages about 7 times +faster in ruby 1.7 and 50 times faster in ruby 1.6. + +

    +When parsing a huge message that has a 2 megabyte attachment, RubyMail +running under ruby 1.7 is now faster than any email package for ruby, perl +or python. +

    +

    +I wrote a benchmark that reads a 2 megabyte email from a file and writes it +out again, doing this 100 times. The results are: +

    +
    +  ruby 1.7.2 w/rubymail (100 times)
    +       5.96s user  7.98s system 13.94s total
    +  ruby 1.6.6 w/rubymail (100 times)
    +      76.91s user  8.62s system 85.53s total
    +  ruby 1.7.2 w/tmail 0.10.1 (100 times)
    +       9.85s user 24.21s system 34.06s total
    +  ruby 1.6.6 w/tmail 0.10.0 (100 times)
    +      201.89s user 15.75s system 217.64s total
    +  python 2.2 w/email (100 times)
    +      76.73 user 15.16s system 91.89s total
    +  perl 5.006001 w/mimetools 5.411  (parsing on disk) (100 times)
    +      190.11s user 25.25s system 215.36s total
    +  perl 5.006001 w/mimetools 5.411  (parsing in memory) (100 times)
    +      962.69s user  6.77s system 969.46s total
    +
    +

    +This change also paves the way for streaming large messages to disk when +they start to get huge, so RAM isn’t needlessly used up. +

    +
  • +
  • Delivery to mbox files improved. + +
      +
    • won’t sleep forever waiting for the mailbox lock (flock) + +
    • +
    • won’t delivery to files that don’t look like an mbox (e.g. it +is not a file, not in the right format). + +
    • +
    • delivering to ’/dev/null’ is now a simple nop. + +
    • +
    +
  • +
  • Use the new File#fsync method when available in all of the mail delivery +functions. + +
  • +
  • Add bin/rsendmail.rb as another example of how I’m using RubyMail. + +
  • +
  • A new Mail::AddressTagger class, included for fun. Requires the hmac-sha1 +class (available in the ruby-hmac package on RAA). + +
  • +
+

Changes in RubyMail 0.6 (released 2002-02-15)

+
    +
  • Multipart MIME support. + +
      +
    • Mail::Parser now parses arbitrarily nested multipart MIME messages. + +
    • +
    • For the sake of dealing with multipart MIME messages, add the following +methods to Mail::Message: preamble, epilogue, multipart?, add_part, decode, part. + +
    • +
    +
  • +
  • A new Mail::AddressTagger class, for tagging addresses with +cryptographically verifiable extensions akin to TMDA. Requires the +hmac-sha1 module from the RAA. (experimental, I don’t currently use +this) + +
  • +
  • A new Mail::Message#== method. + +
  • +
  • A new Mail::Serialize class that can serialize a Mail::Message. + +
  • +
+

Changes in RubyMail 0.5 (released 2002-02-02)

+
    +
  • The rdeliver.rb script is now fully documented. + +
  • +
  • The rdeliver.rb script now evaluates the .rdeliver file in the context of a +Deliver class (as opposed to simply loading it). The .rdeliver file must +now define a Deliver#main method, where the simplest .rdeliver file would +be: + +
    +  def main
    +    lda.save("INBOX")
    +  end
    +
    +
  • +
  • Add a KeyedMailbox class that can be used to implement simple mailing list +style confirmations. + +
  • +
  • Add a message= method to Mail::DeliveryAgent. This lets delivery scripts +change the message being delivered. + +
  • +
  • Re-wrote the RFC2822 address parser. It is now more strict about what it +considers a valid address. + +
  • +
+

Changes in RubyMail 0.4 (released 2002-01-17)

+
    +
  • The bin/rdeliver.rb script is now tested. Got rid of bin/rdeliver-wrap.rb. + +
  • +
  • Mail::DeliveryAgent::DeliveryStatus renamed to +Mail::DeliveryAgent::DeliveryComplete. Mail::DeliveryAgent::DeliverFailure +renamed to Mail::DeliveryAgent::DeliveryPipeFailure. + +
  • +
  • Mail::Deliver.deliver_mbox now uses File::SYNC to write the message. + +
  • +
  • Mail::Header and Mail::Message no longer understand how to parse messages. +Message parsing has been moved to Mail::Parser. Mail::Parser uses the +public API of Mail::Header and Mail::Message to build up the message. + +
  • +
  • The Mail::Header API has been greatly changed. It is now more like Array +and Hash. + +
  • +
  • Mail::Deliver supports delivery to qmail style Maildir mailboxes. +Mail::DeliveryAgent#save will now deliver to a Maildir if the +folder’s name ends in a slash. E.g. "/home/user/Maildir/". + +
  • +
  • Mail::DeliveryAgent no longer logs an abstract of the message being +delivered. All logging is up to the users of Mail::DeliveryAgent. + +
  • +
+

Changes in RubyMail 0.3

+
    +
  • Add Mail::Header.length and Mail::Header.size methods. Add +Mail::Header.match and Mail::Header.match? methods. + +
  • +
  • Move deliver.rb to bin/rdeliver-wrap.rb and main.rb to bin/rdeliver.rb. +These are workable local delivery agent scripts (suitable for running from +.forward). + +
  • +
  • New Mail::MTA module that provides constants for exit codes. + +
  • +
  • New features for Mail::DeliveryAgent. Now Mail::DeliveryAgent never calls +exit, instead it throws DeliveryStatus exceptions. There is also a new +Mail::DeliveryAgent.process method that allows you to use +Mail::DeliveryAgent in block form. Mail:DeliveryAgent.exitcode will return +the correct exit code for a given DeliveryStatus exception. + +
  • +
+

Changes in RubyMail 0.2

+
    +
  • HTML API documentation is now available in the doc subdirectory. + +
  • +
  • Mail::DeliveryAgent::strip_tag is now +Mail::DeliveryAgent::strip_field_name. + +
  • +
  • Mail::Deliver::deliver_pipe implemented. Mail::DeliveryAgent#pipe +implemented. + +
  • +
  • Mail::DeliveryAgent#pipe and Mail::DeliveryAgent#save now report success or +failure with DeliverySuccess and DeliveryFailure exceptions. +Mail::DeliveryAgent#reject and Mail::DeliveryAgent#defer do not yet use the +exceptions (they still call exit). + +
  • +
  • Now runs clean under "ruby -w" + +
  • +
  • Now works with newer rubyunit versions. + +
  • +
+
+ + + + + + + + + + \ No newline at end of file diff --git a/doc/files/README.html b/doc/files/README.html new file mode 100644 index 0000000..3b86906 --- /dev/null +++ b/doc/files/README.html @@ -0,0 +1,143 @@ + + + + + + File: README + + + + + + + + + + +
+ +
README + + + + + + + + +
Path:README
Modified:Tue Apr 27 22:16:00 PDT 2004
+
+ + + + +

RubyMail

+

+This is RubyMail, a lightweight mail library containing various utility +classes and modules that allow Ruby scripts to parse, modify, and generate +MIME mail messages. +

+

Requirements

+

+Ruby 1.6.7 (or newer) or Ruby 1.8.*. Only tested under Linux, should be +fine under any Unix. +

+

Documentation

+

+The documentation is in RDoc format in the doc subdirectory. Aside from the +API reference, you will be interested in guide/Intro.txt and guide/TableOfContents.txt. +

+

Install

+

+Type the following while in the package directory: +

+
+  ruby install.rb config
+  ruby install.rb setup
+  ruby install.rb install
+
+

+You may need special permissions to execute the last line. If you want to +just install RubyMail to a custom location, just copy the rmail +subdirectory manually. +

+

Status

+

+This package works well, but I consider all API subject to change. +

+

+I very much appreciate suggestions and comments, but please think twice +about using this for production use just yet. +

+

Tests?

+

+This package has a complete unit test suite (requires RubyUnit to run). +Currently all of my e-mail is processed by this library. +

+

Why?

+

+It is fun. +

+

+One use for RubyMail is the RubyFilter package, available at: +

+
+    http://www.lickey.com/rubyfilter/
+
+

Alternatives

+

+You might check out TMail as well. +

+

Support

+

+To reach the author of RubyMail, send mail to matt@lickey.com. +

+

License

+
+ Copyright (C) 2001, 2002, 2003, 2004 Matt Armstrong.  All rights
+ reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+
+ 1. Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 3. The name of the author may not be used to endorse or promote products
+    derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/doc/files/THANKS.html b/doc/files/THANKS.html new file mode 100644 index 0000000..4f3005f --- /dev/null +++ b/doc/files/THANKS.html @@ -0,0 +1,95 @@ + + + + + + File: THANKS + + + + + + + + + + +
+ +
THANKS + + + + + + + + +
Path:THANKS
Modified:Sat Jan 18 20:44:49 PST 2003
+
+ + + + +

Thanks to Python’s email module for:

+
    +
  • The idea of separating parsing and serialization from the mail classes +themselves. + +
  • +
  • A lot of the MIME multipart API. + +
  • +
+

Thanks to Perl’s MimeTools for:

+
    +
  • Showing me this can all be done in the scripting language (no C extensions +necessary). + +
  • +
  • Accessing MIME parts via a File like API (thereby allowing them to be +stored on disk). + +
  • +
+

People:

+

+"Yoshinori K. Okuji" <okuji-at-enbug-dot-org> +

+
    +
  • Code to parse messages from strings (though since then I did it a much +simpler way). + +
  • +
  • Numerous other API suggestions and improvements. + +
  • +
+

+Booker Bense <bbense-at-SLAC-dot-Stanford-dot-EDU> +

+
    +
  • For prodding me to implement mbox mailbox parsing (and an initial +implementation). It took me months, but I did it! + +
  • +
+
+ + + + + + + + + + \ No newline at end of file diff --git a/doc/files/TODO.html b/doc/files/TODO.html new file mode 100644 index 0000000..e048af6 --- /dev/null +++ b/doc/files/TODO.html @@ -0,0 +1,229 @@ + + + + + + File: TODO + + + + + + + + + + +
+ +
TODO + + + + + + + + +
Path:TODO
Modified:Fri Feb 27 20:21:40 PST 2004
+
+ + + + +

+In rough priority order...but please let me know if something you need is +missing. +

+

FIXME

+
    +
  • StreamHandler should get preamble_begin and preamble_end callbacks. Same +for epilogue_begin, epilogue_end. + +
  • +
+

STOLEN

+
    +
  • Header continuation issue: +https://sourceforge.net/tracker/?func=detail&atid=105470&aid=504152&group_id=5470 + +
  • +
  • Subject: =?ISO-8859-1?Q?=24=A3_Kills_IRB?= + +
  • +
+

Documentation

+
    +
  • Make it clear that all strings the library works with are the ASCII strings +that are part of the RFC2822 message — not strings in any other +charset. + +
  • +
  • Update Intro.txt, write MIME.txt and other Guides. + +
  • +
+

Features

+
    +
  • RFC2231 mail.python.org/pipermail/email-sig/2003-November/000032.html + +
  • +
  • Smart handling of charset issues for text/ types. + +
    +
    Goal
    allow setting the body part to a given piece of data, and RMail handles setting the appropriate MIME +headers. This requires the data to have a known charset. + +
    +
    +

    +Maybe this plays into the encoding solution below. +

    +
  • +
  • Base64 and quoted-printable encoding + +
    +
    Goal
    allow setting the body part to a given piece of data, and RMail handles setting the appropriate MIME +headers and possibly quoted-printable or base64 transcoding it if +appropriate. + +
    +
    +

    +This may be best done by introducing an RMail::TransferEncodedString class +that knows whether it is transcoded as binary, quoted-printable, base64, +etc. You would set RMail::Message#body to a TransferEncodedString and RMail::Message would set the +appropriate MIME headers. If at serialization time the message body were +set to a plain String, then RMail::Message would transcode it +into base64. +

    +
  • +
  • An RMail::Message#attach method that takes care of setting +content-disposition, etc. + +
  • +
  • Header folding in RMail::Header. + +
  • +
  • A small wrapper around Net::SMTP#send_mail that takes care of: + +
      +
    • parsing recipients out of the various message headers + +
    • +
    • deleting the Bcc: header + +
    • +
    • sending the message + +
    • +
    +
  • +
  • Provide a way to parse just the message headers, leaving the rest in the +input stream (for use by RubyFilter). This also implies a feature that +parses a message body given a RMail::Header object and an input +stream. This should be easy — read line by line until you get an +empty line or EOF, then pass that off to parse_header as a string to be +parsed. Parsing the body can just use a PushbackReader. + +
  • +
  • Handle different end of line terminators everywhere (for both parsing and +generating). + +
  • +
  • Provide some way when parsing a message to start spooling to disk for +really large messages. This would be easy to do depending on how message +body transparency is implemented. + +
  • +
  • MIME charset support in header fields and message bodies. This requires +m18n support in ruby, so it won’t be coming soon. + +
  • +
  • Maildir parsing. + +
  • +
  • Simplify the Parser such that the class used to hold the parse result can +be easily changed and so the memory used can be minimized. + +

    +The idea is to support "bogofilter" style parsing where the data +of the parse is immediately processed and thrown away but the structure and +content of the parsed message is important. +

    +

    +This may require extensions to header parsing, where things like the +important MIME header fields can be parsed without creating a whole RMail::Header object. +

    +
  • +
+

Minor Features

+
    +
  • Untainting of email addresses. See Perl’s CGI::Untaint::email. + +
  • +
  • Parser for Received: headers. See Perl’s Mail::Field::Received. + +
  • +
+

Documentation Tasks

+
    +
  • A "howto" like documentation. + +
      +
    • How to write out a base64 encoded MIME part to a file. + +
    • +
    • How to parse a unix MBOX file. + +
    • +
    • MIME operations (see RFC2047) + +
        +
      • Character sets in message bodies + +
      • +
      • Non-textual message bodies + +
      • +
      • Multi-part message bodies + +
      • +
      • Textual header information in character sets other than US-ASCII. + +
      • +
      +
    • +
    +
  • +
  • Go through every class and make sure the methods are sorted in a sensible +order so the RDoc output is nice. + +
  • +
+
+ + + + + + + + + + \ No newline at end of file diff --git a/doc/files/guide/Intro_txt.html b/doc/files/guide/Intro_txt.html new file mode 100644 index 0000000..48f0eb3 --- /dev/null +++ b/doc/files/guide/Intro_txt.html @@ -0,0 +1,218 @@ + + + + + + File: Intro.txt + + + + + + + + + + +
+ +
Intro.txt + + + + + + + + +
Path:guide/Intro.txt
Modified:Wed Jan 15 20:46:44 PST 2003
+
+ + + + +

Introduction to RubyMail

+

+This will get you started with the basics of using RubyMail. +

+

Turning Text into a Message Object

+
+    message = RMail::Parser.read(input)
+
+

+The input can be a normal Ruby IO object or a string. The result is a RMail::Message object. See RMail::Parser for more +information. +

+

Turning a Message Object into Text

+
+    File.open('my-message', 'w') { |f|
+      RMail::Serialize.write(f, message)
+    }
+
+

+or +

+
+    string = RMail::Serialize.write('', message)
+
+

+See RMail::Serialize for +more information. +

+

+A convenient shortcut when you want the message as a string is +RMail::Message#to_s. +

+
+    string = message.to_s
+
+

+You can also use RMail::Message#each to process each line of the serialized +message in turn. +

+
+    message.each { |line|
+      puts line
+    }
+
+

Manipulating a Message

+

+You use the methods of the RMail::Message and RMail::Header classes to +manipulate the message. +

+

Retrieve the Body

+

+You can retrieve the text of a single part message with +RMail::Message#body. +

+
+    body = message.body
+
+

+But beware that if the message is a MIME multipart message, body +will be an Array of RMail::Message objects. If you +know you have a MIME multipart message (easily tested with +RMail::Message#multipart?), then you can retrieve them individually with +RMail::Message#part and RMail::Message#each_part. +

+
+    first_part = message.part(0)
+
+    message.each_part { |part|
+        # do something with part
+    }
+
+

+See guide/MIME.txt for more tips on dealing +with MIME messages. +

+

Manipulate the Message Headers

+

+The RMail::Message#header method retrieves the RMail::Header object that every +message contains. You can then use RMail::Header methods to +manipulate the message’s header. +

+

+People often confuse a "message header" with "header +fields." In RubyMail a "header" always means the entire +header of the message, while "field" means an individual header +field (e.g. "Subject"). +

+

+To append new fields, simply access assign to them like an array: +

+
+    message.header['To'] = 'bob@example.net'
+    message.header['From'] = 'sally@example.net'
+
+

+Note that the above will always append a new header, so you must +delete existing headers if you want only one. +

+

+To retrieve fields, you can access the header like an array. This will +return the field value. +

+
+    subject = message.header['Subject']
+
+

+Of course, a header may have several fields with the same name. To retrieve +all the values you can use RMail::Header.match. +

+
+    destinations = message.header.match(/^(to|cc|bcc)$/, nil)
+
+

+See the RMail::Header +documentation for many other useful functions. +

+

Dealing with Email Addresses

+

+The address syntax for Internet email messages (as specified in RFC2822) is +complex. RubyMail contains the RMail::Address class that can +be used to parse and generate these addresses in a robust way. For example, +to retrieve all destination addresses from a RMail::Header object: +

+
+    recipients = RMail::Address.parse(header.match(/^(to|cc)/, nil))
+
+

+Then print out just the address portion: +

+
+    recipients.each { |r|
+      r.address
+    }
+
+

+When creating an address from scratch, you typically do this: +

+
+    address = RMail::Address.new("Bob Smith <bob@example.net>")
+
+

+Then to get the text form of the address form back: +

+
+    address.format
+
+

+TODO: addresses can be keys of a hash, sorted, +etc… +

+

More Topics

+

+This is just the beginning. See guide/TableOfContents.txt for a list of +other things covered in this guide. +

+
+ + + + + + + + + + \ No newline at end of file diff --git a/doc/files/guide/MIME_txt.html b/doc/files/guide/MIME_txt.html new file mode 100644 index 0000000..0a9518a --- /dev/null +++ b/doc/files/guide/MIME_txt.html @@ -0,0 +1,61 @@ + + + + + + File: MIME.txt + + + + + + + + + + +
+ +
MIME.txt + + + + + + + + +
Path:guide/MIME.txt
Modified:Thu Apr 10 07:45:11 PDT 2003
+
+ + + + +

MIME Support in RubyMail

+

+FIXME: write this. TODO: show how to add, +delete, decode and encode parts. +

+

+rwiki.moonwolf.com/rw-cgi.cgi?cmd=view;name=RubyMail +

+
+ + + + + + + + + + \ No newline at end of file diff --git a/doc/files/guide/TableOfContents_txt.html b/doc/files/guide/TableOfContents_txt.html new file mode 100644 index 0000000..987191b --- /dev/null +++ b/doc/files/guide/TableOfContents_txt.html @@ -0,0 +1,72 @@ + + + + + + File: TableOfContents.txt + + + + + + + + + + +
+ +
TableOfContents.txt + + + + + + + + +
Path:guide/TableOfContents.txt
Modified:Mon Jan 13 22:05:25 PST 2003
+
+ + + + +

RubyMail Guide Table of Contents

+
+
guide/Intro.txt
Brief introduction to RubyMail. + +
+
guide/MIME.txt
How to perform common operations on MIME messages. + +
+
guide/SMTP.txt
How to send a RubyMail message out using the standard Ruby net/smtp.rb +package. + +
+
guide/POP.txt
How to parse a RubyMail message directly from a POP server using the +standard net/pop.rb package. + +
+
guide/Mailbox.txt
How to read mailboxes of various formats. + +
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/doc/files/lib/rmail/address_rb.html b/doc/files/lib/rmail/address_rb.html new file mode 100644 index 0000000..da1be27 --- /dev/null +++ b/doc/files/lib/rmail/address_rb.html @@ -0,0 +1,81 @@ + + + + + + File: address.rb + + + + + + + + + + +
+ +
address.rb + + + + + + + + +
Path:lib/rmail/address.rb
Modified:Wed Dec 31 13:11:27 PST 2003
+
+ + + + +

+Implements the RMail::Address, RMail::Address::List, +and RMail::Address::Parser +classes. Together, these classes allow you to robustly parse, manipulate, +and generate RFC2822 email addresses and address lists. +

+
+ + + + + + + +
Classes and Modules
+
+Module RMail
+  ::Module RMail::Mailbox
+  ::  ::Class RMail::Mailbox::MBoxReader
+  ::Module RMail::Utils
+  ::Class RMail::Address
+  ::  ::Class RMail::Address::List
+  ::  ::Class RMail::Address::Parser
+  ::Class RMail::Header
+  ::Class RMail::Message
+  ::Class RMail::Parser
+  ::  ::Class RMail::Parser::Error
+  ::Class RMail::Serialize
+  ::Class RMail::StreamHandler
+  ::Class RMail::StreamParser
+ +
+ + + + + \ No newline at end of file diff --git a/doc/files/lib/rmail/header_rb.html b/doc/files/lib/rmail/header_rb.html new file mode 100644 index 0000000..75396eb --- /dev/null +++ b/doc/files/lib/rmail/header_rb.html @@ -0,0 +1,86 @@ + + + + + + File: header.rb + + + + + + + + + + +
+ +
header.rb + + + + + + + + +
Path:lib/rmail/header.rb
Modified:Tue Mar 09 22:01:52 PST 2004
+
+ + + + +

+Implements the RMail::Header class. +

+
+ + + +
Required files
+
+rmail/utils    +rmail/address    +digest/md5    +time    +socket    +
+ + + + + + +
Classes and Modules
+
+Module RMail
+  ::Module RMail::Mailbox
+  ::  ::Class RMail::Mailbox::MBoxReader
+  ::Module RMail::Utils
+  ::Class RMail::Address
+  ::  ::Class RMail::Address::List
+  ::  ::Class RMail::Address::Parser
+  ::Class RMail::Header
+  ::Class RMail::Message
+  ::Class RMail::Parser
+  ::  ::Class RMail::Parser::Error
+  ::Class RMail::Serialize
+  ::Class RMail::StreamHandler
+  ::Class RMail::StreamParser
+ +
+ + + + + \ No newline at end of file diff --git a/doc/files/lib/rmail/mailbox/mboxreader_rb.html b/doc/files/lib/rmail/mailbox/mboxreader_rb.html new file mode 100644 index 0000000..4d4d001 --- /dev/null +++ b/doc/files/lib/rmail/mailbox/mboxreader_rb.html @@ -0,0 +1,83 @@ + + + + + + File: mboxreader.rb + + + + + + + + + + +
+ +
mboxreader.rb + + + + + + + + +
Path:lib/rmail/mailbox/mboxreader.rb
Modified:Sat Feb 08 21:40:17 PST 2003
+
+ + + + +

+Implements the RMail::Mailbox::MBoxReader +class. +

+
+ + + +
Required files
+
+rmail/parser/pushbackreader    +
+ + + + + + +
Classes and Modules
+
+Module RMail
+  ::Module RMail::Mailbox
+  ::  ::Class RMail::Mailbox::MBoxReader
+  ::Module RMail::Utils
+  ::Class RMail::Address
+  ::  ::Class RMail::Address::List
+  ::  ::Class RMail::Address::Parser
+  ::Class RMail::Header
+  ::Class RMail::Message
+  ::Class RMail::Parser
+  ::  ::Class RMail::Parser::Error
+  ::Class RMail::Serialize
+  ::Class RMail::StreamHandler
+  ::Class RMail::StreamParser
+ +
+ + + + + \ No newline at end of file diff --git a/doc/files/lib/rmail/mailbox_rb.html b/doc/files/lib/rmail/mailbox_rb.html new file mode 100644 index 0000000..b032782 --- /dev/null +++ b/doc/files/lib/rmail/mailbox_rb.html @@ -0,0 +1,82 @@ + + + + + + File: mailbox.rb + + + + + + + + + + +
+ +
mailbox.rb + + + + + + + + +
Path:lib/rmail/mailbox.rb
Modified:Sat Feb 08 21:35:21 PST 2003
+
+ + + + +

+Implements the RMail::Mailbox module. +

+
+ + + +
Required files
+
+rmail/mailbox/mboxreader    +
+ + + + + + +
Classes and Modules
+
+Module RMail
+  ::Module RMail::Mailbox
+  ::  ::Class RMail::Mailbox::MBoxReader
+  ::Module RMail::Utils
+  ::Class RMail::Address
+  ::  ::Class RMail::Address::List
+  ::  ::Class RMail::Address::Parser
+  ::Class RMail::Header
+  ::Class RMail::Message
+  ::Class RMail::Parser
+  ::  ::Class RMail::Parser::Error
+  ::Class RMail::Serialize
+  ::Class RMail::StreamHandler
+  ::Class RMail::StreamParser
+ +
+ + + + + \ No newline at end of file diff --git a/doc/files/lib/rmail/message_rb.html b/doc/files/lib/rmail/message_rb.html new file mode 100644 index 0000000..05481f6 --- /dev/null +++ b/doc/files/lib/rmail/message_rb.html @@ -0,0 +1,83 @@ + + + + + + File: message.rb + + + + + + + + + + +
+ +
message.rb + + + + + + + + +
Path:lib/rmail/message.rb
Modified:Sun Feb 09 12:21:00 PST 2003
+
+ + + + +

+Implements the RMail::Message class. +

+
+ + + +
Required files
+
+rmail/header.rb    +rmail/serialize    +
+ + + + + + +
Classes and Modules
+
+Module RMail
+  ::Module RMail::Mailbox
+  ::  ::Class RMail::Mailbox::MBoxReader
+  ::Module RMail::Utils
+  ::Class RMail::Address
+  ::  ::Class RMail::Address::List
+  ::  ::Class RMail::Address::Parser
+  ::Class RMail::Header
+  ::Class RMail::Message
+  ::Class RMail::Parser
+  ::  ::Class RMail::Parser::Error
+  ::Class RMail::Serialize
+  ::Class RMail::StreamHandler
+  ::Class RMail::StreamParser
+ +
+ + + + + \ No newline at end of file diff --git a/doc/files/lib/rmail/parser/multipart_rb.html b/doc/files/lib/rmail/parser/multipart_rb.html new file mode 100644 index 0000000..ddadd02 --- /dev/null +++ b/doc/files/lib/rmail/parser/multipart_rb.html @@ -0,0 +1,81 @@ + + + + + + File: multipart.rb + + + + + + + + + + +
+ +
multipart.rb + + + + + + + + +
Path:lib/rmail/parser/multipart.rb
Modified:Fri Mar 19 20:50:01 PST 2004
+
+ + + + +

+Implements the RMail::Parser::MultipartReader class. +

+
+ + + +
Required files
+
+rmail/parser/pushbackreader    +
+ + + + + + +
Classes and Modules
+
+Module RMail
+  ::Module RMail::Mailbox
+  ::  ::Class RMail::Mailbox::MBoxReader
+  ::Module RMail::Utils
+  ::Class RMail::Address
+  ::  ::Class RMail::Address::List
+  ::  ::Class RMail::Address::Parser
+  ::Class RMail::Header
+  ::Class RMail::Message
+  ::Class RMail::Parser
+  ::  ::Class RMail::Parser::Error
+  ::Class RMail::Serialize
+  ::Class RMail::StreamHandler
+  ::Class RMail::StreamParser
+ +
+ + + + + \ No newline at end of file diff --git a/doc/files/lib/rmail/parser/pushbackreader_rb.html b/doc/files/lib/rmail/parser/pushbackreader_rb.html new file mode 100644 index 0000000..b8860c5 --- /dev/null +++ b/doc/files/lib/rmail/parser/pushbackreader_rb.html @@ -0,0 +1,75 @@ + + + + + + File: pushbackreader.rb + + + + + + + + + + +
+ +
pushbackreader.rb + + + + + + + + +
Path:lib/rmail/parser/pushbackreader.rb
Modified:Sat Feb 08 21:47:51 PST 2003
+
+ + + + +

+Implements the RMail::Parser::PushbackReader class. +

+
+ + + + + + + +
Classes and Modules
+
+Module RMail
+  ::Module RMail::Mailbox
+  ::  ::Class RMail::Mailbox::MBoxReader
+  ::Module RMail::Utils
+  ::Class RMail::Address
+  ::  ::Class RMail::Address::List
+  ::  ::Class RMail::Address::Parser
+  ::Class RMail::Header
+  ::Class RMail::Message
+  ::Class RMail::Parser
+  ::  ::Class RMail::Parser::Error
+  ::Class RMail::Serialize
+  ::Class RMail::StreamHandler
+  ::Class RMail::StreamParser
+ +
+ + + + + \ No newline at end of file diff --git a/doc/files/lib/rmail/parser_rb.html b/doc/files/lib/rmail/parser_rb.html new file mode 100644 index 0000000..45cef7f --- /dev/null +++ b/doc/files/lib/rmail/parser_rb.html @@ -0,0 +1,87 @@ + + + + + + File: parser.rb + + + + + + + + + + +
+ +
parser.rb + + + + + + + + +
Path:lib/rmail/parser.rb
Modified:Fri Feb 27 20:10:31 PST 2004
+
+ + + + +

+Implements the RMail::Parser, RMail::StreamParser and +RMail::StreamHandler +classes. +

+
+ + + +
Required files
+
+rmail/message    +rmail/parser/multipart    +
+ + + + + + +
Classes and Modules
+
+Module RMail
+  ::Module RMail::Mailbox
+  ::  ::Class RMail::Mailbox::MBoxReader
+  ::Module RMail::Utils
+  ::Class RMail::Address
+  ::  ::Class RMail::Address::List
+  ::  ::Class RMail::Address::Parser
+  ::Class RMail::Header
+  ::Class RMail::Message
+  ::Class RMail::Parser
+  ::  ::Class RMail::Parser::Error
+  ::Class RMail::Serialize
+  ::Class RMail::StreamHandler
+  ::Class RMail::StreamParser
+ +
+ + + + + \ No newline at end of file diff --git a/doc/files/lib/rmail/serialize_rb.html b/doc/files/lib/rmail/serialize_rb.html new file mode 100644 index 0000000..c666fd3 --- /dev/null +++ b/doc/files/lib/rmail/serialize_rb.html @@ -0,0 +1,76 @@ + + + + + + File: serialize.rb + + + + + + + + + + +
+ +
serialize.rb + + + + + + + + +
Path:lib/rmail/serialize.rb
Modified:Sat Feb 08 21:46:58 PST 2003
+
+ + + + +

+Implements the RMail::Serialize class. +

+
+ + + + + + + +
Classes and Modules
+
+Module RMail
+  ::Module RMail::Mailbox
+  ::  ::Class RMail::Mailbox::MBoxReader
+  ::Module RMail::Utils
+  ::Class RMail::Address
+  ::  ::Class RMail::Address::List
+  ::  ::Class RMail::Address::Parser
+  ::Class RMail::Header
+  ::Class RMail::Message
+  ::Class RMail::Parser
+  ::  ::Class RMail::Parser::Error
+  ::Class RMail::Serialize
+  ::Class RMail::StreamHandler
+  ::Class RMail::StreamParser
+ +
+ + + + + \ No newline at end of file diff --git a/doc/files/lib/rmail/utils_rb.html b/doc/files/lib/rmail/utils_rb.html new file mode 100644 index 0000000..c9d1c1c --- /dev/null +++ b/doc/files/lib/rmail/utils_rb.html @@ -0,0 +1,76 @@ + + + + + + File: utils.rb + + + + + + + + + + +
+ +
utils.rb + + + + + + + + +
Path:lib/rmail/utils.rb
Modified:Sat Feb 08 21:38:58 PST 2003
+
+ + + + +

+Implements the RMail::Utils +module. +

+
+ + + + + + + +
Classes and Modules
+
+Module RMail
+  ::Module RMail::Mailbox
+  ::  ::Class RMail::Mailbox::MBoxReader
+  ::Module RMail::Utils
+  ::Class RMail::Address
+  ::  ::Class RMail::Address::List
+  ::  ::Class RMail::Address::Parser
+  ::Class RMail::Header
+  ::Class RMail::Message
+  ::Class RMail::Parser
+  ::  ::Class RMail::Parser::Error
+  ::Class RMail::Serialize
+  ::Class RMail::StreamHandler
+  ::Class RMail::StreamParser
+ +
+ + + + + \ No newline at end of file diff --git a/doc/files/lib/rmail_rb.html b/doc/files/lib/rmail_rb.html new file mode 100644 index 0000000..e5cb199 --- /dev/null +++ b/doc/files/lib/rmail_rb.html @@ -0,0 +1,98 @@ + + + + + + File: rmail.rb + + + + + + + + + + +
+ +
rmail.rb + + + + + + + + +
Path:lib/rmail.rb
Modified:Fri Feb 07 20:44:17 PST 2003
+
+ + + + +

+This module allows you to simply +

+
+ require 'rmail'
+
+

+in your ruby scripts and have all of the RMail module required. This provides +maximum convenience when the startup time of your script is not crucial. +

+
+ + + +
Required files
+
+rmail/address    +rmail/header    +rmail/mailbox    +rmail/message    +rmail/parser    +rmail/serialize    +rmail/utils    +rmail/mailbox/mboxreader    +rmail/parser/multipart    +rmail/parser/pushbackreader    +
+ + + + + + +
Classes and Modules
+
+Module RMail
+  ::Module RMail::Mailbox
+  ::  ::Class RMail::Mailbox::MBoxReader
+  ::Module RMail::Utils
+  ::Class RMail::Address
+  ::  ::Class RMail::Address::List
+  ::  ::Class RMail::Address::Parser
+  ::Class RMail::Header
+  ::Class RMail::Message
+  ::Class RMail::Parser
+  ::  ::Class RMail::Parser::Error
+  ::Class RMail::Serialize
+  ::Class RMail::StreamHandler
+  ::Class RMail::StreamParser
+ +
+ + + + + \ No newline at end of file diff --git a/doc/fr_class_index.html b/doc/fr_class_index.html new file mode 100644 index 0000000..5a5b811 --- /dev/null +++ b/doc/fr_class_index.html @@ -0,0 +1,51 @@ + + + + + + +Classes + + + + + +RMail
+RMail::Address
+RMail::Address::List
+RMail::Address::Parser
+RMail::Header
+RMail::Mailbox
+RMail::Mailbox::MBoxReader
+RMail::Message
+RMail::Parser
+RMail::Parser::Error
+RMail::Serialize
+RMail::StreamHandler
+RMail::StreamParser
+RMail::Utils
+ \ No newline at end of file diff --git a/doc/fr_file_index.html b/doc/fr_file_index.html new file mode 100644 index 0000000..a40f402 --- /dev/null +++ b/doc/fr_file_index.html @@ -0,0 +1,55 @@ + + + + + + +Files + + + + + +NEWS
+README
+THANKS
+TODO
+guide/Intro.txt
+guide/MIME.txt
+guide/TableOfContents.txt
+lib/rmail.rb
+lib/rmail/address.rb
+lib/rmail/header.rb
+lib/rmail/mailbox.rb
+lib/rmail/mailbox/mboxreader.rb
+lib/rmail/message.rb
+lib/rmail/parser.rb
+lib/rmail/parser/multipart.rb
+lib/rmail/parser/pushbackreader.rb
+lib/rmail/serialize.rb
+lib/rmail/utils.rb
+ \ No newline at end of file diff --git a/doc/fr_method_index.html b/doc/fr_method_index.html new file mode 100644 index 0000000..ab6ec7c --- /dev/null +++ b/doc/fr_method_index.html @@ -0,0 +1,165 @@ + + + + + + +Methods + + + + + +<=> (RMail::Address)
+== (RMail::Message)
+== (RMail::Header)
+[] (RMail::Header)
+[]= (RMail::Header)
+add (RMail::Header)
+add_message_id (RMail::Header)
+add_part (RMail::Message)
+add_raw (RMail::Header)
+address (RMail::Address)
+address_list_assign (RMail::Header)
+address_list_fetch (RMail::Header)
+addresses (RMail::Address::List)
+base64_decode (RMail::Utils)
+bcc (RMail::Header)
+bcc= (RMail::Header)
+body (RMail::Message)
+body= (RMail::Message)
+body_begin (RMail::StreamHandler)
+body_chunk (RMail::StreamHandler)
+body_end (RMail::StreamHandler)
+cc (RMail::Header)
+cc= (RMail::Header)
+clear (RMail::Header)
+clone (RMail::Header)
+comments (RMail::Address)
+comments= (RMail::Address)
+content_type (RMail::Header)
+date (RMail::Header)
+date= (RMail::Header)
+decode (RMail::Message)
+delete (RMail::Header)
+delete_at (RMail::Header)
+delete_if (RMail::Header)
+display_name (RMail::Address)
+display_name= (RMail::Address)
+display_names (RMail::Address::List)
+domain (RMail::Address)
+domain= (RMail::Address)
+domains (RMail::Address::List)
+dup (RMail::Header)
+each (RMail::Message)
+each (RMail::Header)
+each_key (RMail::Header)
+each_message (RMail::Mailbox::MBoxReader)
+each_name (RMail::Header)
+each_pair (RMail::Header)
+each_part (RMail::Message)
+each_value (RMail::Header)
+empty? (RMail::Header)
+eof (RMail::Mailbox::MBoxReader)
+epilogue_chunk (RMail::StreamHandler)
+eql? (RMail::Address)
+fetch (RMail::Header)
+fetch_all (RMail::Header)
+field? (RMail::Header)
+format (RMail::Address)
+format (RMail::Address::List)
+from (RMail::Header)
+from= (RMail::Header)
+has_key? (RMail::Header)
+hash (RMail::Address)
+header (RMail::Message)
+header_field (RMail::StreamHandler)
+include? (RMail::Header)
+key? (RMail::Header)
+keys (RMail::Header)
+length (RMail::Header)
+local (RMail::Address)
+local= (RMail::Address)
+locals (RMail::Address::List)
+match (RMail::Header)
+match? (RMail::Header)
+mbox_from (RMail::StreamHandler)
+mbox_from (RMail::Header)
+mbox_from= (RMail::Header)
+media_type (RMail::Header)
+member? (RMail::Header)
+message_id (RMail::Header)
+multipart? (RMail::Message)
+multipart_body_begin (RMail::StreamHandler)
+multipart_body_end (RMail::StreamHandler)
+name (RMail::Address)
+names (RMail::Address::List)
+names (RMail::Header)
+new (RMail::Message)
+new (RMail::Address::Parser)
+new (RMail::Header)
+new (RMail::Mailbox::MBoxReader)
+new (RMail::Serialize)
+new (RMail::Address)
+new (RMail::Parser)
+next (RMail::Mailbox::MBoxReader)
+param (RMail::Header)
+params (RMail::Header)
+parse (RMail::Address::Parser)
+parse (RMail::Address)
+parse (RMail::Parser)
+parse (RMail::StreamParser)
+parse_mbox (RMail::Mailbox)
+part (RMail::Message)
+part_begin (RMail::StreamHandler)
+part_end (RMail::StreamHandler)
+preamble_chunk (RMail::StreamHandler)
+quoted_printable_decode (RMail::Utils)
+read (RMail::Parser)
+read_chunk (RMail::Mailbox::MBoxReader)
+recipients (RMail::Header)
+replace (RMail::Header)
+reply_to (RMail::Header)
+reply_to= (RMail::Header)
+select (RMail::Header)
+serialize (RMail::Serialize)
+set (RMail::Header)
+set_boundary (RMail::Header)
+size (RMail::Header)
+subject (RMail::Header)
+subject= (RMail::Header)
+subtype (RMail::Header)
+to (RMail::Header)
+to= (RMail::Header)
+to_a (RMail::Header)
+to_s (RMail::Header)
+to_s (RMail::Message)
+to_str (RMail::Address)
+to_string (RMail::Header)
+unquote (RMail::Utils)
+write (RMail::Serialize)
+ \ No newline at end of file diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 0000000..52497a7 --- /dev/null +++ b/doc/index.html @@ -0,0 +1,22 @@ + + + + + +RubyMail Documentation (version 0.17) + + + + + + + + + + <body bgcolor="white"> + Sorry, RDoc currently only generates HTML using frames. + </body> + + + + \ No newline at end of file diff --git a/doc/rdoc-style.css b/doc/rdoc-style.css new file mode 100644 index 0000000..2a84365 --- /dev/null +++ b/doc/rdoc-style.css @@ -0,0 +1,99 @@ + +body,td,p { font-family: Verdana, Arial, Helvetica, sans-serif; + color: #000040; +} + +.attr-rw { font-size: x-small; color: #444488 } + +.title-row { background: #0000aa; + color: #eeeeff; +} + +.big-title-font { color: white; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: large; + height: 50px} + +.small-title-font { color: aqua; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: xx-small; } + +.aqua { color: aqua } + +.method-name, attr-name { + font-family: monospace; font-weight: bold; +} + +.tablesubtitle, .tablesubsubtitle { + width: 100%; + margin-top: 1ex; + margin-bottom: .5ex; + padding: 5px 0px 5px 20px; + font-size: large; + color: aqua; + background: #3333cc; +} + +.name-list { + font-family: monospace; + margin-left: 40px; + margin-bottom: 2ex; + line-height: 140%; +} + +.description { + margin-left: 40px; + margin-top: -2ex; + margin-bottom: 2ex; +} + +.description p { + line-height: 140%; +} + +.aka { + margin-left: 40px; + margin-bottom: 2ex; + line-height: 100%; + font-size: small; + color: #808080; +} + +.methodtitle { + font-size: medium; + text-decoration: none; + color: #0000AA; + background: white; +} + +.paramsig { + font-size: small; +} + +.srcbut { float: right } + +pre { font-size: 1.2em; } +tt { font-size: 1.2em; } + +pre.source { + border-style: groove; + background-color: #ddddff; + margin-left: 40px; + padding: 1em 0em 1em 2em; +} + +.classlist { + margin-left: 40px; + margin-bottom: 2ex; + line-height: 140%; +} + +li { + display: list-item; + margin-top: .6em; +} + +.kw { color: #3333FF; font-weight: bold } +.cmt { color: green; font-style: italic } +.str { color: #662222; font-style: italic } +.re { color: #662222; } \ No newline at end of file -- debian/patches/0001-Do-not-quote-params-twice-in-a-set-boundary.patch0000644000000000000000000000165411765211160022343 0ustar From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= Date: Sat, 2 Jun 2012 02:03:08 +0200 Subject: Do not quote params twice in a set boundary This patch was obtained from these bugs in the upstream BTS: * http://rubyforge.org/tracker/index.php?func=detail&aid=2170&group_id=446&atid=1754 * http://rubyforge.org/tracker/index.php?func=detail&aid=2661&group_id=446&atid=1756 --- lib/rmail/header.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/rmail/header.rb b/lib/rmail/header.rb index 9102f28..2152f48 100644 --- a/lib/rmail/header.rb +++ b/lib/rmail/header.rb @@ -630,7 +630,7 @@ module RMail # Set the boundary parameter of this message's Content-Type: # field. def set_boundary(boundary) - params = params_quoted('content-type') + params = params('content-type') params ||= {} params['boundary'] = boundary content_type = content_type() -- debian/ruby-rubymail-doc.examples0000644000000000000000000000000511765211160014267 0ustar test debian/ruby-rubymail-doc.install0000644000000000000000000000005511765211160014124 0ustar doc/* /usr/share/doc/ruby-rubymail-doc/html/ debian/dirs0000644000000000000000000000001511765211160010046 0ustar usr/lib/ruby