[GH-ISSUE #2077] Problems with generate_postfix_maps #1517

Closed
opened 2026-02-27 11:17:31 +03:00 by kerem · 4 comments
Owner

Originally created by @DaveDischord on GitHub (Nov 3, 2020).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/2077

Impacted versions

  • OS Type: Debian/Ubuntu,
  • OS Version: 18.04
  • Database Type: PostgreSQL/MySQL
  • Database version: X.y
  • Modoboa:1.16.1
  • installer used: Yes
  • Webserver: Nginx

Steps to reproduce

python3 manage.py generate_postfix_maps --destdir /etc/postfix

Current behavior

Traceback (most recent call last):
  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "/srv/modoboa/.local/lib/python3.6/site-packages/django/core/manageme_init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/srv/modoboa/.local/lib/python3.6/site-packages/django/core/manageme_init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/srv/modoboa/.local/lib/python3.6/site-packages/django/core/managemease.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/srv/modoboa/.local/lib/python3.6/site-packages/django/core/managemease.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/srv/modoboa/.local/lib/python3.6/site-packages/modoboa/core/managemcommands/generate_postfix_maps.py", line 160, in handle
    force_overwrite=options["force_overwrite"])
  File "/srv/modoboa/.local/lib/python3.6/site-packages/modoboa/core/managemcommands/generate_postfix_maps.py", line 142, in __render_map_file
    with open(fullpath, "w") as fp:
PermissionError: [Errno 13] Permission denied: '/etc/postfix/sql-domains.cf'

Expected behavior

No Error

Video/Screenshot link (optional)

A slew of issues started happening when I upgraded from 1.15 to 1.16 (using ./run.py --upgrade). Now emails aren't coming through and some people are unable to log in, via Webmail or Outlook. I'm using LDAP auth through Active Directory

Originally created by @DaveDischord on GitHub (Nov 3, 2020). Original GitHub issue: https://github.com/modoboa/modoboa/issues/2077 # Impacted versions * OS Type: Debian/Ubuntu, * OS Version: 18.04 * Database Type: PostgreSQL/MySQL * Database version: X.y * Modoboa:1.16.1 * installer used: Yes * Webserver: Nginx # Steps to reproduce **python3 manage.py generate_postfix_maps --destdir /etc/postfix** # Current behavior ``` Traceback (most recent call last): File "manage.py", line 21, in <module> main() File "manage.py", line 17, in main execute_from_command_line(sys.argv) File "/srv/modoboa/.local/lib/python3.6/site-packages/django/core/manageme_init__.py", line 381, in execute_from_command_line utility.execute() File "/srv/modoboa/.local/lib/python3.6/site-packages/django/core/manageme_init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/srv/modoboa/.local/lib/python3.6/site-packages/django/core/managemease.py", line 323, in run_from_argv self.execute(*args, **cmd_options) File "/srv/modoboa/.local/lib/python3.6/site-packages/django/core/managemease.py", line 364, in execute output = self.handle(*args, **options) File "/srv/modoboa/.local/lib/python3.6/site-packages/modoboa/core/managemcommands/generate_postfix_maps.py", line 160, in handle force_overwrite=options["force_overwrite"]) File "/srv/modoboa/.local/lib/python3.6/site-packages/modoboa/core/managemcommands/generate_postfix_maps.py", line 142, in __render_map_file with open(fullpath, "w") as fp: PermissionError: [Errno 13] Permission denied: '/etc/postfix/sql-domains.cf' ``` # Expected behavior No Error # Video/Screenshot link (optional) A slew of issues started happening when I upgraded from 1.15 to 1.16 (using ./run.py --upgrade). Now emails aren't coming through and some people are unable to log in, via Webmail or Outlook. I'm using LDAP auth through Active Directory
kerem 2026-02-27 11:17:31 +03:00
Author
Owner

@bduhan commented on GitHub (Nov 3, 2020):

You need to use root privileges when running this command.

<!-- gh-comment-id:721363332 --> @bduhan commented on GitHub (Nov 3, 2020): You need to use root privileges when running this command.
Author
Owner

@DaveDischord commented on GitHub (Nov 3, 2020):

Still get the same error, even in root

<!-- gh-comment-id:721392322 --> @DaveDischord commented on GitHub (Nov 3, 2020): Still get the same error, even in root
Author
Owner

@tonioo commented on GitHub (Nov 4, 2020):

Make sure the /etc/postfix directory has write permission.

<!-- gh-comment-id:721548096 --> @tonioo commented on GitHub (Nov 4, 2020): Make sure the /etc/postfix directory has write permission.
Author
Owner

@DaveDischord commented on GitHub (Nov 5, 2020):

Ended up changing owner of /etc/postfix to 'modoboa' from 'root'. Fixed this issue.

<!-- gh-comment-id:722390790 --> @DaveDischord commented on GitHub (Nov 5, 2020): Ended up changing owner of /etc/postfix to 'modoboa' from 'root'. Fixed this issue.
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#1517
No description provided.