Please don't use sudo.
Figure out what is the permission that you need and use only those.
Sudo will get the mailman start
to work and change a lot of other
things that will break your installation.
Abhilash is right! do not do that and assume the software is okay. First of all, I guess you are contributing here as a developer. Then you should do the work in a separate environment as individual machines can cause specific issues which may not be issues at all of the software. Read the Contributing Guide for this.
Also for your current problem, I installed mailman from apt and looked at the files. The issue is with this line actually
with open(filename, 'r', encoding='utf-8') as user_config: PermissionError: [Errno 13] Permission denied: '/etc/mailman3/mailman.cfg'
doing ls -lah in /etc/mailman3 gave me this output
-rw-r----- 1 root list 11K Mar 29 22:50 mailman.cfg
I added +x bit to all (This is a temporary sol)
It worked but now gave me a new error
PermissionError: [Errno 13] Permission denied: '/var/lib/mailman3/locks/mailman-cfg.lck|aaryan-Inspiron-5577|11022|4859493668370032506'
Again doing ls -lah in /var/lib/mailman3/locks gave me this output
dr-xr-xr-x 2 list list 4.0K Mar 29 22:50 . drwxr-xr-x 11 list list 4.0K Mar 29 22:50 .. -rw-rw---- 2 list list 80 Mar 31 2019 master.lck -rw-rw---- 2 list list 80 Mar 31 2019 'master.lck|aaryan-Inspiron-5577|9998|1555612377512779593'
There is again a problem with owners and file permissions here. I can also fix this temporarily (Changed the group id)
Now there is this Attribute Error I do not understand why :
Traceback (most recent call last): File "/usr/bin/mailman", line 11, in <module> load_entry_point('mailman==3.1.1', 'console_scripts', 'mailman')() File "/usr/lib/python3/dist-packages/mailman/bin/mailman.py", line 94, in main initialize(config_path) File "/usr/lib/python3/dist-packages/mailman/core/initialize.py", line 189, in initialize initialize_2(propagate_logs=propagate_logs) File "/usr/lib/python3/dist-packages/mailman/core/initialize.py", line 152, in initialize_2 mailman.core.logging.initialize(propagate_logs) File "/usr/lib/python3/dist-packages/mailman/core/logging.py", line 157, in initialize _init_logger(propagate, sub_name, log, logger_config) File "/usr/lib/python3/dist-packages/mailman/core/logging.py", line 110, in _init_logger handler = ReopenableFileHandler(sub_name, path_abs) File "/usr/lib/python3/dist-packages/mailman/core/logging.py", line 50, in __init__ self._stream = self._open() File "/usr/lib/python3/dist-packages/mailman/core/logging.py", line 53, in _open return codecs.open(self.filename, 'a', 'utf-8') File "/usr/lib/python3.6/codecs.py", line 897, in open file = builtins.open(filename, mode, buffering) PermissionError: [Errno 13] Permission denied: '/var/log/mailman3/mailman.log' Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/lib/python3.6/logging/__init__.py", line 1945, in shutdown h.flush() File "/usr/lib/python3/dist-packages/mailman/core/logging.py", line 56, in flush if self._stream: AttributeError: 'ReopenableFileHandler' object has no attribute '_stream'
Judging by the scenario I think we need to fix the ownership and permissions first or am I missing something here?