def __call__(self, new): """ Update the aliases for a domain from an aliases(5) file. @type new: L{bytes} @param new: The name of an aliases(5) file. """ self.domain.setAliasGroup(alias.loadAliasFile(self.domains, new))
def opt_aliases(self, filename): """ Specify an aliases(5) file to use for the last specified domain. """ if self.last_domain is not None: if mail.IAliasableDomain.providedBy(self.last_domain): aliases = alias.loadAliasFile(self.service.domains, filename) self.last_domain.setAliasGroup(aliases) self.service.monitor.monitorFile(filename, AliasUpdater(self.service.domains, self.last_domain)) else: raise usage.UsageError("%s does not support alias files" % (self.last_domain.__class__.__name__,)) else: raise usage.UsageError("Specify a domain before specifying aliases")
def opt_aliases(self, filename): """Specify an aliases(5) file to use for this domain""" if self.last_domain is not None: if mail.IAliasableDomain.providedBy(self.last_domain): aliases = alias.loadAliasFile(self.service.domains, filename) self.last_domain.setAliasGroup(aliases) self.service.monitor.monitorFile( filename, AliasUpdater(self.service.domains, self.last_domain)) else: raise usage.UsageError("%s does not support alias files" % (self.last_domain.__class__.__name__, )) else: raise usage.UsageError( "Specify a domain before specifying aliases")
def opt_aliases(self, filename): """Specify an aliases(5) file to use for this domain""" if self.last_domain: if components.implements(self.last_domain, mail.IAliasableDomain): aliases = alias.loadAliasFile(self.service.domains, filename) self.last_domain.setAliasGroup(aliases) self.service.monitor.monitorFile( filename, AliasUpdater(self.service.domains, self.last_domain) ) else: raise usage.UsageError( "%s does not support alias files" % ( self.last_domain.__class__.__name__, ) ) else: raise usage.UsageError("Specify a domain before specifying aliases")
def __call__(self, new): self.domain.setAliasGroup(alias.loadAliasFile(self.domains, new))