Topic: Pro script - import_users.py errors adding users to groups
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.0 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer? downloaded
- Linux/BSD distribution name and version: Ubuntu 18.04 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
run:
python import_users.py /opt/users.list
Error:
[OK] Created user: willb@domain.info
Traceback (most recent call last):
File "import_users.py", line 206, in <module>
'require_confirm': 'no'})
File "import_users.py", line 113, in __put
return r.json()
File "/usr/lib/python2.7/dist-packages/requests/models.py", line 892, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
contents of /opt/user.list:
willb@domain.info, sdf4fsa323FAS@, 1024, Will Bark, sysdev@domain.info
I can add users no problem but adding them to groups causes a problem.
Also, is there similar python script for adding aliases to mailboxes? Or a way to do that during the account creation with import_users.py? I don't see anything mentioned.
***edit***
I found I can work around the maillist/group problem by using the tools in:
/opt/mlmmjadmin/tools
python maillist_admin.py create webtest@domain.com only_subscriber_can_post=no disable_archive=yes
python maillist_admin.py add_subscribers webtest@domain.com paulc@domain.com jons@domain.com
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.