diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc index c5ba75f12..c79b9e8c1 100644 --- a/CHANGELOG.rdoc +++ b/CHANGELOG.rdoc @@ -4,6 +4,8 @@ Breaking changes: Compatibility: +* Update MIME-Version to have correct case per RFC 2045 @mikel + Features: * Updated README to improve around sending multipart mail @kapfenho diff --git a/README.md b/README.md index 2c441a0b5..ec20d539c 100644 --- a/README.md +++ b/README.md @@ -433,7 +433,7 @@ From: Mikel Lindsaar To: nicolas@test.lindsaar.net.au Message-ID: <626835f736e19_10873fdfa3c2ffd4947a3@sender.at.mail> Subject: First multipart email sent with Mail -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=\"--==_mimepart_626835f733867_10873fdfa3c2ffd494636\"; charset=UTF-8 diff --git a/lib/mail/fields/mime_version_field.rb b/lib/mail/fields/mime_version_field.rb index 8804e0677..6450962da 100644 --- a/lib/mail/fields/mime_version_field.rb +++ b/lib/mail/fields/mime_version_field.rb @@ -5,7 +5,7 @@ module Mail class MimeVersionField < NamedStructuredField #:nodoc: - NAME = 'Mime-Version' + NAME = 'MIME-Version' def self.singular? true diff --git a/lib/mail/header.rb b/lib/mail/header.rb index c88298436..a390f7648 100644 --- a/lib/mail/header.rb +++ b/lib/mail/header.rb @@ -217,7 +217,7 @@ def has_date? # Returns true if the header has a MIME version defined (empty or not) def has_mime_version? - fields.has_field? 'Mime-Version' + fields.has_field? 'MIME-Version' end private diff --git a/lib/mail/message.rb b/lib/mail/message.rb index 733cd4a6f..ef95bdd0a 100644 --- a/lib/mail/message.rb +++ b/lib/mail/message.rb @@ -1409,7 +1409,7 @@ def has_date? header.has_date? end - # Returns true if the message has a Mime-Version field, the field may or may + # Returns true if the message has a MIME-Version field, the field may or may # not have a value, but the field exists or not. def has_mime_version? header.has_mime_version? diff --git a/spec/fixtures/attachments/basic_email.eml b/spec/fixtures/attachments/basic_email.eml index 43dea9711..21ef57625 100644 --- a/spec/fixtures/attachments/basic_email.eml +++ b/spec/fixtures/attachments/basic_email.eml @@ -19,7 +19,7 @@ From: Mikel Lindsaar To: Mikel Lindsaar Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit -Mime-Version: 1.0 (Apple Message framework v929.2) +MIME-Version: 1.0 (Apple Message framework v929.2) Subject: Testing 123 Date: Sat, 22 Nov 2008 15:04:59 +1100 X-Mailer: Apple Mail (2.929.2) diff --git a/spec/fixtures/emails/attachment_emails/attachment_content_disposition.eml b/spec/fixtures/emails/attachment_emails/attachment_content_disposition.eml index a7e10d37b..ced8ad9fe 100644 --- a/spec/fixtures/emails/attachment_emails/attachment_content_disposition.eml +++ b/spec/fixtures/emails/attachment_emails/attachment_content_disposition.eml @@ -1,4 +1,4 @@ -Mime-Version: 1.0 (Apple Message framework v730) +MIME-Version: 1.0 (Apple Message framework v730) Content-Type: multipart/mixed; boundary=Apple-Mail-13-196941151 Message-Id: <9169D984-4E0B-45EF-82D4-8F5E53AD7012@example.com> From: foo@example.com diff --git a/spec/fixtures/emails/attachment_emails/attachment_content_location.eml b/spec/fixtures/emails/attachment_emails/attachment_content_location.eml index 123d7d358..83d725137 100644 --- a/spec/fixtures/emails/attachment_emails/attachment_content_location.eml +++ b/spec/fixtures/emails/attachment_emails/attachment_content_location.eml @@ -1,4 +1,4 @@ -Mime-Version: 1.0 (Apple Message framework v730) +MIME-Version: 1.0 (Apple Message framework v730) Content-Type: multipart/mixed; boundary=Apple-Mail-13-196941151 Message-Id: <9169D984-4E0B-45EF-82D4-8F5E53AD7012@example.com> From: foo@example.com diff --git a/spec/fixtures/emails/attachment_emails/attachment_message_rfc822.eml b/spec/fixtures/emails/attachment_emails/attachment_message_rfc822.eml index f6ec8c2fc..1007e0f13 100644 --- a/spec/fixtures/emails/attachment_emails/attachment_message_rfc822.eml +++ b/spec/fixtures/emails/attachment_emails/attachment_message_rfc822.eml @@ -1,4 +1,4 @@ -Mime-Version: 1.0 (Apple Message framework v730) +MIME-Version: 1.0 (Apple Message framework v730) Content-Type: multipart/mixed; boundary=Apple-Mail-13-196941151 Message-Id: <9169D984-4E0B-45EF-82D4-8F5E53AD7012@example.com> From: foo@example.com @@ -52,7 +52,7 @@ From: Test Tester Reply-To: Test Tester To: xxxx@xxxx.com, xxxx@xxxx.com Subject: Another PDF -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2192_32400445.1115745999735" X-Virus-Scanned: amavisd-new at textdrive.com diff --git a/spec/fixtures/emails/attachment_emails/attachment_nonascii_filename.eml b/spec/fixtures/emails/attachment_emails/attachment_nonascii_filename.eml index 736cd196f..0f32b4b22 100644 --- a/spec/fixtures/emails/attachment_emails/attachment_nonascii_filename.eml +++ b/spec/fixtures/emails/attachment_emails/attachment_nonascii_filename.eml @@ -1,4 +1,4 @@ -Mime-Version: 1.0 (Apple Message framework v730) +MIME-Version: 1.0 (Apple Message framework v730) Content-Type: multipart/mixed; boundary=Apple-Mail-13-196941151 Message-Id: <9169D984-4E0B-45EF-82D4-8F5E53AD7012@example.com> From: foo@example.com diff --git a/spec/fixtures/emails/attachment_emails/attachment_only_email.eml b/spec/fixtures/emails/attachment_emails/attachment_only_email.eml index 2b79ca7e8..068916dd4 100644 --- a/spec/fixtures/emails/attachment_emails/attachment_only_email.eml +++ b/spec/fixtures/emails/attachment_emails/attachment_only_email.eml @@ -5,7 +5,7 @@ Content-Disposition: attachment; filename=blah.gz Content-Transfer-Encoding: base64 Content-Description: Attachment has identical content to above foo.gz Message-Id: <1066974048.4264.62.camel@localhost> -Mime-Version: 1.0 +MIME-Version: 1.0 Date: 23 Oct 2003 22:40:49 -0700 Content-Type: application/x-gzip; NAME=blah.gz diff --git a/spec/fixtures/emails/attachment_emails/attachment_pdf.eml b/spec/fixtures/emails/attachment_emails/attachment_pdf.eml index 3c01ff1b2..d37041b28 100644 --- a/spec/fixtures/emails/attachment_emails/attachment_pdf.eml +++ b/spec/fixtures/emails/attachment_emails/attachment_pdf.eml @@ -30,7 +30,7 @@ From: Test Tester Reply-To: Test Tester To: xxxx@xxxx.com, xxxx@xxxx.com Subject: Another PDF with 🎉 Unicode chars in it 🍿 -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2192_32400445.1115745999735" X-Virus-Scanned: amavisd-new at textdrive.com diff --git a/spec/fixtures/emails/attachment_emails/attachment_pdf_lf.eml b/spec/fixtures/emails/attachment_emails/attachment_pdf_lf.eml index fb4718f22..a64ca4689 100644 --- a/spec/fixtures/emails/attachment_emails/attachment_pdf_lf.eml +++ b/spec/fixtures/emails/attachment_emails/attachment_pdf_lf.eml @@ -30,7 +30,7 @@ From: Test Tester Reply-To: Test Tester To: xxxx@xxxx.com, xxxx@xxxx.com Subject: Another PDF with 🎉 Unicode chars in it 🍿 -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2192_32400445.1115745999735" X-Virus-Scanned: amavisd-new at textdrive.com diff --git a/spec/fixtures/emails/attachment_emails/attachment_with_base64_encoded_name.eml b/spec/fixtures/emails/attachment_emails/attachment_with_base64_encoded_name.eml index 17c3c611f..39b2836bb 100644 --- a/spec/fixtures/emails/attachment_emails/attachment_with_base64_encoded_name.eml +++ b/spec/fixtures/emails/attachment_emails/attachment_with_base64_encoded_name.eml @@ -7,7 +7,7 @@ Reply-To: xxxxxxxxx xxxxxxx To: xxxxx xxxx Subject: Fwd: Signed email causes file attachments In-Reply-To: -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_5028_7368284.1115579351471" References: diff --git a/spec/fixtures/emails/attachment_emails/attachment_with_encoded_name.eml b/spec/fixtures/emails/attachment_emails/attachment_with_encoded_name.eml index 142f53657..724321dcc 100644 --- a/spec/fixtures/emails/attachment_emails/attachment_with_encoded_name.eml +++ b/spec/fixtures/emails/attachment_emails/attachment_with_encoded_name.eml @@ -7,7 +7,7 @@ Reply-To: xxxxxxxxx xxxxxxx To: xxxxx xxxx Subject: Fwd: Signed email causes file attachments In-Reply-To: -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_5028_7368284.1115579351471" References: diff --git a/spec/fixtures/emails/attachment_emails/attachment_with_quoted_filename.eml b/spec/fixtures/emails/attachment_emails/attachment_with_quoted_filename.eml index 336576dfc..bb819942f 100644 --- a/spec/fixtures/emails/attachment_emails/attachment_with_quoted_filename.eml +++ b/spec/fixtures/emails/attachment_emails/attachment_with_quoted_filename.eml @@ -7,7 +7,7 @@ Message-Id: From: Jeffrey Hardy To: Jeffrey Hardy Content-Type: multipart/mixed; boundary=Apple-Mail-6--218366681 -Mime-Version: 1.0 (Apple Message framework v935.3) +MIME-Version: 1.0 (Apple Message framework v935.3) Subject: =?ISO-8859-1?Q?Eelanal=FC=FCsi_p=E4ring?= Date: Wed, 13 May 2009 11:42:01 -0400 X-Mailer: Apple Mail (2.935.3) diff --git a/spec/fixtures/emails/attachment_emails/attachment_with_unquoted_name.eml b/spec/fixtures/emails/attachment_emails/attachment_with_unquoted_name.eml index d3a384076..4f057e802 100644 --- a/spec/fixtures/emails/attachment_emails/attachment_with_unquoted_name.eml +++ b/spec/fixtures/emails/attachment_emails/attachment_with_unquoted_name.eml @@ -1,4 +1,4 @@ -Mime-Version: 1.0 (Apple Message framework v730) +MIME-Version: 1.0 (Apple Message framework v730) Content-Type: multipart/mixed; boundary=Apple-Mail-13-196941151 Message-Id: <9169D984-4E0B-45EF-82D4-8F5E53AD7012@example.com> From: foo@example.com diff --git a/spec/fixtures/emails/error_emails/cant_parse_from.eml b/spec/fixtures/emails/error_emails/cant_parse_from.eml index 60398f1c4..486343f9e 100644 --- a/spec/fixtures/emails/error_emails/cant_parse_from.eml +++ b/spec/fixtures/emails/error_emails/cant_parse_from.eml @@ -3,7 +3,7 @@ From: Apple To: karl.baum@gmail.com Message-Id: <7oh6b1$1clhrjk@badger-vip.apple.com> Subject: Meet the new MacBook Pro family. Now includes 13-inch. -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=mimepart_4b0c353551675_3d1c15b79ea5e70c1783 diff --git a/spec/fixtures/emails/error_emails/content_transfer_encoding_x_uuencode.eml b/spec/fixtures/emails/error_emails/content_transfer_encoding_x_uuencode.eml index a2ea8e9cd..2f6304701 100644 --- a/spec/fixtures/emails/error_emails/content_transfer_encoding_x_uuencode.eml +++ b/spec/fixtures/emails/error_emails/content_transfer_encoding_x_uuencode.eml @@ -16,7 +16,7 @@ Received: from LIST.TRANSMISSION.BPA.GOV by LIST.TRANSMISSION.BPA.GOV 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 +MIME-Version: 1.0 X-Sender: lpeters@mail.pacifier.com References: <1168BAF252B7D41194810001028D743108913C@SERVER> Content-Type: multipart/mixed; diff --git a/spec/fixtures/emails/error_emails/new_line_in_to_header.eml b/spec/fixtures/emails/error_emails/new_line_in_to_header.eml index 40340657c..8fb06ec06 100644 --- a/spec/fixtures/emails/error_emails/new_line_in_to_header.eml +++ b/spec/fixtures/emails/error_emails/new_line_in_to_header.eml @@ -23,7 +23,7 @@ To: leads@sg.dc.com, cc@c-l-example.com Message-Id: <4cb5c7d0a3cce_120e..fdbed2b861958562@s.t-example.com.tmail> Subject: [Online Lead] Online Lead #1111111 -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 diff --git a/spec/fixtures/emails/mime_emails/raw_email11.eml b/spec/fixtures/emails/mime_emails/raw_email11.eml index 7b6073881..b9fc4176b 100644 --- a/spec/fixtures/emails/mime_emails/raw_email11.eml +++ b/spec/fixtures/emails/mime_emails/raw_email11.eml @@ -1,5 +1,5 @@ From xxx@xxxx.com Wed Apr 27 14:15:31 2005 -Mime-Version: 1.0 (Apple Message framework v619.2) +MIME-Version: 1.0 (Apple Message framework v619.2) To: "xxxxx@xxxxx" Message-Id: <416eaebec6d333ec6939eaf8a7d80724@xxxxx> Content-Type: multipart/alternative; diff --git a/spec/fixtures/emails/mime_emails/raw_email12.eml b/spec/fixtures/emails/mime_emails/raw_email12.eml index 123d7d358..83d725137 100644 --- a/spec/fixtures/emails/mime_emails/raw_email12.eml +++ b/spec/fixtures/emails/mime_emails/raw_email12.eml @@ -1,4 +1,4 @@ -Mime-Version: 1.0 (Apple Message framework v730) +MIME-Version: 1.0 (Apple Message framework v730) Content-Type: multipart/mixed; boundary=Apple-Mail-13-196941151 Message-Id: <9169D984-4E0B-45EF-82D4-8F5E53AD7012@example.com> From: foo@example.com diff --git a/spec/fixtures/emails/mime_emails/raw_email2.eml b/spec/fixtures/emails/mime_emails/raw_email2.eml index 6cf218b48..4c076d45d 100644 --- a/spec/fixtures/emails/mime_emails/raw_email2.eml +++ b/spec/fixtures/emails/mime_emails/raw_email2.eml @@ -31,7 +31,7 @@ Reply-To: xxxxxxxxx xxxxxxx To: xxxxx xxxx Subject: Fwd: Signed email causes file attachments In-Reply-To: -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_5028_7368284.1115579351471" References: diff --git a/spec/fixtures/emails/mime_emails/raw_email4.eml b/spec/fixtures/emails/mime_emails/raw_email4.eml index a56bd1bf4..d6335d599 100644 --- a/spec/fixtures/emails/mime_emails/raw_email4.eml +++ b/spec/fixtures/emails/mime_emails/raw_email4.eml @@ -8,7 +8,7 @@ From: xxx@xxxx.xxx To: xxx@xxxx.xxx Message-Id: <7864245.1115573412626.JavaMxxx@xxxx.xxx> Subject: Filth -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=mimepart_427e4cb4ca329_133ae40413c81ef X-Mms-Priority: 1 X-Mms-Transaction-Id: 3198421808-0 diff --git a/spec/fixtures/emails/mime_emails/raw_email7.eml b/spec/fixtures/emails/mime_emails/raw_email7.eml index c8c8e3462..115abc3d5 100644 --- a/spec/fixtures/emails/mime_emails/raw_email7.eml +++ b/spec/fixtures/emails/mime_emails/raw_email7.eml @@ -1,4 +1,4 @@ -Mime-Version: 1.0 (Apple Message framework v730) +MIME-Version: 1.0 (Apple Message framework v730) Content-Type: multipart/mixed; boundary=Apple-Mail-13-196941151 Message-Id: <9169D984-4E0B-45EF-82D4-8F5E53AD7012@example.com> From: foo@example.com diff --git a/spec/fixtures/emails/mime_emails/raw_email_encoded_stack_level_too_deep.eml b/spec/fixtures/emails/mime_emails/raw_email_encoded_stack_level_too_deep.eml index 4981e59b4..4911c406f 100644 --- a/spec/fixtures/emails/mime_emails/raw_email_encoded_stack_level_too_deep.eml +++ b/spec/fixtures/emails/mime_emails/raw_email_encoded_stack_level_too_deep.eml @@ -6,7 +6,7 @@ From: Gmail Team Reply-To: x.y@gmail.com To: =?ISO-8859-1?Q?Nicolas_Fouch=E9?= Subject: =?ISO-8859-1?Q?Nicolas_Fouch=E9_has_accepted_your_invitation_to_Gmail?= -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_976_15222032.1119945731186" diff --git a/spec/fixtures/emails/mime_emails/raw_email_with_binary_encoded.eml b/spec/fixtures/emails/mime_emails/raw_email_with_binary_encoded.eml index 831c8e2cf..ec077f984 100644 --- a/spec/fixtures/emails/mime_emails/raw_email_with_binary_encoded.eml +++ b/spec/fixtures/emails/mime_emails/raw_email_with_binary_encoded.eml @@ -10,7 +10,7 @@ To: mikel@me.nowhere Message-Id: <009601c813c6$19df3510$0437d30a@mikel091a> Subject: Testing outlook Subject: Another PDF -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=----=_Part_13069834_15179892.1376435426074 diff --git a/spec/fixtures/emails/mime_emails/raw_email_with_illegal_boundary.eml b/spec/fixtures/emails/mime_emails/raw_email_with_illegal_boundary.eml index f3c2523cb..4ab1ba675 100644 --- a/spec/fixtures/emails/mime_emails/raw_email_with_illegal_boundary.eml +++ b/spec/fixtures/emails/mime_emails/raw_email_with_illegal_boundary.eml @@ -9,7 +9,7 @@ Reply-To: Mikel Lindsaar To: mikel@me.nowhere Message-Id: <009601c813c6$19df3510$0437d30a@mikel091a> Subject: Testing outlook -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=----=_NextPart_000_0093_01C81419.EB75E850 X-Get_mail_default: mikel@me.nowhere.else X-Priority: 3 diff --git a/spec/fixtures/emails/mime_emails/raw_email_with_multipart_mixed_quoted_boundary.eml b/spec/fixtures/emails/mime_emails/raw_email_with_multipart_mixed_quoted_boundary.eml index e4c402cd1..6bd9d009e 100644 --- a/spec/fixtures/emails/mime_emails/raw_email_with_multipart_mixed_quoted_boundary.eml +++ b/spec/fixtures/emails/mime_emails/raw_email_with_multipart_mixed_quoted_boundary.eml @@ -10,7 +10,7 @@ To: mikel@me.nowhere Message-Id: <009601c813c6$19df3510$0437d30a@mikel091a> Subject: Testing outlook Subject: Another PDF -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2192_32400445.1115745999735" X-Virus-Scanned: amavisd-new at textdrive.com diff --git a/spec/fixtures/emails/mime_emails/raw_email_with_nested_attachment.eml b/spec/fixtures/emails/mime_emails/raw_email_with_nested_attachment.eml index 9d49e6fab..bf8246cf6 100644 --- a/spec/fixtures/emails/mime_emails/raw_email_with_nested_attachment.eml +++ b/spec/fixtures/emails/mime_emails/raw_email_with_nested_attachment.eml @@ -1,5 +1,5 @@ From jamis@37signals.com Thu Feb 22 11:20:31 2007 -Mime-Version: 1.0 (Apple Message framework v752.3) +MIME-Version: 1.0 (Apple Message framework v752.3) Message-Id: <2CCE0408-10C7-4045-9B16-A1C11C31469B@37signals.com> Content-Type: multipart/signed; micalg=sha1; diff --git a/spec/fixtures/emails/mime_emails/raw_email_with_quoted_illegal_boundary.eml b/spec/fixtures/emails/mime_emails/raw_email_with_quoted_illegal_boundary.eml index fd0aa4f61..a64c7ea66 100644 --- a/spec/fixtures/emails/mime_emails/raw_email_with_quoted_illegal_boundary.eml +++ b/spec/fixtures/emails/mime_emails/raw_email_with_quoted_illegal_boundary.eml @@ -9,7 +9,7 @@ Reply-To: Mikel Lindsaar To: mikel@me.nowhere Message-Id: <009601c813c6$19df3510$0437d30a@mikel091a> Subject: Testing outlook -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0093_01C81419.EB75E850" X-Get_mail_default: mikel@me.nowhere.else X-Priority: 3 diff --git a/spec/fixtures/emails/mime_emails/sig_only_email.eml b/spec/fixtures/emails/mime_emails/sig_only_email.eml index 61721e979..59189d56a 100644 --- a/spec/fixtures/emails/mime_emails/sig_only_email.eml +++ b/spec/fixtures/emails/mime_emails/sig_only_email.eml @@ -3,7 +3,7 @@ From: Test To: Mikel Subject: Re: Testing multipart/signed Message-ID: <20070604150131.40d4fa1e@reforged> -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/signed; boundary=Sig_2GIY2xfzqSADMmu9sKGJqWm; protocol="application/pgp-signature"; micalg=PGP-SHA1 diff --git a/spec/fixtures/emails/multi_charset/japanese_attachment_long_name.eml b/spec/fixtures/emails/multi_charset/japanese_attachment_long_name.eml index 824f3ae50..b9b85141b 100644 --- a/spec/fixtures/emails/multi_charset/japanese_attachment_long_name.eml +++ b/spec/fixtures/emails/multi_charset/japanese_attachment_long_name.eml @@ -24,7 +24,7 @@ Content-Type: multipart/mixed; boundary=Apple-Mail-6--589811753 Message-Id: <60A112A8-F26C-4E23-95B8-4EB9F139D6A0@test.lindsaar.net> Date: Fri, 30 Oct 2009 19:11:02 +1100 To: Mikel Lindsaar -Mime-Version: 1.0 (Apple Message framework v1076) +MIME-Version: 1.0 (Apple Message framework v1076) X-Mailer: Apple Mail (2.1076) diff --git a/spec/fixtures/emails/multipart_report_emails/multipart_report_multiple_status.eml b/spec/fixtures/emails/multipart_report_emails/multipart_report_multiple_status.eml index 8c5adc0ba..809ec1b94 100644 --- a/spec/fixtures/emails/multipart_report_emails/multipart_report_multiple_status.eml +++ b/spec/fixtures/emails/multipart_report_emails/multipart_report_multiple_status.eml @@ -58,7 +58,7 @@ Received: from blah.com (snooki [10.12.126.68]) for ; Tue, 29 Jun 2010 15:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=blah.com; s=2010; t=1277826145; bh=wC3hHAhQgApcTmwQsi2F4OJf40rbyIek/WwIuzSc3V - M=; h=Date:From:Reply-To:To:Message-ID:Subject:Mime-Version: + M=; h=Date:From:Reply-To:To:Message-ID:Subject:MIME-Version: Content-Type:Content-Transfer-Encoding:List-Unsubscribe; b=aw+Bhd8 t1goZUXWBAHSrHaM1IdqhkXqF5WVMwGRYcnya4FHNw05XfpB3TTpTFda13DfhtziFRk zHSfiNbMapv7Vz+D3A/9NHg5nKahSMosZVTa0BfajYWNd1aY8JUWUlxdQHxQQ4ygCBj @@ -69,7 +69,7 @@ Reply-To: HomeRun To: u@ci.com Message-ID: <4c2a146147ac8_61ff157c4ec1652df@s.h.c.mail> Subject: Your Friend F M wants you to join HomeRun -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_4c2a146141756_61ff157c4ec1649a8"; charset=UTF-8 @@ -80,7 +80,7 @@ List-Unsubscribe: ----==_mimepart_4c2a146141756_61ff157c4ec1649a8 Date: Tue, 29 Jun 2010 15:42:25 +0000 -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 @@ -93,7 +93,7 @@ dC4sIFNhbiBGcmFuY2lzY28sIENBLCA5NDEyMywgVVNB ----==_mimepart_4c2a146141756_61ff157c4ec1649a8 Date: Tue, 29 Jun 2010 15:42:25 +0000 -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: base64 diff --git a/spec/fixtures/emails/multipart_report_emails/report_530.eml b/spec/fixtures/emails/multipart_report_emails/report_530.eml index ff0ae8b4d..d05befd58 100644 --- a/spec/fixtures/emails/multipart_report_emails/report_530.eml +++ b/spec/fixtures/emails/multipart_report_emails/report_530.eml @@ -74,7 +74,7 @@ Resent-Date: Mon, 24 Dec 2007 10:03:47 +1100 Date: Mon, 24 Dec 2007 10:03:47 +1100 Resent-Message-Id: <200712232303.lBNN3jDq002941@mail12.rrrr.com.au> Message-Id: <200712232303.lBNN3jDq002941@mail12.rrrr.com.au> -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; boundary=80874BE0-2DFF-4BCB-8AA1-A00E17ACA2EA diff --git a/spec/fixtures/emails/plain_emails/basic_email.eml b/spec/fixtures/emails/plain_emails/basic_email.eml index 6699f16ab..6935076c2 100644 --- a/spec/fixtures/emails/plain_emails/basic_email.eml +++ b/spec/fixtures/emails/plain_emails/basic_email.eml @@ -19,7 +19,7 @@ From: Mikel Lindsaar To: Mikel Lindsaar Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit -Mime-Version: 1.0 (Apple Message framework v929.2) +MIME-Version: 1.0 (Apple Message framework v929.2) Subject: Testing 123 Date: Sat, 22 Nov 2008 15:04:59 +1100 X-Mailer: Apple Mail (2.929.2) diff --git a/spec/fixtures/emails/plain_emails/basic_email_lf.eml b/spec/fixtures/emails/plain_emails/basic_email_lf.eml index 43dea9711..21ef57625 100644 --- a/spec/fixtures/emails/plain_emails/basic_email_lf.eml +++ b/spec/fixtures/emails/plain_emails/basic_email_lf.eml @@ -19,7 +19,7 @@ From: Mikel Lindsaar To: Mikel Lindsaar Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit -Mime-Version: 1.0 (Apple Message framework v929.2) +MIME-Version: 1.0 (Apple Message framework v929.2) Subject: Testing 123 Date: Sat, 22 Nov 2008 15:04:59 +1100 X-Mailer: Apple Mail (2.929.2) diff --git a/spec/fixtures/emails/plain_emails/raw_email.eml b/spec/fixtures/emails/plain_emails/raw_email.eml index c57bc04bf..19d097cca 100644 --- a/spec/fixtures/emails/plain_emails/raw_email.eml +++ b/spec/fixtures/emails/plain_emails/raw_email.eml @@ -1,5 +1,5 @@ From jamis_buck@byu.edu Mon May 2 16:07:05 2005 -Mime-Version: 1.0 (Apple Message framework v622) +MIME-Version: 1.0 (Apple Message framework v622) Content-Transfer-Encoding: base64 Message-Id: Content-Type: text/plain; diff --git a/spec/fixtures/emails/plain_emails/raw_email8.eml b/spec/fixtures/emails/plain_emails/raw_email8.eml index 142f53657..724321dcc 100644 --- a/spec/fixtures/emails/plain_emails/raw_email8.eml +++ b/spec/fixtures/emails/plain_emails/raw_email8.eml @@ -7,7 +7,7 @@ Reply-To: xxxxxxxxx xxxxxxx To: xxxxx xxxx Subject: Fwd: Signed email causes file attachments In-Reply-To: -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_5028_7368284.1115579351471" References: diff --git a/spec/fixtures/emails/plain_emails/raw_email_double_at_in_header.eml b/spec/fixtures/emails/plain_emails/raw_email_double_at_in_header.eml index 9243018fe..761c55a22 100644 --- a/spec/fixtures/emails/plain_emails/raw_email_double_at_in_header.eml +++ b/spec/fixtures/emails/plain_emails/raw_email_double_at_in_header.eml @@ -1,5 +1,5 @@ From jamis_buck@byu.edu Mon May 2 16:07:05 2005 -Mime-Version: 1.0 (Apple Message framework v622) +MIME-Version: 1.0 (Apple Message framework v622) Content-Transfer-Encoding: base64 Message-Id: Content-Type: text/plain; diff --git a/spec/fixtures/emails/plain_emails/raw_email_quoted_with_0d0a.eml b/spec/fixtures/emails/plain_emails/raw_email_quoted_with_0d0a.eml index 8a2c25a5d..96f682b14 100644 --- a/spec/fixtures/emails/plain_emails/raw_email_quoted_with_0d0a.eml +++ b/spec/fixtures/emails/plain_emails/raw_email_quoted_with_0d0a.eml @@ -1,4 +1,4 @@ -Mime-Version: 1.0 (Apple Message framework v730) +MIME-Version: 1.0 (Apple Message framework v730) Message-Id: <9169D984-4E0B-45EF-82D4-8F5E53AD7012@example.com> From: foo@example.com Subject: testing diff --git a/spec/fixtures/emails/plain_emails/raw_email_string_in_date_field.eml b/spec/fixtures/emails/plain_emails/raw_email_string_in_date_field.eml index dd7e03971..33f7b3fd5 100644 --- a/spec/fixtures/emails/plain_emails/raw_email_string_in_date_field.eml +++ b/spec/fixtures/emails/plain_emails/raw_email_string_in_date_field.eml @@ -1,5 +1,5 @@ From mikel@me.com Mon May 2 16:07:05 2005 -Mime-Version: 1.0 (Apple Message framework v622) +MIME-Version: 1.0 (Apple Message framework v622) Received: from jsj1wlrmd001.webex.com (by jsj1wlrmd001.webex.com (8.12.10/8.12.11) with ESMTP id m8MKKPTs022429 for ; Mon, 22 Sep 2008 20:20:25 GMT diff --git a/spec/fixtures/emails/plain_emails/raw_email_with_at_display_name.eml b/spec/fixtures/emails/plain_emails/raw_email_with_at_display_name.eml index ddcf4ccb9..ae66985c5 100644 --- a/spec/fixtures/emails/plain_emails/raw_email_with_at_display_name.eml +++ b/spec/fixtures/emails/plain_emails/raw_email_with_at_display_name.eml @@ -19,7 +19,7 @@ From: Mikel Lindsaar , jack@lindsar.com To: smith@gmail.com, Mikel@Lindsaar , tom@gmail.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit -Mime-Version: 1.0 (Apple Message framework v929.2) +MIME-Version: 1.0 (Apple Message framework v929.2) Subject: Testing 123 Date: Sat, 22 Nov 2008 15:04:59 +1100 X-Mailer: Apple Mail (2.929.2) diff --git a/spec/fixtures/emails/plain_emails/raw_email_with_partially_quoted_subject.eml b/spec/fixtures/emails/plain_emails/raw_email_with_partially_quoted_subject.eml index d8df28519..3ba192a01 100644 --- a/spec/fixtures/emails/plain_emails/raw_email_with_partially_quoted_subject.eml +++ b/spec/fixtures/emails/plain_emails/raw_email_with_partially_quoted_subject.eml @@ -1,5 +1,5 @@ From jamis@37signals.com Mon May 2 16:07:05 2005 -Mime-Version: 1.0 (Apple Message framework v622) +MIME-Version: 1.0 (Apple Message framework v622) Content-Transfer-Encoding: base64 Message-Id: Content-Type: text/plain; diff --git a/spec/fixtures/emails/rfc2822/example14.eml b/spec/fixtures/emails/rfc2822/example14.eml index 9d3e9c33b..a69e1aedc 100644 --- a/spec/fixtures/emails/rfc2822/example14.eml +++ b/spec/fixtures/emails/rfc2822/example14.eml @@ -9,7 +9,7 @@ Subject: Re: TEST To: rudeboyjet@gmail.com Message-Id: <0CC5E11ED2C1D@example.com> In-Reply-To: -Mime-Version: 1.0 +MIME-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit diff --git a/spec/mail/body_spec.rb b/spec/mail/body_spec.rb index a09b9237b..b5cf6b74e 100644 --- a/spec/mail/body_spec.rb +++ b/spec/mail/body_spec.rb @@ -230,7 +230,7 @@ def assert_split_into(body, pre, epi, parts) end it "should split if boundary is not set" do - multipart_body = "\n\n--\nDate: Thu, 01 Aug 2013 15:14:20 +0100\nMime-Version: 1.0\nContent-Type: text/plain\nContent-Transfer-Encoding: 7bit\nContent-Disposition: attachment;\n filename=\"\"\nContent-ID: <51fa6d3cac796_d84e3fe5a58349e025683@local.mail>\n\n\n\n----" + multipart_body = "\n\n--\nDate: Thu, 01 Aug 2013 15:14:20 +0100\nMIME-Version: 1.0\nContent-Type: text/plain\nContent-Transfer-Encoding: 7bit\nContent-Disposition: attachment;\n filename=\"\"\nContent-ID: <51fa6d3cac796_d84e3fe5a58349e025683@local.mail>\n\n\n\n----" body = Mail::Body.new(multipart_body) expect { body.split!(nil) }.not_to raise_error end diff --git a/spec/mail/field_spec.rb b/spec/mail/field_spec.rb index 1c4ef5a71..7cd52bd86 100644 --- a/spec/mail/field_spec.rb +++ b/spec/mail/field_spec.rb @@ -56,7 +56,7 @@ structured_fields = %w[ Date From Sender Reply-To To Cc Bcc Message-ID In-Reply-To References Keywords Resent-Date Resent-From Resent-Sender Resent-To Resent-Cc Resent-Bcc Resent-Message-ID - Return-Path Received Subject Comments Mime-Version + Return-Path Received Subject Comments MIME-Version Content-Transfer-Encoding Content-Description Content-Disposition Content-Type ] structured_fields.each do |sf| diff --git a/spec/mail/fields/content_type_field_spec.rb b/spec/mail/fields/content_type_field_spec.rb index dfbc7a94e..5753faf17 100644 --- a/spec/mail/fields/content_type_field_spec.rb +++ b/spec/mail/fields/content_type_field_spec.rb @@ -749,7 +749,7 @@ end it "should just get the mime type if all else fails with some real garbage" do - c = Mail::ContentTypeField.new("text/html; format=flowed; charset=iso-8859-15 Mime-Version: 1.0") + c = Mail::ContentTypeField.new("text/html; format=flowed; charset=iso-8859-15 MIME-Version: 1.0") expect(c.string).to eq 'text/html' end diff --git a/spec/mail/fields/mime_version_field_spec.rb b/spec/mail/fields/mime_version_field_spec.rb index 4a1c35d3e..2aaccf722 100644 --- a/spec/mail/fields/mime_version_field_spec.rb +++ b/spec/mail/fields/mime_version_field_spec.rb @@ -89,7 +89,7 @@ it "should accept a string without the field name" do t = Mail::MimeVersionField.new('1.0') - expect(t.name).to eq 'Mime-Version' + expect(t.name).to eq 'MIME-Version' expect(t.value).to eq '1.0' end @@ -148,7 +148,7 @@ it "should provide an encoded value" do t = Mail::MimeVersionField.new('1.0 (This is a comment)') - expect(t.encoded).to eq "Mime-Version: 1.0\r\n" + expect(t.encoded).to eq "MIME-Version: 1.0\r\n" end it "should provide an decoded value" do diff --git a/spec/mail/header_spec.rb b/spec/mail/header_spec.rb index 5076a3012..bfb80dc12 100644 --- a/spec/mail/header_spec.rb +++ b/spec/mail/header_spec.rb @@ -616,13 +616,13 @@ end it "should say it has a date id if it does" do - expect(Mail::Header.new('Mime-Version: 1.0')).to be_has_mime_version + expect(Mail::Header.new('MIME-Version: 1.0')).to be_has_mime_version end end describe "mime version handling" do it "should return the mime version of the email" do - header = Mail::Header.new("Mime-Version: 1.0") + header = Mail::Header.new("MIME-Version: 1.0") expect(header['mime-version'].value).to eq '1.0' end diff --git a/spec/mail/message_spec.rb b/spec/mail/message_spec.rb index 05ff98afe..4cc2194e5 100644 --- a/spec/mail/message_spec.rb +++ b/spec/mail/message_spec.rb @@ -1259,7 +1259,7 @@ def message_headers_should_match(message, other) body 'This is a body of the email' end mail.add_mime_version("3.0 (This is an unreal version number)") - expect(mail.to_s).to match(/Mime-Version: 3.0\r\n/) + expect(mail.to_s).to match(/MIME-Version: 3.0\r\n/) end it "should generate a mime version if nothing is passed to add_date" do @@ -1270,7 +1270,7 @@ def message_headers_should_match(message, other) body 'This is a body of the email' end mail.add_mime_version - expect(mail.to_s).to match(/Mime-Version: 1.0\r\n/) + expect(mail.to_s).to match(/MIME-Version: 1.0\r\n/) end it "should make an email and inject a mime_version if none was set if told to_s" do @@ -1280,7 +1280,7 @@ def message_headers_should_match(message, other) subject 'This is a test email' body 'This is a body of the email' end - expect(mail.to_s).to match(/Mime-Version: 1.0\r\n/) + expect(mail.to_s).to match(/MIME-Version: 1.0\r\n/) end it "should add the mime version to the message permanently once sent to_s" do diff --git a/spec/mail/mime_messages_spec.rb b/spec/mail/mime_messages_spec.rb index 49f4cf07b..024b68684 100644 --- a/spec/mail/mime_messages_spec.rb +++ b/spec/mail/mime_messages_spec.rb @@ -7,6 +7,11 @@ describe "general helper methods" do it "should read a mime version from an email" do + mail = Mail.new("MIME-Version: 1.0") + expect(mail.mime_version).to eq '1.0' + end + + it "should read a case incorrect mime version from an email" do mail = Mail.new("Mime-Version: 1.0") expect(mail.mime_version).to eq '1.0' end