class Inspec::Resources::PostfixConf

Public Class Methods

new(*opts) click to toggle source

Allow user to specify a custom configuration path, use default Postfix configuration path if no custom path is provided

# File lib/inspec/resources/postfix_conf.rb, line 11
def initialize(*opts)
  @params = {}
  if opts.length == 1
    @raw_content = load_raw_content(opts[0])
  else
    @raw_content = load_raw_content("/etc/postfix/main.cf")
  end
  @params = parse(@raw_content)
end

Public Instance Methods

parse(content) click to toggle source
# File lib/inspec/resources/postfix_conf.rb, line 21
def parse(content)
  SimpleConfig.new(content).params
end
to_s() click to toggle source
# File lib/inspec/resources/postfix_conf.rb, line 25
def to_s
  "Postfix Mail Transfer Agent"
end

Private Instance Methods

resource_base_name() click to toggle source
# File lib/inspec/resources/postfix_conf.rb, line 31
def resource_base_name
  "Postfix Config"
end