Allow the user to load his own configuration file, overriding the defaults.
require 'mailshears'
-# Load our config file.
-require 'configuration'
-
pgadb = PostfixadminDb.new(Configuration::DBHOST,
Configuration::DBPORT,
Configuration::DBOPTS,
require 'mailshears/exit_codes.rb'
require 'mailshears/postfixadmin_db'
+# Load the default config file first, and let the user override it.
+require 'default_configuration'
+
+begin
+ # Try to load the user's configuration file.
+ userconf_path = ENV['HOME'] + '/.mailshears.conf'
+ require userconf_path
+rescue
+ puts 'No user configuration file (~/.mailshears.conf) found.'
+ puts 'Continuing...'
+end
+
Configuration::PLUGINS.each do |plugin_file|
require "mailshears/plugins/#{plugin_file}"
end