Skip to content

Commit

Permalink
return_field should handle reading of a mail with a Return-Field <>
Browse files Browse the repository at this point in the history
  • Loading branch information
Brad Cantin committed Mar 1, 2011
1 parent 6a0bd67 commit 235fb0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/mail/fields/return_path_field.rb
Expand Up @@ -38,6 +38,7 @@ class ReturnPathField < StructuredField
CAPITALIZED_FIELD = 'Return-Path'

def initialize(value = nil, charset = 'utf-8')
value = nil if value == '<>'
self.charset = charset
super(CAPITALIZED_FIELD, strip_field(FIELD_NAME, value), charset)
self.parse
Expand Down
5 changes: 5 additions & 0 deletions spec/mail/fields/return_path_field_spec.rb
Expand Up @@ -11,6 +11,11 @@
rp.encoded.should == "Return-Path: <mikel@test.lindsaar.net>\r\n"
end

it "should accept <>" do
rp = Mail::ReturnPathField.new('<>')
rp.encoded.should == "Return-Path: <>\r\n"
end

it "should set the return path" do
mail = Mail.new do
to "to@someemail.com"
Expand Down

0 comments on commit 235fb0e

Please sign in to comment.