مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-12-01 05:43:04 +00:00
style(rubocop): Style/SelectByRegexp
هذا الالتزام موجود في:
14
.rubocop.yml
14
.rubocop.yml
@@ -113,17 +113,6 @@ Lint/BooleanSymbol:
|
||||
Style/SymbolProc:
|
||||
Enabled: false
|
||||
|
||||
Metrics/ModuleLength:
|
||||
Exclude:
|
||||
- "spec/factories/**/*.rb"
|
||||
- "spec/**/*_spec.rb"
|
||||
- "spec/support/**/*.rb"
|
||||
- "spec/specs/support/**/*.rb"
|
||||
- "db/schema.rb"
|
||||
- "db/migrate/**/*.rb"
|
||||
- "lib/tasks/auto_annotate_models.rake"
|
||||
- "config/routes.rb"
|
||||
|
||||
# Allow a maxmium of 5 arguments and don't include keyword arguments
|
||||
Metrics/ParameterLists:
|
||||
Max: 5
|
||||
@@ -175,6 +164,9 @@ Metrics/BlockLength:
|
||||
Metrics/ClassLength:
|
||||
Enabled: false
|
||||
|
||||
Metrics/ModuleLength:
|
||||
Enabled: false
|
||||
|
||||
Lint/UnusedMethodArgument:
|
||||
Enabled: false
|
||||
|
||||
|
||||
@@ -44,12 +44,12 @@ module HasDNSChecks
|
||||
|
||||
def check_spf_record
|
||||
result = resolver.getresources(name, Resolv::DNS::Resource::IN::TXT)
|
||||
spf_records = result.map(&:data).select { |d| d =~ /\Av=spf1/ }
|
||||
spf_records = result.map(&:data).grep(/\Av=spf1/)
|
||||
if spf_records.empty?
|
||||
self.spf_status = "Missing"
|
||||
self.spf_error = "No SPF record exists for this domain"
|
||||
else
|
||||
suitable_spf_records = spf_records.select { |d| d =~ /include:\s*#{Regexp.escape(Postal.config.dns.spf_include)}/ }
|
||||
suitable_spf_records = spf_records.grep(/include:\s*#{Regexp.escape(Postal.config.dns.spf_include)}/)
|
||||
if suitable_spf_records.empty?
|
||||
self.spf_status = "Invalid"
|
||||
self.spf_error = "An SPF record exists but it doesn't include #{Postal.config.dns.spf_include}"
|
||||
|
||||
@@ -418,7 +418,7 @@ module Postal
|
||||
return "552 Message too large (maximum size %dMB)" % Postal.config.smtp_server.max_message_size
|
||||
end
|
||||
|
||||
if @headers["received"].select { |r| r =~ /by #{Postal.config.dns.smtp_server_hostname}/ }.count > 4
|
||||
if @headers["received"].grep(/by #{Postal.config.dns.smtp_server_hostname}/).count > 4
|
||||
transaction_reset
|
||||
@state = :welcomed
|
||||
return "550 Loop detected"
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم