mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
* 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:
@@ -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
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user