مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-11-30 21:32:30 +00:00
fix(dkim): fixes bug with signing dkim bodies
هذا الالتزام موجود في:
@@ -13,7 +13,7 @@ module Postal
|
||||
end
|
||||
@domain = domain
|
||||
@message = message
|
||||
@raw_headers, @raw_body = @message.split(/\r?\n\r?\n/, 2)
|
||||
@raw_headers, @raw_body = @message.gsub(/\r?\n/, "\r\n").split(/\r\n\r\n/, 2)
|
||||
end
|
||||
|
||||
def dkim_header
|
||||
@@ -76,17 +76,18 @@ module Postal
|
||||
|
||||
# a. Reduce whitespace
|
||||
#
|
||||
# * Reduce all sequences of WSP within a line to a single SP character.
|
||||
content.gsub!(/[ \t]+/, ' ')
|
||||
|
||||
# * Ignore all whitespace at the end of lines. Implementations MUST NOT
|
||||
# remove the CRLF at the end of the line.
|
||||
content.gsub!(/ \r\n/, "\r\n")
|
||||
|
||||
# * Reduce all sequences of WSP within a line to a single SP character.
|
||||
content.gsub!(/[ \t]+/, ' ')
|
||||
|
||||
# b. Ignore all empty lines at the end of the message body.
|
||||
content.gsub!(/[ \r\n]*\z/, '')
|
||||
|
||||
content += "\r\n"
|
||||
content
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
1016
spec/examples/dkim_signing/email2.msg
Normal file
1016
spec/examples/dkim_signing/email2.msg
Normal file
تم حذف اختلاف الملف لأن الملف كبير جداً
تحميل الاختلاف
@@ -10,7 +10,7 @@ describe Postal::DKIMHeader do
|
||||
frontmatter, email = contents.split(/^---\n/m, 2)
|
||||
frontmatter = YAML.load(frontmatter)
|
||||
email.strip
|
||||
it "works with #{path.split('/').first}" do
|
||||
it "works with #{path.split('/').last}" do
|
||||
mocked_time = Time.at(frontmatter['time'].to_i)
|
||||
allow(Time).to receive(:now).and_return(mocked_time)
|
||||
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم