-
Notifications
You must be signed in to change notification settings - Fork 941
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into bugfix/mime-version-capitalisation
- Loading branch information
Showing
93 changed files
with
254 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -403,18 +403,21 @@ simple as possible.... (asking a lot from a mail library) | |
|
||
```ruby | ||
mail = Mail.deliver do | ||
to '[email protected]' | ||
from 'Mikel Lindsaar <[email protected]>' | ||
subject 'First multipart email sent with Mail' | ||
|
||
text_part do | ||
body 'This is plain text' | ||
end | ||
|
||
html_part do | ||
content_type 'text/html; charset=UTF-8' | ||
body '<h1>This is HTML</h1>' | ||
part :content_type => "multipart/mixed" do |p1| | ||
p1.part :content_type => "multipart/related" do |p2| | ||
p2.part :content_type => "multipart/alternative", | ||
:content_disposition => "inline" do |p3| | ||
p3.part :content_type => "text/plain; charset=utf-8", | ||
:body => "Here is the attachment you wanted\n" | ||
p3.part :content_type => "text/html; charset=utf-8", | ||
:body => "<h1>Funky Title</h1><p>Here is the attachment you wanted</p>\n" | ||
end | ||
end | ||
add_file '/path/to/myfile.pdf' | ||
end | ||
from "Mikel Lindsaar <[email protected]>" | ||
to "[email protected]" | ||
subject "First multipart email sent with Mail" | ||
end | ||
``` | ||
|
||
|
@@ -425,34 +428,76 @@ so desire... | |
``` | ||
puts mail.to_s #=> | ||
To: [email protected] | ||
Date: Tue, 26 Apr 2022 20:12:07 +0200 | ||
From: Mikel Lindsaar <[email protected]> | ||
To: [email protected] | ||
Message-ID: <[email protected]> | ||
Subject: First multipart email sent with Mail | ||
Content-Type: multipart/alternative; | ||
boundary=--==_mimepart_4a914f0c911be_6f0f1ab8026659 | ||
Message-ID: <[email protected]> | ||
Date: Mon, 24 Aug 2009 00:15:46 +1000 | ||
MIME-Version: 1.0 | ||
Content-Type: multipart/mixed; | ||
boundary=\"--==_mimepart_626835f733867_10873fdfa3c2ffd494636\"; | ||
charset=UTF-8 | ||
Content-Transfer-Encoding: 7bit | ||
----==_mimepart_4a914f0c911be_6f0f1ab8026659 | ||
Content-ID: <[email protected]> | ||
Date: Mon, 24 Aug 2009 00:15:46 +1000 | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain | ||
----==_mimepart_626835f733867_10873fdfa3c2ffd494636 | ||
Content-Type: multipart/mixed; | ||
boundary=\"--==_mimepart_626835f73382a_10873fdfa3c2ffd494518\"; | ||
charset=UTF-8 | ||
Content-Transfer-Encoding: 7bit | ||
This is plain text | ||
----==_mimepart_4a914f0c911be_6f0f1ab8026659 | ||
Content-Type: text/html; charset=UTF-8 | ||
Content-ID: <[email protected]> | ||
Date: Mon, 24 Aug 2009 00:15:46 +1000 | ||
MIME-Version: 1.0 | ||
----==_mimepart_626835f73382a_10873fdfa3c2ffd494518 | ||
Content-Type: multipart/related; | ||
boundary=\"--==_mimepart_626835f7337f5_10873fdfa3c2ffd494438\"; | ||
charset=UTF-8 | ||
Content-Transfer-Encoding: 7bit | ||
<h1>This is HTML</h1> | ||
----==_mimepart_4a914f0c911be_6f0f1ab8026659-- | ||
----==_mimepart_626835f7337f5_10873fdfa3c2ffd494438 | ||
Content-Type: multipart/alternative; | ||
boundary=\"--==_mimepart_626835f733702_10873fdfa3c2ffd494376\"; | ||
charset=UTF-8 | ||
Content-Transfer-Encoding: 7bit | ||
Content-Disposition: inline | ||
Content-ID: <[email protected]> | ||
----==_mimepart_626835f733702_10873fdfa3c2ffd494376 | ||
Content-Type: text/plain; | ||
charset=utf-8 | ||
Content-Transfer-Encoding: 7bit | ||
Here is the attachment you wanted | ||
----==_mimepart_626835f733702_10873fdfa3c2ffd494376 | ||
Content-Type: text/html; | ||
charset=utf-8 | ||
Content-Transfer-Encoding: 7bit | ||
<h1>Funky Title</h1><p>Here is the attachment you wanted</p> | ||
----==_mimepart_626835f733702_10873fdfa3c2ffd494376-- | ||
----==_mimepart_626835f7337f5_10873fdfa3c2ffd494438-- | ||
----==_mimepart_626835f73382a_10873fdfa3c2ffd494518-- | ||
----==_mimepart_626835f733867_10873fdfa3c2ffd494636 | ||
Content-Type: text/plain; | ||
charset=UTF-8; | ||
filename=myfile.txt | ||
Content-Transfer-Encoding: 7bit | ||
Content-Disposition: attachment; | ||
filename=myfile.txt | ||
Content-ID: <6 | ||
[email protected]> | ||
Hallo, | ||
Test | ||
End | ||
----==_mimepart_626835f733867_10873fdfa3c2ffd494636-- | ||
``` | ||
|
||
Mail inserts the content transfer encoding, the mime version, | ||
|
@@ -602,7 +647,7 @@ Mail.defaults do | |
delivery_method :test # in practice you'd do this in spec_helper.rb | ||
end | ||
|
||
describe "sending an email" do | ||
RSpec.describe "sending an email" do | ||
include Mail::Matchers | ||
|
||
before(:each) do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ def check_decoded(actual, expected) | |
expect(actual).to eq expected.dup.force_encoding(Encoding::BINARY) | ||
end | ||
|
||
describe "Attachments" do | ||
RSpec.describe "Attachments" do | ||
|
||
before(:each) do | ||
@mail = Mail.new | ||
|
@@ -211,7 +211,7 @@ def check_decoded(actual, expected) | |
|
||
end | ||
|
||
describe "reading emails with attachments" do | ||
RSpec.describe "reading emails with attachments" do | ||
describe "test emails" do | ||
|
||
it "should find the attachment using content location" do | ||
|
@@ -311,7 +311,7 @@ def check_decoded(actual, expected) | |
end | ||
end | ||
|
||
describe "attachment order" do | ||
RSpec.describe "attachment order" do | ||
it "should be preserved instead when content type exists" do | ||
mail = Mail.new do | ||
to "[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
# frozen_string_literal: true | ||
require 'spec_helper' | ||
|
||
describe Object do | ||
RSpec.describe Object do | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# frozen_string_literal: true | ||
require 'spec_helper' | ||
|
||
describe Mail::MessageIdsElement do | ||
RSpec.describe Mail::MessageIdsElement do | ||
|
||
it "should parse a message_id" do | ||
msg_id_text = '<[email protected]>' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# frozen_string_literal: true | ||
require 'spec_helper' | ||
|
||
describe Mail::FieldList do | ||
RSpec.describe Mail::FieldList do | ||
it "should be able to add new fields" do | ||
fl = Mail::FieldList.new | ||
fl << Mail::Field.parse("To: [email protected]") | ||
|
Oops, something went wrong.