1

Topic: maillist_admin.py fils with python ImportError

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9 MYSQL edition.
- Deployed with iRedMail Easy or the downloadable installer? DOWNLOADABLE
- Linux/BSD distribution name and version: Ubuntu 18.04.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I recently set up iRedMail on a new server, and am interested in seeing how mlmmj works. But when I try to run the command line tool:

   [server]:/opt/mlmmjadmin$ python tools/maillist_admin.py

I get the following python error:

Traceback (most recent call last):
  File "tools/maillist_admin.py", line 14, in <module>
    from libs.utils import is_email
  File "/opt/mlmmjadmin-2.1/tools/../libs/utils.py", line 11, in <module>
    import settings
ImportError: No module named settings

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: maillist_admin.py fils with python ImportError

I got this to work, it was a simple error: I needed correct permissions -- ran as `sudo` and it worked okay.

Now problem: I can't reach the mlmmjadmin service using curl. I'm trying the example curl commands and the response is "not found".

3

Re: maillist_admin.py fils with python ImportError

wevrem wrote:

Now problem: I can't reach the mlmmjadmin service using curl. I'm trying the example curl commands and the response is "not found".

Please show us your full curl command.

4

Re: maillist_admin.py fils with python ImportError

I'm trying to use mlmmjadmin REST API to create an email list. My curl command is:

$ sudo curl -X POST --header 'X-MLMMJADMIN-API-AUTH-TOKEN: 43a89b...' -d "owner=postmaster@lists.example.com" http://127.0.0.1:7790/announce@lists.example.com

Of course I'm using the full auth token from `/opt/mlmmjadmin/settings.py`, and I'm using my actual domain, not `example.com`. The response is always:

not found

Is this coming from the python scripts of mlmmjadmin, which means curl is working, but the python scripts are having an error? Or is it a curl error? There are no new entries in the log at `/var/log/mlmmjadmin/mlmmjadmin.log` after I run this.

Note: I can use the command-line tool, `/opt/mlmmjadmin/maillist_admin.py`, to successfully create an email list.