مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2026-01-17 13:39:46 +00:00
fix(dkim): fixes bug with signing dkim bodies
هذا الالتزام موجود في:
@@ -13,7 +13,7 @@ module Postal
|
|||||||
end
|
end
|
||||||
@domain = domain
|
@domain = domain
|
||||||
@message = message
|
@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
|
end
|
||||||
|
|
||||||
def dkim_header
|
def dkim_header
|
||||||
@@ -76,17 +76,18 @@ module Postal
|
|||||||
|
|
||||||
# a. Reduce whitespace
|
# 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
|
# * Ignore all whitespace at the end of lines. Implementations MUST NOT
|
||||||
# remove the CRLF at the end of the line.
|
# remove the CRLF at the end of the line.
|
||||||
content.gsub!(/ \r\n/, "\r\n")
|
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.
|
# b. Ignore all empty lines at the end of the message body.
|
||||||
content.gsub!(/[ \r\n]*\z/, '')
|
content.gsub!(/[ \r\n]*\z/, '')
|
||||||
|
|
||||||
content += "\r\n"
|
content += "\r\n"
|
||||||
|
content
|
||||||
end
|
end
|
||||||
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, email = contents.split(/^---\n/m, 2)
|
||||||
frontmatter = YAML.load(frontmatter)
|
frontmatter = YAML.load(frontmatter)
|
||||||
email.strip
|
email.strip
|
||||||
it "works with #{path.split('/').first}" do
|
it "works with #{path.split('/').last}" do
|
||||||
mocked_time = Time.at(frontmatter['time'].to_i)
|
mocked_time = Time.at(frontmatter['time'].to_i)
|
||||||
allow(Time).to receive(:now).and_return(mocked_time)
|
allow(Time).to receive(:now).and_return(mocked_time)
|
||||||
|
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم