$stdout = output_buffer
plugin_class.includers.each do |plugin_class_includer|
- plugin = plugin_class_includer.new()
+ plugin = plugin_class_includer.new(cfg)
if cfg.i_mean_business then
runner = runner_class.new()
include Plugin
- def initialize()
- cfg = Configuration.new()
+ def initialize(cfg)
@db_host = cfg.agendav_dbhost
@db_port = cfg.agendav_dbport
@db_opts = cfg.agendav_dbopts
USERCONF_PATH = ENV['HOME'] + '/.mailshears.conf.yml'
@dict = {}
- def initialize()
+ def initialize(path = USERCONF_PATH)
cfg = default_configuration()
# Now, load the user configuration which will override the
# variables defined above.
begin
- user_config = YAML.load(File.open(USERCONF_PATH))
+ user_config = YAML.load(File.open(path))
# Write our own update() method for Ruby 1.8.
user_config.each do |key, value|
d['postfixadmin_dbpass'] = ''
d['postfixadmin_dbname'] = 'postfixadmin'
- d['plugins'] = ['postfixadmin', 'dovecot', 'roundcube']
+ d['plugins'] = ['postfixadmin',
+ 'dovecot',
+ 'roundcube',
+ 'agendav',
+ 'davical']
d['mail_root'] = '/var/spool/mail/vhosts'
# is, we implement the Plugin interface.
include Plugin
- def initialize()
- cfg = Configuration.new()
+ def initialize(cfg)
@db_host = cfg.davical_dbhost
@db_port = cfg.davical_dbport
@db_opts = cfg.davical_dbopts
# share. That is, we implement the Plugin interface.
include Plugin
- def initialize
- cfg = Configuration.new()
+ def initialize(cfg)
@domain_root = cfg.mail_root
end
# share. That is, we implement the Plugin interface.
include Plugin
- def initialize()
-
- cfg = Configuration.new()
+ def initialize(cfg)
@db_host = cfg.postfixadmin_dbhost
@db_port = cfg.postfixadmin_dbport
@db_opts = cfg.postfixadmin_dbopts
# That is, we implement the Plugin interface.
include Plugin
- def initialize()
- cfg = Configuration.new()
+ def initialize(cfg)
@db_host = cfg.roundcube_dbhost
@db_port = cfg.roundcube_dbport
@db_opts = cfg.roundcube_dbopts
# We don't want to check the PostfixAdmin database against itself.
return if plugin.class == PostfixadminPrune
- pfa = PostfixadminPrune.new()
+ cfg = Configuration.new()
+ pfa = PostfixadminPrune.new(cfg)
db_users = pfa.list_users()
db_domains = pfa.list_domains()