]>
gitweb.michael.orlitzky.com - mailshears.git/blob - lib/rm/plugins/dovecot.rb
3 require 'common/dovecot_plugin'
7 # Handle the removal of users and domains from the Dovecot mailstore
16 # Remove *domain* from the Dovecot mailstore. This just runs "rm -r"
17 # on the domain directory if it exists.
19 # @param domain [Domain] the domain to remove.
21 def remove_domain(domain
)
22 domain_path
= self.get_domain_path(domain
)
24 if not File
.directory
?(domain_path
)
25 raise NonexistentDomainError
.new(domain
.to_s())
28 FileUtils
.rm_r(domain_path
)
32 # Remove *user* from the Dovecot mailstore. This just runs "rm -r"
33 # on the *user*'s mailbox directory, if it exists.
35 # @param user [User] the user whose mailbox directory we want to
39 user_path
= self.get_user_path(user
)
41 if not File
.directory
?(user_path
)
42 raise NonexistentUserError
.new(user
.to_s())
45 FileUtils
.rm_r(user_path
)