1

Topic: iRedAdmin-Pro-SQL-4.9

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):                     1.4.2
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version:                              CentOS 7.9.2009
- 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.
====

  Hello,

After upgrade to last version, I found two problem:

Last Logins: IMAP column - show last info, Last Email Delivery - empty column.

API: If i try to create new email, that don't exists - I get message: {"_success": true}
If i try to create new email, that already exists - I get message: internal server error
Info from /var/log/dovecot.log
Sep 15 22:22:34 host iredadmin: [127.0.0.1] POST /iredadmin/api/user/username@domain.ltd 500 242 "-"

Previously there was a message: {"_success": false, "_msg": "ALREADY_EXISTS"}


Regards
Marius

----

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

2

Re: iRedAdmin-Pro-SQL-4.9

marius.timukas wrote:

Last Logins: IMAP column - show last info, Last Email Delivery - empty column.

If no email delivered, then the "Last Email Delivery" column is empty in SQL database.

marius.timukas wrote:

If i try to create new email, that already exists - I get message: internal server error

What's the error in /var/log/messages when you trigger this error?

3

Re: iRedAdmin-Pro-SQL-4.9

Info from /var/log/dovecot.log

Sep 15 22:22:34 host iredadmin: [127.0.0.1] POST /iredadmin/api/user/username@domain.ltd 500 242 "-"

4

Re: iRedAdmin-Pro-SQL-4.9

ZhangHuangbin wrote:
marius.timukas wrote:

Last Logins: IMAP column - show last info, Last Email Delivery - empty column.

If no email delivered, then the "Last Email Delivery" column is empty in SQL database.

marius.timukas wrote:

If i try to create new email, that already exists - I get message: internal server error

What's the error in /var/log/messages when you trigger this error?


I try to receive email, send email - nothing.  Where can i check in SQL ? Which db/table ?

5

Re: iRedAdmin-Pro-SQL-4.9

Please check /var/log/maillog first, then /var/log/dovecot*.

6 (edited by marius.timukas 2021-09-18 04:22:17)

Re: iRedAdmin-Pro-SQL-4.9

ZhangHuangbin wrote:

Please check /var/log/maillog first, then /var/log/dovecot*.


All records from iredadmin goes to /var/log/dovecot.log.
Records from postfix/amavis goes to /var/log/maillog.

I made a litte more testing. In 4.9 version, I can't create user at all. Don't work POST function (Mail User).
GET/PUT/DELETE functions (Mail User) is working.
Then I rollbacked to 4.8 version. All worked correctly.

In both versions:

If i try to add non existent user to mail alias, i get answer {"_success": true}. Actualy, user wasn't added.
In this case I would expect another message.

root@host bin]# curl -X PUT -b cookie.txt -d "addMember=username@domain.ltd" https://host.domain.ltd/iredadmin/api/a … domain.ltd
{"_success": true}

[root@host bin]# curl -X GET -b cookie.txt https://host.domain.ltd/iredadmin/api/u … domain.ltd
{"_success": false, "_msg": "NO_SUCH_ACCOUNT"}

7

Re: iRedAdmin-Pro-SQL-4.9

I am using Freebsd 13 and iredmail-1.4.2 with iRedAdmin-Pro-SQL-4.9, and find the following errors showing "internal server error" : -

system->Global Spam Policy --- internal server error
create domain -- after creating a domain showing internal server error but such domain can successfully created.
create user -- after creating a user showing internal server error but such user can successfully created.
Please help.

Mr. Y. W. Lai

8

Re: iRedAdmin-Pro-SQL-4.9

laiyukwa wrote:

I am using Freebsd 13 and iredmail-1.4.2 with iRedAdmin-Pro-SQL-4.9, and find the following errors showing "internal server error" : -

Hi Lai,

Any error in /var/log/messages or other log files under /var/log/?
I can not reproduce this error on my local machine.

9

Re: iRedAdmin-Pro-SQL-4.9

Hello,

Maybe you have a good news about problems with APIs? Only these errors i found in log files, when i try to create user through API:

[root@mail bin]# curl -X POST -b cookie.txt -d "name=Test Test&password=xxxxxxxxx&language=en_US" https://mail.domain.ltd/iredadmin/api/u … domain.ltd
internal server error[root@mail bin]#
[root@mail bin]# curl -X POST -b cookie.txt -d "name=Test Test&password=xxxxxxxxx&language=en_US" https://mail.domain.ltd/iredadmin/api/u … domain.ltd
internal server error[root@mail bin]#

[root@mail log]# grep -r test /var/log/*
/var/log/dovecot.log:Nov 26 10:36:25 mail iredadmin: [127.0.0.1] POST /iredadmin/api/user/test@domain.ltd 500 242 "-"
/var/log/dovecot.log:Nov 26 10:36:34 mail iredadmin: [127.0.0.1] POST /iredadmin/api/user/test1@domain.ltd 500 242 "-"
/var/log/nginx/access.log:127.0.0.1 - - [26/Nov/2021:10:36:25 +0200] "POST /iredadmin/api/user/test@domain.ltd HTTP/1.1" 500 32 "-" "curl/7.29.0"
/var/log/nginx/access.log:127.0.0.1 - - [26/Nov/2021:10:36:34 +0200] "POST /iredadmin/api/user/test1@domain.ltd HTTP/1.1" 500 32 "-" "curl/7.29.0"

Email users didn't create.

People on the forum are reporting that have the same problem with iRedAdmin-Pro-SQL-4.9 and iRedAdmin-Pro-LDAP-5.0 APIs.

Maybe here are the problem ? Last version api_user.py is double smaller then previous version.

[root@mail www]# ls -lR ./iRedAdmin-Pro-SQL-4.[5-9]/controllers/sql/api_user.py
-r-xr-xr-x 1 iredadmin iredadmin 24301 Oct 28  2020 ./iRedAdmin-Pro-SQL-4.5/controllers/sql/api_user.py
-r-xr-xr-x 1 iredadmin iredadmin 24301 Oct 30  2020 ./iRedAdmin-Pro-SQL-4.6/controllers/sql/api_user.py
-r-xr-xr-x 1 iredadmin iredadmin 24301 Dec 18  2020 ./iRedAdmin-Pro-SQL-4.7/controllers/sql/api_user.py
-r-xr-xr-x 1 iredadmin iredadmin 24301 Apr 14  2021 ./iRedAdmin-Pro-SQL-4.8/controllers/sql/api_user.py
-r-xr-xr-x 1 iredadmin iredadmin 10752 Sep 15 21:44 ./iRedAdmin-Pro-SQL-4.9/controllers/sql/api_user.py

10

Re: iRedAdmin-Pro-SQL-4.9

Could you please try this to get the detailed error log?

- Start iRedAdmin-Pro from console, it will listen on port 8080 by default:

cd /opt/www/iredadmin/
python3 iredadmin.py

- Now update your API code to use port 8080 (and http, not httpS). Reproduce the error and copy me full console output. I need the log for troubleshooting.

11

Re: iRedAdmin-Pro-SQL-4.9

Hello,

127.0.0.1:39010 - - [06/Dec/2021 17:31:10] "HTTP/1.1 POST /api/login" - 200 OK
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/web/application.py", line 280, in process
    return self.handle()
  File "/usr/local/lib/python3.6/site-packages/web/application.py", line 271, in handle
    return self._delegate(fn, self.fvars, args)
  File "/usr/local/lib/python3.6/site-packages/web/application.py", line 514, in _delegate
    return handle_class(cls)
  File "/usr/local/lib/python3.6/site-packages/web/application.py", line 492, in handle_class
    return tocall(*args)
  File "/var/www/iRedAdmin-Pro-SQL-4.9/libs/sqllib/decorators.py", line 191, in proxyfunc
    return func(*args, **kw)
  File "/var/www/iRedAdmin-Pro-SQL-4.9/controllers/sql/api_user.py", line 74, in POST
    sql_lib_user.redirect_if_user_is_global_admin(conn=None, mail=mail, for_api=True)
TypeError: redirect_if_user_is_global_admin() got an unexpected keyword argument 'for_api'

127.0.0.1:39100 - - [06/Dec/2021 17:32:05] "HTTP/1.1 POST /api/user/test@domain.ltd" - 500 Internal Server Error

12

Re: iRedAdmin-Pro-SQL-4.9

This is a known issue and fixed, i sent you (evaldas.kavaliauskas@) a patched version moment ago, let me know if you didn't receive it. Please follow our tutorial to upgrade it:
https://docs.iredmail.org/migrate.or.up … admin.html

We're preparing a new iRedMail + iRedAdmin-Pro release.

13

Re: iRedAdmin-Pro-SQL-4.9

Hello,

I received it and successfully upgraded. User created successfully via APIs.