Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding message.errors and also other wild content type handlings foun…

…d from enron and corpus database run, changing Peter's body auto encode to only try decoding when asked to
  • Loading branch information...
commit 132bcff0a5a1e360d4e0847df334398ab6f7ea1c 1 parent 26eb925
@mikel authored
Showing with 754 additions and 15 deletions.
  1. +2 −0  .bundle/config
  2. +9 −0 CHANGELOG.rdoc
  3. +7 −4 lib/mail/attachments_list.rb
  4. +1 −4 lib/mail/body.rb
  5. +4 −1 lib/mail/elements/content_transfer_encoding_element.rb
  6. +3 −1 lib/mail/field.rb
  7. +2 −0  lib/mail/fields/content_transfer_encoding_field.rb
  8. +4 −0 lib/mail/fields/structured_field.rb
  9. +5 −0 lib/mail/fields/unstructured_field.rb
  10. +6 −0 lib/mail/header.rb
  11. +25 −2 lib/mail/message.rb
  12. +231 −0 spec/fixtures/emails/error_emails/content_transfer_encoding_7-bit.eml
  13. +33 −0 spec/fixtures/emails/error_emails/content_transfer_encoding_empty.eml
  14. +148 −0 spec/fixtures/emails/error_emails/content_transfer_encoding_plain.eml
  15. +53 −0 spec/fixtures/emails/error_emails/content_transfer_encoding_qp_with_space.eml
  16. +44 −0 spec/fixtures/emails/error_emails/content_transfer_encoding_spam.eml
  17. +50 −0 spec/fixtures/emails/error_emails/content_transfer_encoding_text-html.eml
  18. +79 −0 spec/fixtures/emails/error_emails/content_transfer_encoding_x_uuencode.eml
  19. +1 −1  spec/mail/attachments_spec.rb
  20. +10 −0 spec/mail/field_spec.rb
  21. +11 −2 spec/mail/fields/content_transfer_encoding_field_spec.rb
  22. +12 −0 spec/mail/header_spec.rb
  23. +14 −0 spec/mail/message_spec.rb
View
2  .bundle/config
@@ -0,0 +1,2 @@
+---
+BUNDLE_WITHOUT: ""
View
9 CHANGELOG.rdoc
@@ -1,3 +1,12 @@
+== Sun Mar 28 00:26:27 UTC 2010 Mikel Lindsaar <raasdnil@gmail.com>
+
+* Merged in Jeremy/treetop to vendored treetop
+* Merged in nathansobo/treetop to vendored treetop
+* Merged in pzbowen/mail into mail - Adds body auto encoding - awesome work
+* Fixed content-transfer-encoding parser to be more compliant per RFC, also now handles trailing semi-colons correctly
+* Fixed content-transfer-encoding parser to handle weird "from the wild" misspellings
+* Added message.errors, header.errors arrays, returns array of [field_name, value, error_object] for each field that failed to parse
+
== Wed Feb 24 09:14:56 UTC 2010 Mikel Lindsaar <raasdnil@gmail.com>
* Fixed multiaddress bounce messages crashing when calling .bounced? Now just take the first report and return that.
View
11 lib/mail/attachments_list.rb
@@ -39,10 +39,13 @@ def []=(name, value)
default_values[:body] = value.delete(:data) if value[:data]
- if value[:transfer_encoding]
- default_values[:content_transfer_encoding] = value.delete(:transfer_encoding)
- elsif value[:encoding]
- default_values[:content_transfer_encoding] = value.delete(:encoding)
+ encoding = value.delete(:transfer_encoding) || value.delete(:encoding)
+ if encoding
+ if Mail::Encodings.defined? encoding
+ default_values[:content_transfer_encoding] = encoding
+ else
+ raise "Do not know how to handle Content Transfer Encoding #{encoding}, please choose either quoted-printable or base64"
+ end
end
if value[:mime_type]
View
5 lib/mail/body.rb
@@ -173,12 +173,9 @@ def encoding(val = nil)
end
def encoding=( val )
- if val == "text" then
+ if val == "text" || val.blank? then
val = "8bit"
end
- if !Mail::Encodings.defined? val
- raise UnknownEncodingType, "Don't know how to decode #{val}, please decode first"
- end
@encoding = (val == "text") ? "8bit" : val
end
View
5 lib/mail/elements/content_transfer_encoding_element.rb
@@ -6,7 +6,10 @@ class ContentTransferEncodingElement
def initialize( string )
parser = Mail::ContentTransferEncodingParser.new
- if tree = parser.parse(string.downcase)
+ case
+ when string.blank?
+ @encoding = ''
+ when tree = parser.parse(string.downcase)
@encoding = tree.encoding.text_value
else
raise Mail::Field::ParseError, "ContentTransferEncodingElement can not parse |#{string}|\nReason was: #{parser.failure_reason}\n"
View
4 lib/mail/field.rb
@@ -141,8 +141,10 @@ def split(raw_field)
def create_field(name, value)
begin
self.field = new_field(name, value)
- rescue
+ rescue => e
self.field = Mail::UnstructuredField.new(name, value)
+ self.field.errors << [name, value, e]
+ self.field
end
end
View
2  lib/mail/fields/content_transfer_encoding_field.rb
@@ -10,6 +10,8 @@ class ContentTransferEncodingField < StructuredField
def initialize(*args)
super(CAPITALIZED_FIELD, strip_field(FIELD_NAME, args.last.to_s.downcase))
+ parse(value)
+ self
end
def parse(val = value)
View
4 lib/mail/fields/structured_field.rb
@@ -31,6 +31,10 @@ def initialize(*args)
def default
decoded
end
+
+ def errors
+ []
+ end
end
end
View
5 lib/mail/fields/unstructured_field.rb
@@ -18,11 +18,16 @@ class UnstructuredField
include Mail::Utilities
def initialize(*args)
+ @errors = []
self.name = args.first
self.value = args.last
self
end
+ def errors
+ @errors
+ end
+
def encoded
do_encode(self.name)
end
View
6 lib/mail/header.rb
@@ -34,6 +34,7 @@ class Header
# these cases, please make a patch and send it in, or at the least, send
# me the example so we can fix it.
def initialize(header_text = nil)
+ @errors = []
self.raw_source = header_text.to_crlf
split_header if header_text
end
@@ -74,6 +75,7 @@ def fields=(unfolded_fields)
unfolded_fields.each do |field|
field = Field.new(field)
+ field.errors.each { |error| self.errors << error }
selected = select_field_for(field.name)
if selected.any? && limited_field?(field.name)
@@ -85,6 +87,10 @@ def fields=(unfolded_fields)
end
+ def errors
+ @errors
+ end
+
# 3.6. Field definitions
#
# The following table indicates limits on the number of times each
View
27 lib/mail/message.rb
@@ -99,6 +99,7 @@ def initialize(*args, &block)
@body = nil
@text_part = nil
@html_part = nil
+ @errors = nil
@perform_deliveries = true
@raise_delivery_errors = true
@@ -376,6 +377,27 @@ def headers(hash = {})
end
end
+ # Returns a list of parser errors on the header, each field that had an error
+ # will be reparsed as an unstructured field to preserve the data inside, but
+ # will not be used for further processing.
+ #
+ # It returns a nested array of [field_name, value, original_error_message]
+ # per error found.
+ #
+ # Example:
+ #
+ # message = Mail.new("Content-Transfer-Encoding: weirdo\r\n")
+ # message.errors.size #=> 1
+ # message.errors.first[0] #=> "Content-Transfer-Encoding"
+ # message.errors.first[1] #=> "weirdo"
+ # message.errors.first[3] #=> <The original error message exception>
+ #
+ # This is a good first defence on detecting spam by the way. Some spammers send
+ # invalid emails to try and get email parsers to give up parsing them.
+ def errors
+ header.errors
+ end
+
# Returns the Bcc value of the mail object as an array of strings of
# address specs.
#
@@ -1258,7 +1280,8 @@ def has_charset?
end
def has_content_transfer_encoding?
- !!content_transfer_encoding
+ header[:content_transfer_encoding] &&
+ header[:content_transfer_encoding].errors.blank?
end
def has_transfer_encoding? # :nodoc:
@@ -1723,7 +1746,7 @@ def separate_parts
end
def add_encoding_to_body
- unless content_transfer_encoding.blank?
+ if has_content_transfer_encoding?
body.encoding = content_transfer_encoding
end
end
View
231 spec/fixtures/emails/error_emails/content_transfer_encoding_7-bit.eml
@@ -0,0 +1,231 @@
+Received: from nahou-mscnx06p.corp.enron.com ([192.168.110.237]) by NAHOU-MSMBX03V.corp.enron.com with Microsoft SMTPSVC(5.0.2195.2966);
+ Thu, 10 Jan 2002 16:10:15 -0600
+Received: from NAHOU-MSMSW06P.corp.enron.com ([192.168.110.228]) by nahou-mscnx06p.corp.enron.com with Microsoft SMTPSVC(5.0.2195.2966);
+ Thu, 10 Jan 2002 16:10:14 -0600
+Received: from mailman.enron.com (unverified) by NAHOU-MSMSW06P.corp.enron.com
+ (Content Technologies SMTPRS 4.2.5) with ESMTP id <T585d92a5e1c0a86ee487c@NAHOU-MSMSW06P.corp.enron.com> for <emclaug@exchange.enron.com>;
+ Thu, 10 Jan 2002 16:10:13 -0600
+Received: from email11.quris.net (email11.quris.net [208.169.17.235])
+ by mailman.enron.com (8.11.4/8.11.4/corp-1.06) with ESMTP id g0AMAB920109
+ for <emclaug@enron.com>; Thu, 10 Jan 2002 16:10:11 -0600 (CST)
+Received: from localhost.quris.net (localhost [127.0.0.1])
+ by email11.quris.net (8.12.1/8.12.1) with SMTP id g0AM9nNk021044
+ for emclaug@enron.com; Thu, 10 Jan 2002 15:10:08 -0700 (MST)
+Message-Id: <101BN3c3ce68600277550d@bounce.quris.net>
+Errors-To: 101BN3c3ce68600277550d@bounce.quris.net
+From: Discover Card <discovercard_newsflash@discover.qrs1.net>
+Reply-To: discovercard_newsflash@discover.qrs1.net
+To: emclaug@enron.com
+Subject: Discover(R) Card News Online - January 2002
+Date: Wed, 9 Jan 2002 19:47:50 MST
+X-Quris: 8:EC:1440:0:101BN3c3ce68600277550d
+MIME-Version: 1.0
+Content-Type: multipart/alternative; boundary="-----=aaaaaaaaaa0"
+Return-Path: 101BN3c3ce68600277550d@bounce.quris.net
+
+-------=aaaaaaaaaa0
+Content-Type: text/plain; charset="iso-8859-1"
+Content-Transfer-Encoding: 7-bit
+
+DISCOVERÆ CARD <http://discover.qrs1.net/s/r?l=5893&m=101BN3c3ce68600277550d> News Online <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/newsonline_head.gif> January 2002 <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/jan2002_head.gif> DISCOVER <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/card-clasplat1_head.gif>
+log in to the Account Center <http://discover.qrs1.net/s/r?l=5896&m=101BN3c3ce68600277550d>Internet ShopCenter(SM) <http://discover.qrs1.net/s/r?l=5900&m=101BN3c3ce68600277550d>
+ In This Edition: <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/thised_head.gif> <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/bullet_gold_ds.gif>Be Charitable <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/bullet_gold_ds.gif>Get Organized <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/bullet_gold_ds.gif>Manage Your Finances Better
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/bullet_gold_ds.gif>Protect Yourself <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/bullet_gold_ds.gif>Save More Money
+
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/blankdot.gif>
+ DISCOVERÆ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/card-clasplat2_head.gif>
+
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/0102-sc-offright.gif>
+
+It's a new year and time for new beginnings. Let us help you out with some possible resolutions. Be sure to read on!
+
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/orange-hr_body.gif>
+ Be Charitable <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/0102-be-charitable.gif>
+$1 Million Donated to the Families of Freedom Scholarship Fundô
+
+We're happy to announce that the second $1 million for the Discover Card Relief Efforts program, has been donated to the Families of Freedom Scholarship Fund*.
+
+Families of Freedom Scholarship Fund(TM) <http://discover.qrs1.net/s/r?l=5894&m=101BN3c3ce68600277550d>The Fund will benefit children and spouses of airplane crew and passengers, World Trade Center and Pentagon employees and visitors, as well as firefighters, emergency medical and law enforcement personnel affected by the attacks of September 11th.
+
+Thanks to you, we're making quick progress toward our goal of $5 million to help America's relief efforts by doing what you do everyday -- using your Discover Card.
+
+Learn more <http://discover.qrs1.net/s/r?l=5902&m=101BN3c3ce68600277550d> about the Discover Card Donation Program.
+
+To make a personal donation to the Families of Freedom Scholarship Fund, visit www.familiesoffreedom.org <http://discover.qrs1.net/s/r?l=5894&m=101BN3c3ce68600277550d>.
+
+
+Return to TOP
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/orange-hr_body.gif>
+ Get Organized <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/0102-get-organized.gif>
+Four More Ways to Manage your Account...
+
+Discover Interactive <http://discover.qrs1.net/s/r?l=5898&m=101BN3c3ce68600277550d> With the Discover Inter@ctive e-mail reminders, it's easier than ever to manage your DiscoverÆ Card Account. In addition to the Discover Inter@ctive e-mail reminders already offered -- there are now four new convenient options that will notify you when:
+
+A Balance Transfer has Posted
+A Merchant Refund or Credit has Posted
+A Purchase Exceeds a Specified Amount (set by you)
+The Account Balance Exceeds a Specified Amount (set by you)
+
+To view a sample e-mail or to sign up for these new Discover Inter@ctive e-mails, click here <http://discover.qrs1.net/s/r?l=5898&m=101BN3c3ce68600277550d> today, and start enjoying the benefits right away.
+
+
+Return to TOP
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/orange-hr_body.gif>
+ <http://discover.qrs1.net/s/r?l=5903&m=101BN3c3ce68600277550d> Manage Your Finances Better <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/0102-manage-finances.gif>
+TRANSFER A BALANCE ONLINE <http://discover.qrs1.net/s/r?l=5903&m=101BN3c3ce68600277550d> Consolidate Your Holiday Balances and Save!
+
+Are all those holiday credit balances too much to keep up with? We can make it easier and help you save money! Just transfer those high-rate holiday balances to your Discover Card and get a special balance transfer rate! We can even send you an e-mail when your Balance Transfer has posted to your Discover Card account.
+
+Transfer a Balance or Learn more <http://discover.qrs1.net/s/r?l=5903&m=101BN3c3ce68600277550d>.
+
+Return to TOP
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/orange-hr_body.gif>
+ Protect Yourself <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/0102-protect-yourself.gif>
+KNOW FRAUD(TM) <http://discover.qrs1.net/s/r?l=5901&m=101BN3c3ce68600277550d> Know Fraud and Keep Your Identity Safe
+
+Discover Card is a proud participant in the Know Fraudô campaign, a national initiative led by the Federal Government to prevent identity theft. Learn easy ways to protect your identity, how identity thieves work and more.
+
+Get informed! <http://discover.qrs1.net/s/r?l=5892&m=101BN3c3ce68600277550d>
+
+Return to TOP
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/orange-hr_body.gif>
+ Save More Money <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/0102-save-money.gif>
+Strunk and White <http://discover.qrs1.net/s/r?l=5899&m=101BN3c3ce68600277550d> Get a special Cashback Bonus award
+
+Barnes & Noble.com <http://discover.qrs1.net/s/r?l=5899&m=101BN3c3ce68600277550d> Get a 7% Cashback BonusÆ award** when you use your Discover Card to buy anything from Barnes & Noble.com. Plus, get FREE SHIPPING when you purchase two or more items in a single order.
+
+Hurry and stock up on all books, textbooks, movies, posters, music and more, only at Barnes & Noble.com <http://discover.qrs1.net/s/r?l=5899&m=101BN3c3ce68600277550d>.
+
+Return to TOP
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/orange-hr_body.gif>
+IMPORTANT INFORMATION
+
+PLEASE DO NOT REPLY TO THIS E-MAIL
+
+This e-mail was sent to: emclaug@enron.com
+
+You are receiving this e-mail because you are a registered Discover Card Account Center user and have subscribed to receive e-mail newsletters from Discover Card.
+
+To unsubscribe click here <http://discover.qrs1.net/s/r?l=5891&m=101BN3c3ce68600277550d>, log in to the Account Center, and change your settings.
+
+To update your e-mail address, or change your Account Center preferences, click here <http://discover.qrs1.net/s/r?l=5891&m=101BN3c3ce68600277550d> and log in.
+
+If you have questions about your Account, please e-mail us through Secure Messages <http://discover.qrs1.net/s/r?l=5897&m=101BN3c3ce68600277550d> and we will be happy to assist you.
+
+Discover Card takes your online security seriously. Enjoy 100% Fraud Protection <http://discover.qrs1.net/s/r?l=5904&m=101BN3c3ce68600277550d> against unauthorized transactions whenever you use your Discover Card, online or off. So, you can rest easy when you use your Discover Card.
+
+We respect your privacy. To view our privacy policy online, visit Discovercard.com <http://discover.qrs1.net/s/r?l=5895&m=101BN3c3ce68600277550d>
+
+* Discover Financial Services is not associated with CSFA. Citizens' Scholarship Foundation of America, Families of Freedom Scholarship Fund and all associated logos are trademarks of Citizens' Scholarship Foundation of America.
+
+** Special Cashback Bonus award Terms and Conditions:
+For Cardmembers who participate in the Cashback Bonus program. This special Cashback Bonus award is separate from your annual Cashback Bonus award you may receive from Discover Card, and is not part of the Discover Card Cashback Bonus award calculation method. If, as of the date we determine whether you meet the terms of this offer, your Account is closed or delinquent, you will not receive this special Cashback Bonus award. Please allow 6 to 8 weeks for your special Cashback Bonus award to be credited to your Discover Card Account. Offer not transferable.
+
+©2002 Discover Bank. Member FDIC.
+
+ <http://discover.qrs1.net/images/dot.gif?msgid=101BN3c3ce68600277550d>
+
+-------=aaaaaaaaaa0
+Content-Type: text/html; charset="iso-8859-1"
+Content-Transfer-Encoding: 7-bit
+
+
+DISCOVERÆ CARD <http://discover.qrs1.net/s/r?l=5893&m=101BN3c3ce68600277550d> News Online <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/newsonline_head.gif> January 2002 <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/jan2002_head.gif> DISCOVER <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/card-clasplat1_head.gif>
+log in to the Account Center <http://discover.qrs1.net/s/r?l=5896&m=101BN3c3ce68600277550d>Internet ShopCenter(SM) <http://discover.qrs1.net/s/r?l=5900&m=101BN3c3ce68600277550d>
+ In This Edition: <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/thised_head.gif> <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/bullet_gold_ds.gif>Be Charitable <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/bullet_gold_ds.gif>Get Organized <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/bullet_gold_ds.gif>Manage Your Finances Better
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/bullet_gold_ds.gif>Protect Yourself <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/bullet_gold_ds.gif>Save More Money
+
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/blankdot.gif>
+ DISCOVERÆ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/card-clasplat2_head.gif>
+
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/0102-sc-offright.gif>
+
+It's a new year and time for new beginnings. Let us help you out with some possible resolutions. Be sure to read on!
+
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/orange-hr_body.gif>
+ Be Charitable <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/0102-be-charitable.gif>
+$1 Million Donated to the Families of Freedom Scholarship Fundô
+
+We're happy to announce that the second $1 million for the Discover Card Relief Efforts program, has been donated to the Families of Freedom Scholarship Fund*.
+
+Families of Freedom Scholarship Fund(TM) <http://discover.qrs1.net/s/r?l=5894&m=101BN3c3ce68600277550d>The Fund will benefit children and spouses of airplane crew and passengers, World Trade Center and Pentagon employees and visitors, as well as firefighters, emergency medical and law enforcement personnel affected by the attacks of September 11th.
+
+Thanks to you, we're making quick progress toward our goal of $5 million to help America's relief efforts by doing what you do everyday -- using your Discover Card.
+
+Learn more <http://discover.qrs1.net/s/r?l=5902&m=101BN3c3ce68600277550d> about the Discover Card Donation Program.
+
+To make a personal donation to the Families of Freedom Scholarship Fund, visit www.familiesoffreedom.org <http://discover.qrs1.net/s/r?l=5894&m=101BN3c3ce68600277550d>.
+
+
+Return to TOP
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/orange-hr_body.gif>
+ Get Organized <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/0102-get-organized.gif>
+Four More Ways to Manage your Account...
+
+Discover Interactive <http://discover.qrs1.net/s/r?l=5898&m=101BN3c3ce68600277550d> With the Discover Inter@ctive e-mail reminders, it's easier than ever to manage your DiscoverÆ Card Account. In addition to the Discover Inter@ctive e-mail reminders already offered -- there are now four new convenient options that will notify you when:
+
+A Balance Transfer has Posted
+A Merchant Refund or Credit has Posted
+A Purchase Exceeds a Specified Amount (set by you)
+The Account Balance Exceeds a Specified Amount (set by you)
+
+To view a sample e-mail or to sign up for these new Discover Inter@ctive e-mails, click here <http://discover.qrs1.net/s/r?l=5898&m=101BN3c3ce68600277550d> today, and start enjoying the benefits right away.
+
+
+Return to TOP
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/orange-hr_body.gif>
+ <http://discover.qrs1.net/s/r?l=5903&m=101BN3c3ce68600277550d> Manage Your Finances Better <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/0102-manage-finances.gif>
+TRANSFER A BALANCE ONLINE <http://discover.qrs1.net/s/r?l=5903&m=101BN3c3ce68600277550d> Consolidate Your Holiday Balances and Save!
+
+Are all those holiday credit balances too much to keep up with? We can make it easier and help you save money! Just transfer those high-rate holiday balances to your Discover Card and get a special balance transfer rate! We can even send you an e-mail when your Balance Transfer has posted to your Discover Card account.
+
+Transfer a Balance or Learn more <http://discover.qrs1.net/s/r?l=5903&m=101BN3c3ce68600277550d>.
+
+Return to TOP
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/orange-hr_body.gif>
+ Protect Yourself <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/0102-protect-yourself.gif>
+KNOW FRAUD(TM) <http://discover.qrs1.net/s/r?l=5901&m=101BN3c3ce68600277550d> Know Fraud and Keep Your Identity Safe
+
+Discover Card is a proud participant in the Know Fraudô campaign, a national initiative led by the Federal Government to prevent identity theft. Learn easy ways to protect your identity, how identity thieves work and more.
+
+Get informed! <http://discover.qrs1.net/s/r?l=5892&m=101BN3c3ce68600277550d>
+
+Return to TOP
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/orange-hr_body.gif>
+ Save More Money <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/0102-save-money.gif>
+Strunk and White <http://discover.qrs1.net/s/r?l=5899&m=101BN3c3ce68600277550d> Get a special Cashback Bonus award
+
+Barnes & Noble.com <http://discover.qrs1.net/s/r?l=5899&m=101BN3c3ce68600277550d> Get a 7% Cashback BonusÆ award** when you use your Discover Card to buy anything from Barnes & Noble.com. Plus, get FREE SHIPPING when you purchase two or more items in a single order.
+
+Hurry and stock up on all books, textbooks, movies, posters, music and more, only at Barnes & Noble.com <http://discover.qrs1.net/s/r?l=5899&m=101BN3c3ce68600277550d>.
+
+Return to TOP
+ <http://a948.g.akamai.net/7/948/166/01/discover.qrs1.net/images/orange-hr_body.gif>
+IMPORTANT INFORMATION
+
+PLEASE DO NOT REPLY TO THIS E-MAIL
+
+This e-mail was sent to: emclaug@enron.com
+
+You are receiving this e-mail because you are a registered Discover Card Account Center user and have subscribed to receive e-mail newsletters from Discover Card.
+
+To unsubscribe click here <http://discover.qrs1.net/s/r?l=5891&m=101BN3c3ce68600277550d>, log in to the Account Center, and change your settings.
+
+To update your e-mail address, or change your Account Center preferences, click here <http://discover.qrs1.net/s/r?l=5891&m=101BN3c3ce68600277550d> and log in.
+
+If you have questions about your Account, please e-mail us through Secure Messages <http://discover.qrs1.net/s/r?l=5897&m=101BN3c3ce68600277550d> and we will be happy to assist you.
+
+Discover Card takes your online security seriously. Enjoy 100% Fraud Protection <http://discover.qrs1.net/s/r?l=5904&m=101BN3c3ce68600277550d> against unauthorized transactions whenever you use your Discover Card, online or off. So, you can rest easy when you use your Discover Card.
+
+We respect your privacy. To view our privacy policy online, visit Discovercard.com <http://discover.qrs1.net/s/r?l=5895&m=101BN3c3ce68600277550d>
+
+* Discover Financial Services is not associated with CSFA. Citizens' Scholarship Foundation of America, Families of Freedom Scholarship Fund and all associated logos are trademarks of Citizens' Scholarship Foundation of America.
+
+** Special Cashback Bonus award Terms and Conditions:
+For Cardmembers who participate in the Cashback Bonus program. This special Cashback Bonus award is separate from your annual Cashback Bonus award you may receive from Discover Card, and is not part of the Discover Card Cashback Bonus award calculation method. If, as of the date we determine whether you meet the terms of this offer, your Account is closed or delinquent, you will not receive this special Cashback Bonus award. Please allow 6 to 8 weeks for your special Cashback Bonus award to be credited to your Discover Card Account. Offer not transferable.
+
+©2002 Discover Bank. Member FDIC.
+
+ <http://discover.qrs1.net/images/dot.gif?msgid=101BN3c3ce68600277550d>
+
+-------=aaaaaaaaaa0--
View
33 spec/fixtures/emails/error_emails/content_transfer_encoding_empty.eml
@@ -0,0 +1,33 @@
+Recieved: from nahou-mscnx06p.corp.enron.com ([192.168.110.237]) by NAHOU-MSMBX03V.corp.enron.com with Microsoft SMTPSVC(5.0.2195.2966);
+ Tue, 13 Nov 2001 19:08:16 -0800
+Received: from corp.enron.com ([192.168.110.228]) by nahou-mscnx06p.corp.enron.com with Microsoft SMTPSVC(5.0.2195.2966);
+ Tue, 13 Nov 2001 21:07:21 -0600
+Received: from mailman.enron.com (unverified) by corp.enron.com
+ (Content Technologies SMTPRS 4.2.1) with ESMTP id <T5a0a774841c0a86ee241c@corp.enron.com> for <kwatson@exchange.enron.com>;
+ Tue, 13 Nov 2001 21:07:19 -0600
+Received: from smtp011.mail.yahoo.com (smtp011.mail.yahoo.com [216.136.173.31])
+ by mailman.enron.com (8.11.4/8.11.4/corp-1.06) with ESMTP id g343Bbl58584
+ for <kimberly.watson@enron.com>; Tue, 13 Nov 2001 21:07:07 -0600 (CST)
+Received: from unknown (HELO localhost) (youdd5o2o449465@219.133.84.88 with login)
+ by smtp011.mail.yahoo.com with SMTP; Wed, 14 Nov 2001 03:13:54 -0000
+MIME-Version: 1.0
+From: 3712f2@msa.hinet.net
+To: brucegemini@yahoo.com.tw
+Subject: 4d8119¡@(¤j¸ÉªwÄѱM½æ) ¤j®a»¡­^»y ¨C¤éÅ¥MP3 (2004¦~6¤ë¥÷) ÁcÅ餤¤å¥úºÐª© (­^»y±Ð¾Ç)¡@8afb90
+BCc: Array
+Content-Type: text/html; charset="big5"
+Content-Transfer-Encoding:
+Message-ID: <11107978796724623>
+
+<html>
+<body>
+<font color="#FFFFFF">9bbf38a544f990e73cd12f3c56c60e6180edebd31d752d3997fa4c0650d6aaa338f73f155d5d382832b195b33cbbaa243830c981e12db0c9aac12db9a39836caab5058c0f5efbf326331103f9e1008c106f630fe4d33575efa5d362a28ece62c3fd2a034df2dab92e1f0f664b6179889f4f98a962e2287e336ec652475ccdf7fcdd85f8e025161d8f10c3bd9cc5701c0c7ed1ed84b5b2c01a05eee9e641da8b0</font><BR><BR>
+<a href="http://%33%36%39%39%2e%32%34%63%63%2e%63%63/">³nÅé«Ò°ê§ó·s¨³³t</a>
+<font color="#FFFFFF">06f630fe4d33575efa5d362a28ece62c3fd2a034df2dab92e1f0f664b6179889f4f98a962e2287e336ec652475ccdf7fcdd85f8e025161d8f10c3bd9cc5701c0c7ed1ed84b5b2c01a05eee9e641da8b09bbf38a544f990e73cd12f3c56c60e6180edebd31d752d3997fa4c0650d6aaa338f73f155d5d382832b195b33cbbaa243830c981e12db0c9aac12db9a39836caab5058c0f5efbf326331103f9e1008c1</font>
+</body>
+</html>
+
+
+_______________________________________________________________________
+Yahoo! ¤u¨ã¦C - ¤º¸m¨¾¤î¼u¥Xµøµ¡¤u¯à¡I
+http://toolbar.yahoo.com.hk
View
148 spec/fixtures/emails/error_emails/content_transfer_encoding_plain.eml
@@ -0,0 +1,148 @@
+Return-Path: <baocqccyw@hq.lindsayelec.com>
+Delivered-To: em-ca-bruceg-spam@em.ca
+Received: (qmail 32184 invoked by uid 700); 28 Mar 2005 01:14:54 -0000
+Delivered-To: em-ca-em-ca-bruceg@em.ca
+Received: (qmail 32179 invoked by uid 115); 28 Mar 2005 01:14:54 -0000
+Received: from baocqccyw@hq.lindsayelec.com by churchill by uid 64011 with qmail-scanner-1.22
+ (clamdscan: 0.75-1. spamassassin: 2.63. Clear:RC:0(200.141.184.56):.
+ Processed in 10.454045 secs); 28 Mar 2005 01:14:54 -0000
+Received: from dial.suednet.com.br (HELO hq.lindsayelec.com) (200.141.184.56)
+ by churchill.factcomp.com with SMTP; 28 Mar 2005 01:14:42 -0000
+Return-path: <baocqccyw@hq.lindsayelec.com>
+From: shavonda Cabral <baocqccyw@hq.lindsayelec.com>
+To: <em-ca-bruceg@em.ca>
+Subject: bookkeeping Get in on IGTS asap.
+Date: Sun, 27 Mar 2005 19:11:59 -0600
+Reply-To: <baocqccyw@hq.lindsayelec.com>
+MIME-Version: 1.0
+X-Virus-Status: Scanned by norton
+Message-ID: <41314357824.13240873.93296@oxygen-k19.hq.lindsayelec.com>
+Content-Type: text/plain; charset=us-ascii
+Content-Transfer-Encoding: plain
+Content-Length: 5102
+Lines: 125
+
+acidness
+
+ Exciting Easter Investor Alert
+
+Ticker:IGTS
+Current:0.01
+Rating:Big Mover Next Week
+
+This st0ck receives our top rating - 10 out of 10
+Breaking NEWS (released last night): Intelligent
+
+Sports, Inc. Offers Affordable Alternative
+This is the first news release the company put
+out since November - this is going to be exciting
+stock play
+
+Jump on board while you can - Don't regret It later
+
+About the Company:
+
+Youth And Amateur Sports Company Poised For Growth
+
+Intelligent Sports, Inc. is a publicly held company
+trading on the OTC markets under the ticker symbol
+ìIGTSî. Intelligent Sports will be the holding company
+for several sports related businesses. Intelligent
+Sports provides business units with strategic guidance
+and support in the areas of marketing, sales,
+sponsorships, partnerships, policy & procedures,
+finance and expansion. Their initial business launch
+is to develop youth and amateur sports centers
+throughout the country that offers a year-round
+sports calendar with emphasis on youth and amateur
+sports programs and skill development. Their plan
+is to expand this concept into membership-based,
+multi-purpose sports facilities that will promote
+a diverse range of sports programs, leagues,
+tournaments, clinics, individual sports skill
+development and nutritional training.
+
+Fresh News:
+
+UPLAND, Calif., Mar 22, 2005 (PRIMEZONE via COMTEX)
+Participation fees for school sports programs
+continues to escalate, at the same time record
+obesity levels in children are being reported by
+the Center for Disease Control. Intelligent Sports,
+Inc. (Pink Sheets:IGTS) is working to do their part
+to curb this alarming trend of by offering affordable
+fitness centers to kids.
+
+"The time when school sports programs had enrollment
+fees of $10 is fading," said former NBA star and
+Intelligent Sports, Inc. board member, Reggie Theus.
+"Not every parent is willing to pay $300 enrollment
+fees for a sport their child is only casually
+interested in; some parents can't afford to pay that
+much for a sport their child excels at."
+
+According to the President's Council on Physical
+Fitness and Sports, only 17 percent of middle and
+junior high schools and 2 percent of senior high
+schools require daily physical activity for all
+students. Hoping to fill the gap, The Sports Zone
+by Intelligent Sports will support a wide range of
+membership-based after-school sports programs,
+weekend leagues and tournaments promoting individual
+athletic skill development, the concepts of teamwork
+and discipline, and a love of the game.
+
+The Sports Zone opened in early October in Upland,
+California. It encompasses a 10,000 square foot
+facility featuring two basketball courts and caters
+to court sports including basketball, volleyball,
+cheerleading, and wrestling, and also has the ability
+to host soccer, football and other field-related
+athletic activity within the complex arena.
+
++++++++++++++++++++++++++++
+IGTS is expected to Explode All Next Week Be Sure
+To Get It Immediately, and profit big!
+++++++++++++++++++++++++++++
+
+Disclaimer
+
+This publication is not registered investment advisor,
+The information presented above is not an offer to
+buy or sell securities it contains "forward looking
+statements" within the meaning of Section 27A of the
+Securities Act of 1933 and Section 21B of the
+Securities Exchange Act of 1934. Any statements that
+express or involve discussions with respect to
+predictions, goals, expectations, beliefs, plans,
+projections, objectives, assumptions or future events
+or performance are not statements of historical fact
+and may be "forward looking statements." In compliance
+with Section 17(b), the publishers of this report
+disclose the holding of IGTS shares prior to the
+publication of this report. Be aware of an inherent
+conflict of interest resulting from such holdings
+due to our intent to profit from the liquidation
+of these shares. Shares may be sold at any time,
+even after positive statements have been made
+regarding the above company. Since we own shares,
+there is an inherent conflict of interest in our
+statements and opinions. Readers of this publication
+are cautioned not to place undue reliance on forward
+looking statements, which are based on certain
+assumptions and expectations involving various risks
+and uncertainties, that could cause results to differ
+materially from those set forth in the forward- looking
+statements. Please be advised that nothing within this
+email shall constitute a solicitation or an offer to
+buy or sell any security mentioned herein. This newsletter
+is neither a registered investment advisor nor affiliated
+with any broker or dealer. All statements made are our
+express opinion only and should be treated as such. We
+may own, buy and sell any securities mentioned at any
+time. This report includes forward-looking statements
+within the meaning of The Private Securities Litigation
+Reform Act of 1995. This newsletter was paid
+41 500, from third party to send this report. Please do
+your own diligence before investing in any profiled company.
+You may lose money from investing. caddis worktable
View
53 spec/fixtures/emails/error_emails/content_transfer_encoding_qp_with_space.eml
@@ -0,0 +1,53 @@
+Return-Path: <fyouizjnp@swissonline.ch>
+Delivered-To: em-ca-bait-precedes@em.ca
+Received: (qmail 7622 invoked by uid 115); 7 Nov 2004 21:30:59 -0000
+Received: from fyouizjnp@swissonline.ch by churchill by uid 64011 with qmail-scanner-1.22
+ (clamdscan: 0.75-1. spamassassin: 2.63. Clear:RC:0(222.47.112.31):.
+ Processed in 1.163709 secs); 07 Nov 2004 21:30:59 -0000
+Received: from unknown (HELO 209.5.178.248) (222.47.112.31)
+ by churchill.factcomp.com with SMTP; 7 Nov 2004 21:30:57 -0000
+Message-ID: <qlrqpxforpx$RND_WORDjyeottngpx@sympatico.ca>
+From: "Wilmer Capps" <fyouizjnp@swissonline.ch>
+To: bait-passover@em.ca
+Subject: Low or High Blood Pressure? We can help.
+Date: Sun, 07 Nov 2004 18:23:56 -0300
+X-Mailer: gene annulus
+pneumococcus-polyhedral: belgrade hanoverian lima
+MIME-Version: 1.0
+Content-Type: multipart/alternative;
+ boundary="----=_NextPart_000_003A_5008K66J.3Z4LC80J"
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_003A_5008K66J.3Z4LC80J
+Content-Type: text/plain;
+ charset="iso-8859-1"
+Content-Transfer-Encoding: quoted printable
+
+If you're in need of a good RX site for online purchases, we are your answer.
+
+With Tens of Thousands of happy customers who saved huge, you can't go wrong.
+
+http://magyar8stator.com/26 Lots More Info Here
+
+Above URL is for more info & if you are interested.
+------=_NextPart_000_003A_5008K66J.3Z4LC80J
+Content-Type: text/html;
+ charset="iso-8859-1"
+Content-Transfer-Encoding: quoted-printable
+
+If you're in need of a good RX site for online purchases, we are your answ=
+er.<br>
+<br>
+With Tens of Thousands of happy customers who saved huge, you can't go wro=
+ng.<br>
+<br>
+<a href=3D"http://magyar8stator.com/26">Lots More Info Here</a><br>
+<br>
+<br>
+Above URL is for more info & if you are interested.<br>
+
+
+
+
+------=_NextPart_000_003A_5008K66J.3Z4LC80J--
View
44 spec/fixtures/emails/error_emails/content_transfer_encoding_spam.eml
@@ -0,0 +1,44 @@
+Received: from nahou-mscnx06p.corp.enron.com ([192.168.110.237]) by napdx-msmbx01v.corp.enron.com with Microsoft SMTPSVC(5.0.2195.1600);
+ Sun, 19 Aug 2001 04:06:57 -0800
+Received: from corp.enron.com ([192.168.110.226]) by nahou-mscnx06p.corp.enron.com with Microsoft SMTPSVC(5.0.2195.2966);
+ Sun, 19 Aug 2001 06:06:02 -0600
+Received: from mailman.enron.com (unverified) by corp.enron.com
+ (Content Technologies SMTPRS 4.2.1) with ESMTP id <T5a0a080174c0a86ee241c@corp.enron.com> for <vpimenov@exchange.enron.com>;
+ Sun, 19 Aug 2001 06:04:08 -0600
+Received: from poetrix.com ([61.146.170.133])
+ by mailman.enron.com (8.11.4/8.11.4/corp-1.06) with ESMTP id g343Bbl38716
+ for <vladi.Pimenov@enron.com>; Sun, 19 Aug 2001 07:03:27 -0500 (CDT)
+Message-ID: <35FDF82F.D000339@poetrix.com>
+Date: Sun, 19 Aug 2001 06:31:03 -0700
+From: "neal ragland" <shechem@poetrix.com>
+User-Agent: AspMail 3.06
+X-Accept-Language: en-us
+MIME-Version: 1.0
+To: "palmer vladi.Pimenovraud" <vladi.Pimenov@enron.com>
+Suvladi.Pimenovject: For a vladi.Pimenovetter and more promising future just check eke
+Content-Type: text/plain;
+ charset="us-ascii"
+Content-Transfer-Encoding: 7vladi.Pimenovit
+
+middagh oldusercompare
+othermachine one-twist natascha mz05 ntsoft netvladi.Pimenovr
+
+
+We supply high quality medications vladi.Pimenovy mail order at very competitive prices
+and provide a professional, convenient and affordavladi.Pimenovle means of purchasing
+your presc_ription medicines online
+Depresion-an"xiety, Antivladi.Pimenoviotic, Wt Loss, Women's Health, Mus-cle Relaxants,
+Sleeping Aids, Allergies and Paain Relief. Your tastes will vladi.Pimenove met here with
+600 medications
+Hscearpomh http://fi.com.adherentgood.com/?2NX1q/vladi.Pimenoviayimh
+
+
+more people are using it for quicker rx refill
+
+
+When you're not with me?Well darling Im telling you now
+Im no good without you anyhowAnd have I told you lately that I love you
+
+Or you and I, If I only had wings of a little angel
+
+
View
50 spec/fixtures/emails/error_emails/content_transfer_encoding_text-html.eml
@@ -0,0 +1,50 @@
+Return-Path: <hzwfrkq@hintontile.com>
+Delivered-To: rait@bruce-guenter.dyndns.org
+Received: (qmail 12977 invoked from network); 6 May 2005 10:58:40 -0000
+Received: from localhost (localhost [127.0.0.1])
+ by bruce-guenter.dyndns.org ([192.168.1.3]); 06 May 2005 10:58:40 -0000
+Received: from zak.futurequest.net ([127.0.0.1])
+ by localhost ([127.0.0.1])
+ with SMTP via TCP; 06 May 2005 10:58:40 -0000
+Received: (qmail 2252 invoked from network); 6 May 2005 10:58:39 -0000
+Received: from lsne-catv-dhcp-29-115.urbanet.ch (unknown [80.238.29.115])
+ by zak.futurequest.net ([69.5.6.152])
+ with SMTP via TCP; 06 May 2005 10:58:29 -0000
+Received: from mail.datavalet.com (80.238.29.115)
+ by 80.238.29.115 (fairwayv.4) with SMTP
+ id <09166i58p>
+ (Authid: 3811297); Fri, 06 May 2005 10:52:01 -0100
+Reply-To: "chianfong cuthbert" <abhijit.862153drinnan@datavalet.com>
+From: "chianfong cuthbert" <abhijit.862153drinnan@datavalet.com>
+To: cvs@bruce-guenter.dyndns.org
+Cc: rait@bruce-guenter.dyndns.org
+Subject: RE: We will help you refinance your home.
+Date: Fri, 06 May 2005 15:55:01 +0400
+MIME-Version: 1.0
+Content-Type: multipart/alternative;
+ boundary="--651790_269334.01570"
+Content-Length: 636
+Lines: 22
+
+----651790_269334.01570
+Content-Type: text/html;
+ charset="iso-8859-1"
+Content-Transfer-Encoding: text/html
+
+Hello,<p>
+
+You have qualified for the lowest rate in years.<br>
+You could get over $400,000 for as little as $500 a month.<br>
+Low rates are fixed no matter what.<p>
+
+Please visit the link below to verify your information:<br>
+<a href="http://www.lenxzc.com/index2.php?refid=malx">Approval Form</a><p>
+
+Best Regards,<br>
+chianfong cuthbert, Account Manager<br>
+Reynolds Associates, LLC<p>
+<p>
+--------------------<br>
+if you received this in error: <a href="http://www.lenxzc.com/r.php">re-m0-ve</a>
+
+----651790_269334.01570--
View
79 spec/fixtures/emails/error_emails/content_transfer_encoding_x_uuencode.eml
@@ -0,0 +1,79 @@
+Received: from nahou-mscnx06p.corp.enron.com ([192.168.110.237]) by napdx-msmbx01v.corp.enron.com with Microsoft SMTPSVC(5.0.2195.2966);
+ Thu, 10 Jan 2002 14:12:53 -0800
+Received: from NAHOU-MSMSW06P.corp.enron.com ([192.168.110.228]) by nahou-mscnx06p.corp.enron.com with Microsoft SMTPSVC(5.0.2195.2966);
+ Thu, 10 Jan 2002 16:12:52 -0600
+Received: from mailman.enron.com (unverified) by NAHOU-MSMSW06P.corp.enron.com
+ (Content Technologies SMTPRS 4.2.5) with ESMTP id <T585d94ff81c0a86ee487c@NAHOU-MSMSW06P.corp.enron.com>;
+ Thu, 10 Jan 2002 16:12:47 -0600
+Received: from tblexch01.transmission.bpa.gov (int.transmission.bpa.gov [206.137.58.133] (may be forged))
+ by mailman.enron.com (8.11.4/8.11.4/corp-1.06) with ESMTP id g0AMCB920856;
+ Thu, 10 Jan 2002 16:12:11 -0600 (CST)
+Received: from TBLLIST1 ([206.137.58.134]) by tblexch01.transmission.bpa.gov with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21)
+ id CRWWC3K1; Thu, 10 Jan 2002 14:11:55 -0800
+Received: from LIST.TRANSMISSION.BPA.GOV by LIST.TRANSMISSION.BPA.GOV
+ (LISTSERV-TCP/IP release 1.8c) with spool id 2458 for
+ RRGA-L@LIST.TRANSMISSION.BPA.GOV; Thu, 10 Jan 2002 14:13:50 -0800
+Received: from [207.202.136.216] (ip136.r2.d.pdx.nwlink.com [207.202.136.136])
+ by comet.pacifier.com (8.11.2/8.11.1) with ESMTP id g0ALxLX06696;
+ Thu, 10 Jan 2002 13:59:21 -0800 (PST)
+Mime-Version: 1.0
+X-Sender: lpeters@mail.pacifier.com
+References: <1168BAF252B7D41194810001028D743108913C@SERVER>
+Content-Type: multipart/mixed;
+ boundary="============_-1201422494==_============"
+Message-ID: <p05100307b863befdfb67@[207.202.136.216]>
+Date: Thu, 10 Jan 2002 13:59:53 -0800
+Sender: RTO West Regional Representatives Group <RRGA-L@LIST.RTOWEST.ORG>
+From: "Lon L. Peters" <lpeters@PACIFIER.COM>
+Subject: PGP Comments on RTO West Release of Dec. 14
+Comments: cc: ltopaz@gcpud.org, gary.zarker@ci.seattle.wa.us,
+ dgodard@gcpud.org, wdobbins@dcpud.org, drobinson@cowlitzpud.org,
+ bgeddes@popud.com, "Culbertson, Tim" <tculber@gcpud.org>,
+ kknitte@gcpud.org, paula.green@ci.seattle.wa.us,
+ jim.harding@ci.seattle.wa.us, ghuhta@cowlitzpud.org,
+ dosborn@gcpud.org, jscheel@popud.com, jim.todd@ci.seattle.wa.us,
+ CWAGERS@dcpud.org, ali.rodol@ci.seattle.wa.us,
+ kevin.clark@ci.seattle.wa.us, bessex@cowlitzpud.org,
+ Cindy.Wright@ci.seattle.wa.us, "Juj, Hardev"
+ <Hardev.Juj@ci.seattle.wa.us>,
+ "Conger, Kurt" <kconger@energyexpertsvcs.com>,
+ "Kindley, Ray" <rkindley@schwabe.com>
+To: RRGA-L@LIST.RTOWEST.ORG
+In-Reply-To: <1168BAF252B7D41194810001028D743108913C@SERVER>
+Return-Path: owner-rrga-l@list.rtowest.org
+
+--============_-1201422494==_============
+Content-Type: text/plain; charset="us-ascii" ; format="flowed"
+
+Attached are the comments of the Public Generating Pool.
+--
+_________________________________
+Lon L. Peters
+Northwest Economic Research, Inc.
+6765 S.W. Preslynn Drive
+Portland, Oregon 97225-2668
+503-203-1539 (voice)
+503-203-1569 (fax)
+503-709-5942 (mobile)
+lpeters@pacifier.com
+
+NOTICE: This communication and its attachments, if any, may contain
+sensitive, privileged, or other confidential information. If you are
+not the intended recipient or believe that you have received this
+communication in error, please notify the sender of this
+communication and delete the copy you received from all storage
+devices. In addition, please do not print, copy, retransmit,
+forward, disseminate, or otherwise use this communication or its
+attachments, if any. Thank you.
+
+--============_-1201422494==_============
+Content-Id: <p05100307b863befdfb67@[207.202.136.216].0.0>
+Content-Type: application/msword; name="PGP_Cmts_on_12-14-01_Pkg.doc"
+ ; x-mac-type="5738424E"
+ ; x-mac-creator="4D535744"
+Content-Disposition: attachment; filename="PGP_Cmts_on_12-14-01_Pkg.doc"
+ ; modification-date="Thu, 10 Jan 2002 13:58:10 -0800"
+Content-Transfer-Encoding: x-uuencode
+
+
+--============_-1201422494==_============--
View
2  spec/mail/attachments_spec.rb
@@ -96,7 +96,7 @@ def check_decoded(actual, expected)
file_data = File.read(filename = fixture('attachments', 'test.png'))
base64_encoded_data = encode_base64(file_data)
doing {@mail.attachments['test.png'] = { :content => base64_encoded_data,
- :encoding => 'weird_encoding' }}.should raise_error
+ :encoding => 'weird_encoding' }}.should raise_error
end
it "should be able to call read on the attachment to return the decoded data" do
View
10 spec/mail/field_spec.rb
@@ -89,6 +89,7 @@
it "should call to_s on it's field when sent to_s" do
@field_type = Mail::UnstructuredField
@field_type.should_receive(:to_s)
+ @field_type.should_receive(:errors).and_return([])
Mail::UnstructuredField.should_receive(:new).and_return(@field_type)
Mail::Field.new('Subject: Hello bob').to_s
end
@@ -113,6 +114,15 @@
end
+ describe "error handling" do
+ it "should populate the errors array if it finds a field it can't deal with" do
+ field = Mail::Field.new('Content-Transfer-Encoding: 7-bit')
+ field.field.errors[0][0].should == 'Content-Transfer-Encoding'
+ field.field.errors[0][1].should == '7-bit'
+ field.field.errors[0][2].to_s.should =~ /ContentTransferEncodingElement can not parse |7-bit|/
+ end
+ end
+
describe "helper methods" do
it "should reply if it is responsible for a field name as a capitalized string - structured field" do
field = Mail::Field.new("To: mikel@test.lindsaar.net")
View
13 spec/mail/fields/content_transfer_encoding_field_spec.rb
@@ -87,6 +87,10 @@
t.encoding.should == 'x-this-is_my-encoding'
end
+ it "should handle an x-encoding" do
+ t = Mail::ContentTransferEncodingField.new("x-uuencode")
+ t.encoding.should == "x-uuencode"
+ end
it "should replace the existing value" do
t = Mail::ContentTransferEncodingField.new("7bit")
@@ -95,9 +99,14 @@
end
it "should raise an error on bogus values" do
- t = Mail::ContentTransferEncodingField.new("broken@foo")
- doing { t.encoding }.should raise_error
+ doing { Mail::ContentTransferEncodingField.new("broken@foo") }.should raise_error
end
+
+ it "should handle an empty content transfer encoding" do
+ t = Mail::ContentTransferEncodingField.new("")
+ t.encoding.should == ""
+ end
+
end
end
View
12 spec/mail/header_spec.rb
@@ -409,6 +409,18 @@
end
+ describe "error handling" do
+ it "should collect up any of its fields' errors" do
+ header = Mail::Header.new("Content-Transfer-Encoding: vlad\r\nReply-To: a b b")
+ header.errors.should_not be_blank
+ header.errors.size.should == 2
+ header.errors[0][0].should == 'Content-Transfer-Encoding'
+ header.errors[0][1].should == 'vlad'
+ header.errors[1][0].should == 'Reply-To'
+ header.errors[1][1].should == 'a b b'
+ end
+ end
+
describe "handling fields with multiple values" do
it "should know which fields can only appear once" do
%w[ orig-date from sender reply-to to cc bcc
View
14 spec/mail/message_spec.rb
@@ -1355,4 +1355,18 @@ def self.delivering_email(mail)
end
end
+
+ describe "error handling" do
+ describe "error handling" do
+ it "should collect up any of its fields' errors" do
+ mail = Mail.new("Content-Transfer-Encoding: vlad\r\nReply-To: a b b\r\n")
+ mail.errors.should_not be_blank
+ mail.errors.size.should == 2
+ mail.errors[0][0].should == 'Content-Transfer-Encoding'
+ mail.errors[0][1].should == 'vlad'
+ mail.errors[1][0].should == 'Reply-To'
+ mail.errors[1][1].should == 'a b b'
+ end
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.