Because of my ISP going through CG-NAT for the IPv4, I previously managed to add an IPv6-only domain to the mail server (postfix+dovecot installed from aaPanel) as discussed in this thread: https://www.aapanel.com/forum/d/16299-how-to-add-an-ipv6-only-domain-to-the-mail-server/6
But I was unable to receive mail due to the lack of IPv6 connectivity of most SMTP relays... So, since the date of this previous thread, I succeeded in obtaining a full-stack IPv4 from my ISP.
Then, I just added the A record (one for @ and a wildcard one *) pointing to my fresh IPv4, but now when I go to "aaPanel / Mail server / Domain List", I get this error below and no domain is displayed:
Sorry, something went wrong:
Traceback (most recent call last):
File "class/panelPlugin.py", line 2160, in a
return eval(execStr)
File "", line 1, in
File "/www/server/panel/plugin/mail_sys/mail_sys_main.py", line 410, in get_domains
public.writeFile(self._session_conf, json.dumps(self._session))
File "/www/server/panel/pyenv/lib/python3.7/json/__init__.py", line 231, in dumps
return _default_encoder.encode(obj)
File "/www/server/panel/pyenv/lib/python3.7/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/www/server/panel/pyenv/lib/python3.7/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/www/server/panel/pyenv/lib/python3.7/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type A is not JSON serializable
I double-checked my A records and they all well point to my public IPv4. Of course, I have a MX record too, pointing to mail.<domain.tld>.
Then, in case, I quickly renamed /www/vmail/postfixadmin.db (on which aaPanel seems to rely for its domain list) and tried to recreate this domain in the mail server, but then it tells it failed to parse A record.
So, what should I do? Is it a known issue? What's the solution please?
TIA
--
EDIT: Also, I just checked, I can now well receive email (even if the concerned target domain doesn't appear anymore in aaPanel / Mail Server / Domain List). So, the A record is working and the issue comes from aaPanel only.
--
EDIT #2: I commented out the line 410 public.writeFile(self._session_conf, json.dumps(self._session)) in mail_sys_main.py and the domain appeared in the domain list of mail server (see screenshot).

So, the A record field is red. I clicked on it and checked the instructions (all is already done at DNS side), but I see that the button at bottom says "Already set, verify domain name resolution". When I click on this button, it just close the popup window and nothing changed (A record field still red).
--
EDIT #3: Since one domain only was created in the mail server, I deleted it and its users, then tried to re-create it from scratch. As result, adding domain.tld and mail.domain.tld in the dialog box for creation, when I clicked "Submit", I got this error in the attached snapshot (sounds identical to what I got above). The displayed IP is the right one (my new public IPv4).

Of course, I reverted back my modifications in code before this attempt. I don't know what to do more...