* see #107: do not include the domain's name in the path anymore,

* see #97: documentation updated with correct MySQL queries.
This commit is contained in:
tonio
2011-01-06 23:45:16 +01:00
parent f1f5801031
commit 2d9d0f1759
2 changed files with 7 additions and 5 deletions
+3 -3
View File
@@ -246,7 +246,7 @@ First, define the following map files on your server (it should work with
password = <password>
dbname = <database>
hosts = 127.0.0.1
query = SELECT concat(t2.address, '@', t3.name) FROM admin_domainaliases AS t1, admin_mailbox AS t2, admin_domain AS t3 WHERE t1.target_id=t2.domain_id AND t2.domain_id=t3.id AND t2.enabled=1 AND t1.name='%d' AND t2.address='%u'
query = SELECT concat(t3.name, '/', t2.path) FROM admin_domainalias AS t1, admin_mailbox AS t2, admin_domain AS t3 WHERE t1.target_id=t2.domain_id AND t2.domain_id=t3.id AND t1.name='%d' AND t2.address='%u'
Then, use the following configuration in the */etc/postfix/main.cf* file
(this is just one possible configuration)::
@@ -264,8 +264,8 @@ Then, use the following configuration in the */etc/postfix/main.cf* file
virtual_mailbox_domains = mysql:/etc/postfix/sql-domains.cf
virtual_alias_domains = mysql:/etc/postfix/sql-domain-aliases.cf
virtual_mailbox_maps = mysql:/etc/postfix/sql-mailboxes.cf
mysql:/etc/postfix/sql-domain-aliases-mailboxes.cf
virtual_alias_maps = mysql:/etc/postfix/sql-aliases.cf
virtual_alias_maps = mysql:/etc/postfix/sql-aliases.cf,
mysql:/etc/postfix/sql-domain-aliases-mailboxes.cf
# Stuff after
NB: Modoboa supports both maildir and mbox formats. You can specify
+4 -2
View File
@@ -103,6 +103,8 @@ class Mailbox(models.Model):
super(Mailbox, self).__init__(*args, **kwargs)
self.mbtype = parameters.get_admin("MAILBOX_TYPE")
self.mdirroot = parameters.get_admin("MAILDIR_ROOT")
if not self.mdirroot.endswith('/'):
self.mdirroot += '/'
def __str__(self):
return self.__full_address()
@@ -116,9 +118,9 @@ class Mailbox(models.Model):
relpath = "%s/%s" % (self.domain.name, self.address)
abspath = os.path.join(parameters.get_admin("STORAGE_PATH"), relpath)
if self.mbtype == "mbox":
self.path = "%s/Inbox" % relpath
self.path = "%s/Inbox" % self.address
else:
self.path = "%s/%s" % (relpath, self.mdirroot)
self.path = "%s/%s" % (self.address, self.mdirroot)
if os.path.exists(abspath):
return True
if not exec_as_vuser("mkdir -p %s" % abspath):