Ns8 rc1 Webtop could not see mailservers

hum it should come from redis

runagent python
import agent
agent.list_service_providers(agent.redis_connect(),'imap','tcp')

[{'port': '143', 'host': '10.5.4.1', 'node': '1', 'user_domain': 'rocky9-pve4.org', 'module_uuid': '663e7e04-5c1f-42fd-a952-f97952e7cf3c', 'mail_hostname': 'R4-pve.rocky9-pve4.org', 'transport': 'tcp', 'module_id': 'mail1', 'ui_name': None}]

after that you must verify the the get-defaults api of webtop is not guilty

do

api-cli run module/webtop1/get-defaults | jq

  "mail_modules_id": [
    {
      "name": "mail1",
      "label": "rocky9-pve4.org (R4-pve.rocky9-pve4.org)",
      "value": "mail1,rocky9-pve4.org"
    }
  ],

First step is o.k., but then I get:

api-cli run module/webtop2/get-defaults | jq
Warning: using user “cluster” credentials from the environment
Traceback (most recent call last):
File “/home/webtop2/.config/actions/get-defaults/20readconfig”, line 25, in
if kd[‘addusers’]:
~~^^^^^^^^^^^^
TypeError: string indices must be integers, not ‘str’
“”
Where could I set the defaults manually?

BTW, imapsync “sees” the mailserver but gives an error about Tasks after moving to another node:

Assertion failed
File “/home/imapsync2/.config/actions/list-tasks/20read”, line 40, in
agent.assert_exp(response[‘exit_code’] == 0)

I guess moving ist no so easy, I also have a lot of certification-problems now with other modules.

1 Like

I think you find a bug i will check on it

can you check, adapt webtop2 to your webtop module and mail1 to your mailserver


[root@R4-pve ~]# runagent -m webtop2 python
Python 3.11.5 (main, Sep  7 2023, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import agent
>>> agent.tasks.run(f"module/mail1",'list-domains')
{'output': [{'addgroups': False, 'addusers': True, 'bccaddr': None, 'catchall': None, 'description': '', 'domain': 'rocky9-pve4.org'}], 'error': '', 'exit_code': 0}
>>>

how did you move the mail server to another host ?

maybe the bug is that you have no domain set in the mail server ???

>>> agent.tasks.run(f"module/mail1",'list-domains')
{'output': [], 'error': '', 'exit_code': 0}

Mailserver is running and in use.

I moved it from node1 to node2 with “Move”.

Result from agent.tas.run:

agent.tasks.run(f"module/mail2",‘list-domains’) {‘output’: ,
‘error’: ‘’, ‘exit_code’: 0}
File “”, line 1
agent.tasks.run(f"module/mail2",‘list-domains’) {‘output’: ,
‘error’: ‘’, ‘exit_code’: 0}
^
SyntaxError: invalid syntax

can you go to the UI of mail server and check if you have a domain, for what I saw mail1 says no domain at all

you should have

{‘output’: [{‘addgroups’: False, ‘addusers’: True, ‘bccaddr’: None, ‘catchall’: None, ‘description’: ‘’, ‘domain’: ‘rocky9-pve4.org’}], ‘error’: ‘’, ‘exit_code’: 0}

Kind regards

hehehe, would be very interesting, @pike you could fork webtop, and implement it to ask mail configs, instead of getting automatically from the mail module


but i think sogo allows to add other mail servers on the interface, not sure, its long since i loggein into sogo interface