We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
In the following example notice how 'custom2' header is deleted while deleting 'custom1':
>> m=Mail.new :custom1 => 'test1', :custom2 => 'test2' => \#<Mail::Message:-621216768, Multipart: false, Headers: <custom1: test1>, <custom2: test2>> >> m[:custom2] => #<Mail::Field:0xb5f1ecc0 @field=#<Mail::OptionalField:0xb5f1e504 @length=nil, @name="custom2", @tree=nil, @element=nil, @errors=[], @value="test2", @charset="UTF8">> >> m[:custom1] = nil => nil >> m[:custom2] => nil
The problem is caused by Mail::Field#<=> method. This method treats all custom fields as equal.
Quick monkey patch:
class Mail::Field def <=>( other ) self_order = FIELD_ORDER.rindex(self.name.to_s.downcase) || 100 other_order = FIELD_ORDER.rindex(other.name.to_s.downcase) || 100 if self_order == 100 && self_order == other_order self.name.to_s.downcase <=> other.name.to_s.downcase else self_order <=> other_order end end end
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
In the following example notice how 'custom2' header is deleted while deleting 'custom1':
The problem is caused by Mail::Field#<=> method. This method treats all custom fields as equal.
Quick monkey patch:
The text was updated successfully, but these errors were encountered: