مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-11-30 21:32:30 +00:00
@@ -42,7 +42,6 @@ class Route < ApplicationRecord
|
||||
validate :validate_domain_belongs_to_server
|
||||
validate :validate_endpoint_belongs_to_server
|
||||
validate :validate_name_uniqueness
|
||||
validate :validate_wildcard
|
||||
validate :validate_return_path_route_endpoints
|
||||
validate :validate_no_additional_routes_on_non_endpoint_route
|
||||
|
||||
@@ -180,14 +179,6 @@ class Route < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def validate_wildcard
|
||||
if self.wildcard?
|
||||
if self.endpoint_type == 'SMTPEndpoint' || self.endpoint_type == 'AddressEndpoint'
|
||||
errors.add :base, "Wildcard routes cannot be routed to SMTP servers or addresses"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def validate_domain_belongs_to_server
|
||||
if self.domain && ![self.server, self.server.organization].include?(self.domain.owner)
|
||||
errors.add :domain, :invalid
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم