1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-11-30 21:32:30 +00:00

remove wildcard validation on routes

closes #57
هذا الالتزام موجود في:
Adam Cooke
2017-04-30 19:26:10 +01:00
الأصل 2be702fac3
التزام 6af6e58d88

عرض الملف

@@ -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