Rubyでmilter
  require 'milter'
  
  class Session < Milter::ClientSession
    def connect(context, host, address)
      ...
    end
    def helo(context, fqdn)
      ...
    end
    ...
  end