検索条件
全1件
(1/1ページ)
# /usr/local/sbin/milter-manager -u milter-manager --show-configを実施すると・・・
# /usr/local/lib/milter-manager/binding/lib/milter/manager/detector.rb:37
define_milter("milter-opendkim") do |milter|
# /usr/local/lib/milter-manager/binding/lib/milter/manager/detector.rb:45
milter.connection_spec = "local:/var/run/milteropendkim/dkim-milter"
# default
milter.description = nil
# /usr/local/lib/milter-manager/binding/lib/milter/manager/detector.rb:38
milter.enabled = true
# default
milter.fallback_status = "accept"
# default
milter.evaluation_mode = false
# default
milter.applicable_conditions = []
# /usr/local/lib/milter-manager/binding/lib/milter/manager/detector.rb:40
milter.command = "/usr/local/etc/rc.d/milter-opendkim"
# /usr/local/lib/milter-manager/binding/lib/milter/manager/detector.rb:41
milter.command_options = "start"
# default
milter.user_name = nil
# default
milter.connection_timeout = 297.0
# default
milter.writing_timeout = 7.0
# default
milter.reading_timeout = 7.0
# default
milter.end_of_message_timeout = 297.0
end
は、出てくるが、milter-opendmarc は出てきません。つまり、認識されていなかった。。orz...
["clamav-milter", []],
["milter-dkim", []],
["milter-opendkim", []],
[
"spamass-milter",
[
"Remote Network",
"Unauthenticated",
"No Stress",
],
],
とあるので、["milter-dkim", []] とある行の下に、 ["milter-opendmarc", []], を追加し、
["clamav-milter", []],
["milter-dkim", []],
["milter-opendkim", []],
["milter-opendmarc", []],
[
"spamass-milter",
[
"Remote Network",
"Unauthenticated",
"No Stress",
],
],
のようにします。これで、# /usr/local/sbin/milter-manager -u milter-manager --show-configを実施すると、"milter-opendmarc" は識別されるようになりました。
milter-manager[53830]: [egg][error] must set connection spec: milter-opendmarcという、エラーが出て OpenDMARCは動作しません。再び、
# /usr/local/sbin/milter-manager -u milter-manager --show-configとすると、
# /usr/local/lib/milter-manager/binding/lib/milter/manager/detector.rb:37
define_milter("milter-opendmarc") do |milter|
# /usr/local/lib/milter-manager/binding/lib/milter/manager/detector.rb:45
milter.connection_spec = nil ← 注目
# default
milter.description = nil
# /usr/local/lib/milter-manager/binding/lib/milter/manager/detector.rb:38
milter.enabled = true
・・・・
要するに、milter-manager からは、接続先不明状態という状況。detector.rb freebsd-rc-detector.rbの2つ。新規に opendkim-config-parser.rb を参考に、 opendmarc-config-parser.rb を追加で作成しています。
--- detector.rb.old 2024-08-12 05:01:29.000000000 +0900
+++ detector.rb.new 2025-06-03 23:53:01.772724000 +0900
@@ -16,6 +16,7 @@
require 'milter/manager/clamav-milter-config-parser'
require 'milter/manager/milter-greylist-config-parser'
require 'milter/manager/opendkim-config-parser'
+require 'milter/manager/opendmarc-config-parser'
require 'milter/manager/rmilter-socket-detector'
require 'milter/manager/rspamd-proxy-detector'
@@ -85,6 +86,10 @@
opendkim_config_parser.socket
end
+ def detect_opendmarc_connection_spec
+ opendmarc_config_parser.socket
+ end
+
def detect_rmilter_connection_spec
Milter::Manager::RmilterSocketDetector.new(rmilter_conf).detect
end
@@ -138,6 +143,7 @@
@clamav_milter_config_parser = nil
@milter_greylist_config_parser = nil
@opendkim_config_parser = nil
+ @opendmarc_config_parser = nil
end
def set_variable(name, unnormalized_value)
@@ -265,5 +271,14 @@
end
@opendkim_config_parser
end
+
+ def opendmarc_config_parser
+ if @opendmarc_config_parser.nil?
+ @opendmarc_config_parser = Milter::Manager::OpenDMARCConfigParser.new
+ @opendmarc_config_parser.parse(opendmarc_conf)
+ end
+ @opendmarc_config_parser
+ end
+
end
end
2)freebsd-rc-detector.rb
--- freebsd-rc-detector.rb.old 2024-08-12 05:01:29.000000000 +0900
+++ freebsd-rc-detector.rb.new 2025-06-04 00:05:45.417658000 +0900
@@ -55,6 +55,10 @@
@script_name == "milter-opendkim" or @name == "milteropendkim"
end
+ def opendmarc?
+ @script_name == "milter-opendmarc" or @name == "milteropendmarc"
+ end
+
def detect_rmilter_connection_spec
Milter::Manager::RmilterSocketDetector.new(rmilter_conf).detect
end
@@ -92,6 +96,12 @@
"/usr/local/etc/opendkim.conf"
end
+ def opendmarc_conf
+ @variables["cfgfile"] ||
+ extract_parameter_from_flags(command_args, "-C") ||
+ "/usr/local/etc/opendmarc.conf"
+ end
+
def rmilter_conf
extract_parameter_from_flags(command_args, "-c") ||
"/usr/local/etc/rmilter.conf"
@@ -111,6 +121,7 @@
spec ||= detect_enma_connection_spec if enma?
spec ||= detect_clamav_milter_connection_spec if clamav_milter?
spec ||= detect_opendkim_connection_spec if opendkim?
+ spec ||= detect_opendmarc_connection_spec if opendmarc?
spec ||= detect_rmilter_connection_spec if rmilter?
spec ||= detect_rspamd_proxy_connection_spec if rspamd?
spec
@@ -141,6 +152,17 @@
detector.detect
detector.apply(loader)
end
+ end
+ if opendmarc? and _profiles and !_profiles.empty?
+ _profiles.each do |profile|
+ detector = FreeBSDRCProfileDetector.new(@configuration,
+ @script_name,
+ profile,
+ self,
+ &@connection_spec_detector)
+ detector.detect
+ detector.apply(loader)
+ end
else
super
end
@@ -206,6 +228,10 @@
end
def detect_opendkim_connection_spec
+ super || @base_variables["socket"]
+ end
+
+ def detect_opendmarc_connection_spec
super || @base_variables["socket"]
end
3)opendmarc-config-parser.rb
--- opendkim-config-parser.rb 2025-05-26 02:31:08.119826000 +0900
+++ opendmarc-config-parser.rb 2025-06-03 23:47:40.989538000 +0900
@@ -16,7 +16,7 @@
require "milter/manager/file-reader"
module Milter::Manager
- class OpenDKIMConfigParser
+ class OpenDMARCConfigParser
def initialize
@variables = {}
end
当方は、ruby は殆ど扱った経験は無いので、「見よう見真似」と「推測」で修正しており、実際はもっと小規模な修正で出来るかもしれませんし、更なる修正が必要かもしれません。# /usr/local/sbin/milter-manager -u milter-manager --show-configを実施すると、
# /usr/local/lib/milter-manager/binding/lib/milter/manager/detector.rb:37
define_milter("milter-opendmarc") do |milter|
# /usr/local/lib/milter-manager/binding/lib/milter/manager/detector.rb:45
milter.connection_spec = "local:/var/run/opendmarc/socket" ← 注目
# default
milter.description = nil
# /usr/local/lib/milter-manager/binding/lib/milter/manager/detector.rb:38
milter.enabled = true
# default
milter.fallback_status = "accept"
# default
milter.evaluation_mode = false
# default
milter.applicable_conditions = []
# /usr/local/lib/milter-manager/binding/lib/milter/manager/detector.rb:40
milter.command = "/usr/local/etc/rc.d/milter-opendmarc"
# /usr/local/lib/milter-manager/binding/lib/milter/manager/detector.rb:41
milter.command_options = "start"
# default
milter.user_name = nil
# default
milter.connection_timeout = 297.0
# default
milter.writing_timeout = 7.0
# default
milter.reading_timeout = 7.0
# default
milter.end_of_message_timeout = 297.0
接続先も認識され、めでたく OpenDMARC が milter-manager で利用できるようになりました。