1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2026-01-17 21:39:47 +00:00

feat: privacy mode

Adds support for hiding IP addresses & hostnames associated with clients sending
authenticated mail in to Postal over SMTP and HTTP
هذا الالتزام موجود في:
Adam Cooke
2024-02-06 19:35:43 +00:00
الأصل f05c2e4503
التزام 15f9671b66
9 ملفات معدلة مع 141 إضافات و59 حذوفات

عرض الملف

@@ -91,7 +91,7 @@ class IncomingMessagePrototype
content: attachment[:data]
}
end
mail.header["Received"] = "from #{@source_type} (#{@ip} [#{@ip}]) by Postal with HTTP; #{Time.now.utc.rfc2822}"
mail.header["Received"] = Postal::ReceivedHeader.generate(@server, @source_type, @ip, :http)
mail.to_s
end
end

عرض الملف

@@ -175,7 +175,7 @@ class OutgoingMessagePrototype
content: attachment[:data]
}
end
mail.header["Received"] = "from #{@source_type} (#{resolved_hostname} [#{@ip}]) by Postal with HTTP; #{Time.now.utc.rfc2822}"
mail.header["Received"] = Postal::ReceivedHeader.generate(@server, @source_type, @ip, :http)
mail.message_id = "<#{@message_id}>"
mail.to_s
end
@@ -196,12 +196,4 @@ class OutgoingMessagePrototype
{ id: message.id, token: message.token }
end
def resolved_hostname
@resolved_hostname ||= begin
Resolv.new.getname(@ip)
rescue StandardError
@ip
end
end
end