X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=lib%2Frm%2Fplugins%2Fdovecot.rb;h=0ced5bec3acf4aca70bbdd7008882112c78ba412;hp=837a7fd68b4da94c3c8363d64035622c410796be;hb=1ee3ee0afbca846fa83ae741bbc5a101cc4a4cb6;hpb=72696d3f6e95ef773af9727e9c3459b9038b0fc2 diff --git a/lib/rm/plugins/dovecot.rb b/lib/rm/plugins/dovecot.rb index 837a7fd..0ced5be 100644 --- a/lib/rm/plugins/dovecot.rb +++ b/lib/rm/plugins/dovecot.rb @@ -11,14 +11,22 @@ class DovecotRm def delete_domain(domain) - # Will raise an exception if the path doesn't exist. domain_path = self.get_domain_path(domain) + + if not File.directory?(domain_path) + raise NonexistentDomainError.new(domain.to_s()) + end + FileUtils.rm_r(domain_path) end def delete_user(user) - # Will raise an exception if the path doesn't exist. user_path = self.get_user_path(user) + + if not File.directory?(user_path) + raise NonexistentUserError.new(user.to_s()) + end + FileUtils.rm_r(user_path) end