1

Topic: 'NoneType' object has no attribute 'execute'

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

Since installing iRedAdmin Pro i filled the whitelist Field with some eMails trusted Sender. But i can`t see any difference. So i tried to check on command line what happens. Every check i get the message :

root@mx:/opt/iredapd/tools# python wblist_admin.py --list --whitelist
* Establishing SQL connection.
* List all inbound whitelist for account: @.
'NoneType' object has no attribute 'execute'

root@mx:/opt/iredapd/tools# python wblist_admin.py --account ms@debid.at --list --whitelist
* Establishing SQL connection.
* List all inbound whitelist for account: ms@debid.at
'NoneType' object has no attribute 'execute'

is there somethin wrong connection to database. Entering something in iredadmin is without any errors

----

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

2

Re: 'NoneType' object has no attribute 'execute'

- Which iRedAPD release are you running? Please show me output of command "ls -dl /opt/iredapd".
- Do you have package "python3-pymysql" installed?
- Do you have this line in /opt/iredapd/settings.py?

SQL_DB_DRIVER = "pymysql"

3

Re: 'NoneType' object has no attribute 'execute'

ZhangHuangbin wrote:

- Which iRedAPD release are you running? Please show me output of command "ls -dl /opt/iredapd".
- Do you have package "python3-pymysql" installed?
- Do you have this line in /opt/iredapd/settings.py?

SQL_DB_DRIVER = "pymysql"

i have installed iRedAPD-4.4

yes SQL_DB_DRIVER = "pymysql" in at last line in settings.py

4

Re: 'NoneType' object has no attribute 'execute'

python3-pymysql is installed (0.7.10-1)

i made now all missing updates to iredmail 1.3.2

root@mx:/opt/iredapd/tools# ls -dl /opt/iredapd
lrwxrwxrwx 1 root root 11 Nov  3 11:39 /opt/iredapd -> iRedAPD-4.6

now i get

root@mx:/opt/iredapd/tools# python wblist_admin.py --list --blacklist
Traceback (most recent call last):
  File "wblist_admin.py", line 14, in <module>
    from libs import utils, wblist
  File "/opt/iRedAPD-4.6/tools/../libs/utils.py", line 774
    def __bytes2str(b) -> str:
                       ^
SyntaxError: invalid syntax

5

Re: 'NoneType' object has no attribute 'execute'

iredapd.log looks fine after sending test mail

│Nov  3 12:32:15 mx iredapd [17.58.23.188] Client network is whitelisted: cidr=17.58.0.0/16                                                                                                 ││Nov  3 12:32:15 mx iredapd Whitelisted: wblist=(1, 50, 'W')                                                                                                                                ││Nov  3 12:32:15 mx iredapd [17.58.23.188] RCPT, malle.stef@icloud.com -> office@debid.at, OK [sasl_username=, sender=malle.stef@icloud.com, client_name=mr85p00im-hyfv06021301.me.com, reve││Nov  3 12:32:15 mx iredapd [17.58.23.188] Client network is whitelisted: cidr=17.58.0.0/16                                                                                                 ││Nov  3 12:32:15 mx iredapd Whitelisted: wblist=(1, 50, 'W')                                                                                                                                ││Nov  3 12:32:15 mx iredapd [17.58.23.188] RCPT, malle.stef@icloud.com -> ms@debid.at, OK [sasl_username=, sender=malle.stef@icloud.com, client_name=mr85p00im-hyfv06021301.me.com, reverse_││Nov  3 12:32:16 mx iredapd [17.58.23.188] END-OF-MESSAGE, malle.stef@icloud.com -> office@debid.at, DUNNO [recipient_count=1, size=1676, process_time=0.0077s]                             ││Nov  3 12:32:16 mx iredapd [17.58.23.188] END-OF-MESSAGE, malle.stef@icloud.com -> ms@debid.at, DUNNO [recipient_count=1, size=1676, process_time=0.0076s]

6

Re: 'NoneType' object has no attribute 'execute'

stefmalle wrote:

root@mx:/opt/iredapd/tools# python wblist_admin.py --list --blacklist

Run it with command "python3", not "python" or "python2".

iRedAPD, mlmmjadmin and iRedAdmin(-Pro) require Python 3 now. Python 2 support has been completely dropped.

7 (edited by stefmalle 2020-11-04 14:35:08)

Re: 'NoneType' object has no attribute 'execute'

ZhangHuangbin wrote:
stefmalle wrote:

root@mx:/opt/iredapd/tools# python wblist_admin.py --list --blacklist

Run it with command "python3", not "python" or "python2".

iRedAPD, mlmmjadmin and iRedAdmin(-Pro) require Python 3 now. Python 2 support has been completely dropped.

aaaarrrrrr, ok, so simple is that. yes of course, everthing is ok typing in commands with python3...
because of the error 'NoneType' object has no attribute 'execute' i thougt the problem is an database problem. yesterday after update and new error i could check python3 by "dumb myself" tongue . Thank you very much for your 1st class support.
one question related to python3 and debian: would you say it`s ok to unistall python2 from debian(9)?

8

Re: 'NoneType' object has no attribute 'execute'

All should be moved to Python 3. It’s ok to uninstall python 2, but I’m not sure if other applications (not installed by iRedMail) requires it.