def run(self): if not self.args: self.log.error('no argument provided') return 1 if '@' not in self.args[0]: self.log.error('invalid argument') return 1 (user, domain) = args[0].split('@') path = get_mail_dir(domain, user) shutil.rmtree(path)
def run(self): # renice ourselves os.nice(5) # attempt to parse the arguments try: (domain, local) = self.args[0:2] except: self.log.error('invalid arguments supplied') return 1 # get the domain from the database try: domain = db.query(Domain).filter_by(domain=domain).one() except: self.log.error('unable to find domain') return 1 # change to the mailing lists home maildir = get_mail_dir(domain.domain) os.chdir(os.path.join(maildir, '.mailman'))
def maildir(self): (user, domain) = self.email.split('@') return get_mail_dir(domain, user)