d = {}
d['i_mean_business'] = false
-
- d['postfixadmin_dbhost'] = 'localhost'
- d['postfixadmin_dbport'] = 5432
- d['postfixadmin_dbopts'] = ''
- d['postfixadmin_dbtty'] = ''
- d['postfixadmin_dbuser'] = 'postgres'
- d['postfixadmin_dbpass'] = ''
- d['postfixadmin_dbname'] = 'postfixadmin'
-
- d['plugins'] = ['postfixadmin',
+ d['plugins'] = ['agendav',
+ 'davical',
'dovecot',
- 'roundcube',
- 'agendav',
- 'davical']
-
- d['mail_root'] = '/var/spool/mail/vhosts'
-
- d['roundcube_dbhost'] = 'localhost'
- d['roundcube_dbport'] = 5432
- d['roundcube_dbopts'] = ''
- d['roundcube_dbtty'] = ''
- d['roundcube_dbuser'] = 'postgres'
- d['roundcube_dbpass'] = ''
- d['roundcube_dbname'] = 'roundcube'
+ 'postfixadmin',
+ 'roundcube']
d['agendav_dbhost'] = 'localhost'
d['agendav_dbport'] = 5432
d['davical_dbpass'] = ''
d['davical_dbname'] = 'davical'
+ d['dovecot_mail_root'] = '/var/spool/mail/vhosts'
+
+ d['postfixadmin_dbhost'] = 'localhost'
+ d['postfixadmin_dbport'] = 5432
+ d['postfixadmin_dbopts'] = ''
+ d['postfixadmin_dbtty'] = ''
+ d['postfixadmin_dbuser'] = 'postgres'
+ d['postfixadmin_dbpass'] = ''
+ d['postfixadmin_dbname'] = 'postfixadmin'
+
+ d['roundcube_dbhost'] = 'localhost'
+ d['roundcube_dbport'] = 5432
+ d['roundcube_dbopts'] = ''
+ d['roundcube_dbtty'] = ''
+ d['roundcube_dbuser'] = 'postgres'
+ d['roundcube_dbpass'] = ''
+ d['roundcube_dbname'] = 'roundcube'
+
return d
end
include Plugin
def initialize(cfg)
- @domain_root = cfg.mail_root
+ @domain_root = cfg.dovecot_mail_root
end
def describe_domain(domain)
davical_dbpass:
davical_dbname: davical
-# dovecot
-mail_root: /var/spool/mail/vhosts
+dovecot_mail_root: /var/spool/mail/vhosts
postfixadmin_dbhost: localhost
postfixadmin_dbport: 5432
davical_dbpass:
davical_dbname: davical_test
-# dovecot
-mail_root: /tmp/mailshears-test
+dovecot_mail_root: /tmp/mailshears-test
postfixadmin_dbhost: localhost
postfixadmin_dbport: 5432
# Check if the given mail directory of the form "example.com/user"
# exists.
cfg = configuration()
- mail_root = cfg.send('mail_root')
- return File.directory?("#{mail_root}/#{dir}")
+ return File.directory?("#{cfg.dovecot_mail_root()}/#{dir}")
end
def connect_superuser()
cfg = configuration()
# First create the "mail directories".
- mail_root = cfg.send('mail_root')
- FileUtils.mkdir_p("#{mail_root}/example.com/alice")
- FileUtils.mkdir_p("#{mail_root}/example.com/booger")
- FileUtils.mkdir_p("#{mail_root}/example.com/jeremy")
- FileUtils.mkdir_p("#{mail_root}/example.net/adam")
+ FileUtils.mkdir_p("#{cfg.dovecot_mail_root()}/example.com/alice")
+ FileUtils.mkdir_p("#{cfg.dovecot_mail_root()}/example.com/booger")
+ FileUtils.mkdir_p("#{cfg.dovecot_mail_root()}/example.com/jeremy")
+ FileUtils.mkdir_p("#{cfg.dovecot_mail_root()}/example.net/adam")
# Now the databases and their content.
connection = connect_superuser()
connection.close()
# Get rid of the maildirs.
- mail_root = cfg.send('mail_root')
- FileUtils.rm_r(mail_root)
+ FileUtils.rm_r(cfg.dovecot_mail_root())
end
end
actual = output_buffer.string()
- mail_root = cfg.send('mail_root')
expected =
"AgendavRm - Removed user adam@example.net.\n" +
"DavicalRm - User adam@example.net not found.\n" +
"DovecotRm - Removed user adam@example.net " +
- "(#{mail_root}/example.net/adam).\n" +
+ "(#{cfg.dovecot_mail_root}/example.net/adam).\n" +
"PostfixadminRm - Removed user adam@example.net.\n" +
"RoundcubeRm - Removed user adam@example.net (User ID: 2).\n"
actual = output_buffer.string()
- mail_root = cfg.send('mail_root')
expected =
"AgendavRm - Removed domain example.net.\n" +
"DavicalRm - Domain example.net not found.\n" +
"DovecotRm - Removed domain example.net " +
- "(#{mail_root}/example.net).\n" +
+ "(#{cfg.dovecot_mail_root}/example.net).\n" +
"PostfixadminRm - Removed domain example.net.\n" +
"RoundcubeRm - Removed domain example.net.\n"