Mail - Addresses do not display

NS8’s mail module has begun throwing the following error when I try to load my address list in the mail module:

Validation errors: [addresses.9: Must validate one and only one schema (oneOf) addresses.9.local: Does not match pattern ‘[1]+$’ addresses.9: Must validate all the schemas (allOf) addresses.11: Must validate one and only one schema (oneOf) addresses.11.local: Does not match pattern ‘[2]+$’ addresses.11: Must validate all the schemas (allOf)]

Try what I may, I cannot view the addresses and cannot take any corrective measures to deal with this validation error without seeing the addresses.

This issue is new for me. I am running NS8 on PVE with the most updated core and mail. Happy to pull any additional details required to address this issue.


  1. ^@ ↩︎

  2. ^@ ↩︎

1 Like

Do you use mail app 1.6.4 or did you update to 1.7+ ?
You may check the version in Software Center or on CLI:

api-cli run module/mail1/get-status | jq

Let’s try to list the addresses:

api-cli run module/mail1/list-addresses | jq

Please also check the domain settings:

api-cli run module/mail1/list-domains | jq

Thanks @mrmarkuz .

I’ve run these checks. I only have a single domain, so that’s easy enough.

The list of addresses prints (it is extensive).

The two lines at issue are:

{
  "local": "evidence@apstrom.ca",
  "destinations": [
    {
      "dtype": "external",
      "name": "vmail+evidence@apstrom.ca"
    }
  ],

    {
      "local": "stephsmithin@apstrom.ca",
      "destinations": [
        {
          "dtype": "external",
          "name": "vmail+stephsmithin@apstrom.ca"
        }
      ],

These addresses need to be removed / reformatted.

Does it work to remove “evidence@apstrom.ca” by executing the following command? (adapt mail1 to the mail app instance name)

api-cli run module/mail1/remove-address --data '{"local":"evidence","atype":"domain","domain":"apstrom.ca"}'

This call returns the same error. The issue is that the “local” row is populated by “evidence@apstrom.ca”, which throws the error. I’ll have to manually edit the database to modify the address.

1 Like

Please ensure to have a working backup in case something goes wrong.

To enter the postfix sqlite database:

runagent -m mail1 podman exec -ti postfix sqlite3 /srv/pcdb.sqlite

Check out the postfix README for more information.

Hi,

Did you manage to resolve the issue?

I seem to stumbled into the same problem:

{

“local”: “something@mydomain.com”,

“destinations”: [

{

“dtype”: “user”,

“name”: “usernamehere”,

“ui_name”: “User Name”

}

],

“atype”: “domain”,

“domain”: “mydomain.com

},

How can i remove the address in question?

Do you remember how you added that wrong entry?

The sqlite db for mail instance mail1 is located in /home/mail1/.config/state/pcdb/pcdb.sqlite, see the post above how to edit it on CLI.
Please consider to make a backup before changing the sqlite db.

If you like to use some GUI, there’s sqlitebrowser.

To scp the file to your workstation, you could use a command like this:

scp root@mynethserver:/home/mail1/.config/state/pcdb/pcdb.sqlite .

After removing the wrong entry you could move it back to the Nethserver, I’d stop the postfix service before moving the file back and start it again afterwards.

runagent -m mail1 systemctl --user stop postfix
runagent -m mail1 systemctl --user start postfix

I created it through the GUI → mail → addresses → create address.

Though am running a backup every day, can i just scp the database out, make a duplicate and then copy back the modified db to see if the changes were successfull, without using the restore function of nethserver?

Yes, that should be possible. If something goes wrong you can copy back the original one.

So i tried to delete the entry using the GUI option you mentioned, but to be honest i have no idea what am doing :slight_smile:

The error that i get:

Validation errors: [addresses.21: Must validate one and only one schema (oneOf) addresses.21.local: Does not match pattern ‘^[^@]+$’ addresses.21: Must validate all the schemas (allOf)]

Once i opened the DB with the “DB Browser for SQLite” → Browse Data tab → there i see a bunch of numbered rows, from where i did deleted the row 21.

Then clicked on “write changes” → copied back the DB to Nethserver and ran the 2 commands, but then i get the same error message whan i go into the addresses on the dashboard.

I guess am deleting the wrong entry? How can i know whichone is the right one to delete?

Adding to it, i deleted only from the “addresses” table.

Maybe i need to delete also from “destmap”?

But wouls be still good to know if i have to delete the 21.st row in the table

Check the add-address action, it should help to identify the tables to edit.

EDIT:

What did you enter in the UI to create that not working address? I’d like to reproduce the issue…

As far as i know, nothing special. If it is the row 21, then the mail address is very simple. The problem is, i do not know which address caused the issue really, cause i did not receive the error after adding it. I got the error some stage when i wanted to entere a new address, and when you navigate to addresses it normally loads them, but instead facd the error.

Address creation still works though, so i lived with it for a while, just ignoring it.

OK, so maybe it’s some old address created with an earlier version of mail and meanwhile it’s not allowed anymore to add such addresses.

You could send me the db and I’ll try to fix it.

would the test be helpfull to delete all addresses in the “addresses” and “destmap”, and see if it work after?

Hah, success :slight_smile:

Since i had no idea what am looking for on ns8-mail/imageroot/actions/add-address/validate-input.json at main · NethServer/ns8-mail · GitHub, i had a look through the addresses, when i spotted one, where i somehow managed to enter a full email address as a name.

I deleted that from both “addresses” and “destmap”, after that it worked.

Many thanks for the great help again :slight_smile:

1 Like

Great that you finally found it! You’re welcome!