مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-11-30 21:32:30 +00:00
43 أسطر
941 B
Ruby
43 أسطر
941 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Postal
|
|
class MessageInspector
|
|
|
|
def initialize(config)
|
|
@config = config
|
|
end
|
|
|
|
# Inspect a message and update the inspection with the results
|
|
# as appropriate.
|
|
def inspect_message(message, scope, inspection)
|
|
end
|
|
|
|
private
|
|
|
|
def logger
|
|
Postal.logger
|
|
end
|
|
|
|
class << self
|
|
|
|
# Return an array of all inspectors that are available for this
|
|
# installation.
|
|
def inspectors
|
|
[].tap do |inspectors|
|
|
if Postal.config.rspamd&.enabled
|
|
inspectors << MessageInspectors::Rspamd.new(Postal.config.rspamd)
|
|
elsif Postal.config.spamd&.enabled
|
|
inspectors << MessageInspectors::SpamAssassin.new(Postal.config.spamd)
|
|
end
|
|
|
|
if Postal.config.clamav&.enabled
|
|
inspectors << MessageInspectors::Clamav.new(Postal.config.clamav)
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
end
|