def __init__(self, root, postmaster=0): """Initialize The first argument is where the Domain directory is rooted. The second is whether non-existing addresses are simply forwarded to postmaster instead of outright bounce The directory structure of a MailddirDirdbmDomain is: /passwd <-- a dirdbm file /USER/inbox/{cur,new,del} <-- each user has these three directories """ AbstractMaildirDomain.__init__(self, root) self.dbm = dirdbm.open(os.path.join(root, 'passwd')) self.postmaster = postmaster
def __init__(self, service, root, postmaster=0): """ @type service: L{MailService} @param service: An email service. @type root: L{bytes} @param root: The maildir root directory. @type postmaster: L{bool} @param postmaster: A flag indicating whether non-existent addresses should be forwarded to the postmaster (C{True}) or bounced (C{False}). """ AbstractMaildirDomain.__init__(self, service, root) dbm = os.path.join(root, 'passwd') if not os.path.exists(dbm): os.makedirs(dbm) self.dbm = dirdbm.open(dbm) self.postmaster = postmaster
def setUp(self): self.path = FilePath(self.mktemp()) self.dbm = dirdbm.open(self.path.path) self.items = ((b"abc", b"foo"), (b"/lalal", b"\000\001"), (b"\000\012", b"baz"))
def setUp(self): self.path = self.mktemp() self.dbm = dirdbm.open(self.path) self.items = (("abc", "foo"), ("/lalal", "\000\001"), ("\000\012", "baz"))
def setUp(self): self.path = self.mktemp() self.dbm = dirdbm.open(self.path) self.items = (('abc', 'foo'), ('/lalal', '\000\001'), ('\000\012', 'baz'))
def setUp(self): self.path = FilePath(self.mktemp()) self.dbm = dirdbm.open(self.path.path) self.items = ((b'abc', b'foo'), (b'/lalal', b'\000\001'), (b'\000\012', b'baz'))