SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
6.
条件を絞ってmilterを当てる条件を絞ってmilterを当てる例)特定のSASLユーザ名のみチェックを掛ける
defile_milter("viruscheck-milter") do |milter|
milter.connection_spec = "inet:8025@localhost" # ウイルスチェック⽤milter
milter.add_applicable_condition("sasl-username-check")
end
define_applicable_condition("sasl-username-check") do |condition|
condition.define_envelope_from_stopper do |context, from|
if context.authenticated? and context["auth_authen"] == "testuser" th
false
else
true
end
end
end
auth名取得のためにpost x側の設定も必要
true/false 返す場合に、milter掛けるほうがfalse であると
ころに注意
7.
milterを作ってみるmilterを作ってみるこれだけでmilterが作れる
require 'milter/client'
class MilterClient < Milter::ClientSession
def initialize(context)
super(context)
end
def header(name, value)
@headers << [name, value]
end
def body(chunk)
@body << chunk
end
def end_of_message
@headers.each do |name, value|
case name