[GH-ISSUE #443] postfix configuration upgrade documentation for modoboa 1.0.0 is incorrect #428

Closed
opened 2026-02-27 11:11:43 +03:00 by kerem · 1 comment
Owner

Originally created by @tonioo on GitHub (Dec 4, 2013).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/443

Originally assigned to: @tonioo on GitHub.

Originally created by Louis-Dominique Dubeau on 2013-08-08T10:54:52Z

See this page:

http://modoboa.readthedocs.org/en/latest/getting_started/upgrade.html

The passage in question:

It is necessary to update the queries used to retrieve users and mailboxes:

    1. Replace all occurences of auth_user by admin_user
    2. Into dovecot-sql.conf, update the user_query query, refer to MySQL users or PostgreSQL users
    3. Update dovecot’s configuration to activate the new quota related features

Step 1 understates the issue. During my migration to 1.0.0 I've followed the instruction there to the letter: I went through the files I've created for accessing mailboxes and users and replaced all cases of "auth_user" with "admin_user" and told postfix to reload its configuration. Postfix's logs showed failure message due to the modoboa config. I restarted postfix (just in case). Same thing.

I decided to read the docs for a fresh modoboa install and noticed this:

$ modoboa-admin.py postfix_maps --dbtype  mapfiles

So I generated these files in a temporary directory and compared them with the files I already had. Two of the files were significantly different. Once I replaced my files with these, modoboa worked fine. In light of this, I think the first step above should be replaced with:

    1. Run 

      modoboa-admin.py postfix_maps --dbtype   

    and compare the files with those that postfix currently use. Make necessary updates in light of the differences.

h1. Supporting evidence

The documentation for modoboa 0.9.5 talking about how to manually create these files states that etc/postfix/sql-mailboxes.cf should contain the following:

  user = 
  password = 
  dbname = 
  hosts = 127.0.0.1
  query = SELECT concat(dom.name, '/', mb.path, (SELECT value FROM lib_parameter WHERE name='admin.MAILDIR_ROOT'), '/') FROM admin_mailbox mb INNER JOIN admin_domain dom ON mb.domain_id=dom.id INNER JOIN auth_user user ON mb.user_id=user.id WHERE dom.enabled=1 AND dom.name='%d' AND user.is_active=1 AND mb.address='%u'

However, the same file, produced by modoboa-admin.py contains:

user = 
password = 
dbname = 
hosts = 127.0.0.1
query = SELECT 1 FROM admin_mailbox mb INNER JOIN admin_domain dom ON mb.domain_id=dom.id INNER JOIN admin_user user ON mb.user_id=user.id WHERE dom.enabled=1 AND dom.name='%d' AND user.is_active=1 AND mb.address='%u'

Notice how the query line is completely different. One cannot upgrade this file to work to modoboa 1.0.0 by just changing auth_user to admin_user.

This is the error I got in my mail logs:

Aug  7 10:22:47 bhumi postfix/proxymap[31237]: warning: mysql query failed: Unknown column 'mb.path' in 'field list'

And indeed this field appears to be removed by admin/migrations/0022_auto__del_field_mailbox_uid__del_field_mailbox_gid__del_field_mailbox_.py

Originally created by @tonioo on GitHub (Dec 4, 2013). Original GitHub issue: https://github.com/modoboa/modoboa/issues/443 Originally assigned to: @tonioo on GitHub. **Originally created by Louis-Dominique Dubeau on 2013-08-08T10:54:52Z** See this page: http://modoboa.readthedocs.org/en/latest/getting_started/upgrade.html The passage in question: <pre> It is necessary to update the queries used to retrieve users and mailboxes: 1. Replace all occurences of auth_user by admin_user 2. Into dovecot-sql.conf, update the user_query query, refer to MySQL users or PostgreSQL users 3. Update dovecot’s configuration to activate the new quota related features </pre> _Step 1 understates the issue._ During my migration to 1.0.0 I've followed the instruction there to the letter: I went through the files I've created for accessing mailboxes and users and replaced all cases of "auth_user" with "admin_user" and told postfix to reload its configuration. Postfix's logs showed failure message due to the modoboa config. I restarted postfix (just in case). Same thing. I decided to read the docs for a fresh modoboa install and noticed this: <pre> $ modoboa-admin.py postfix_maps --dbtype <mysql|postgres> mapfiles </pre> So I generated these files in a temporary directory and compared them with the files I already had. Two of the files were significantly different. Once I replaced my files with these, modoboa worked fine. In light of this, I think the first step above should be replaced with: <pre> 1. Run modoboa-admin.py postfix_maps --dbtype <mysql|postgres> <tempdir> and compare the files with those that postfix currently use. Make necessary updates in light of the differences. </pre> h1. Supporting evidence The documentation for modoboa 0.9.5 talking about how to manually create these files states that etc/postfix/sql-mailboxes.cf should contain the following: <pre> user = <user> password = <password> dbname = <database> hosts = 127.0.0.1 query = SELECT concat(dom.name, '/', mb.path, (SELECT value FROM lib_parameter WHERE name='admin.MAILDIR_ROOT'), '/') FROM admin_mailbox mb INNER JOIN admin_domain dom ON mb.domain_id=dom.id INNER JOIN auth_user user ON mb.user_id=user.id WHERE dom.enabled=1 AND dom.name='%d' AND user.is_active=1 AND mb.address='%u' </pre> However, the same file, produced by modoboa-admin.py contains: <pre> user = <user> password = <password> dbname = <database> hosts = 127.0.0.1 query = SELECT 1 FROM admin_mailbox mb INNER JOIN admin_domain dom ON mb.domain_id=dom.id INNER JOIN admin_user user ON mb.user_id=user.id WHERE dom.enabled=1 AND dom.name='%d' AND user.is_active=1 AND mb.address='%u' </pre> Notice how the query line is completely different. One cannot upgrade this file to work to modoboa 1.0.0 by just changing auth_user to admin_user. This is the error I got in my mail logs: <pre> Aug 7 10:22:47 bhumi postfix/proxymap[31237]: warning: mysql query failed: Unknown column 'mb.path' in 'field list' </pre> And indeed this field appears to be removed by admin/migrations/0022_auto__del_field_mailbox_uid__del_field_mailbox_gid__del_field_mailbox_.py
kerem 2026-02-27 11:11:43 +03:00
Author
Owner

@tonioo commented on GitHub (Dec 4, 2013):

Posted by Antoine Nguyen on 2013-08-29T17:13:55Z

Applied in changeset commit:94bb096c9ac6f463840bed6321ddd8df4764a24b.

<!-- gh-comment-id:29816484 --> @tonioo commented on GitHub (Dec 4, 2013): **Posted by Antoine Nguyen on 2013-08-29T17:13:55Z** Applied in changeset commit:94bb096c9ac6f463840bed6321ddd8df4764a24b.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#428
No description provided.