Skip to content

Public mailbox creation issue when @ character is used in mailbox name #7827

@nrauso

Description

@nrauso

When creating a public mailbox on a mail server instance running on NS8, the configuration wizard suggests that a wildcard mail address will also be created automatically.

The Name field validator currently allows the use of the @ character in the public mailbox name. This can be a valid and useful scenario on mail server instances that manage multiple mail domains, where the administrator may want the public mailbox to be created only for a specific domain (e.g. mypublic@domain.tld).

However, allowing the @ character in the public mailbox name leads to a misconfiguration that causes the list-addresses API to fail.

Steps to reproduce

  • Create a mail server instance on NS8.
  • Create a new public mailbox.
  • In the Name field, use a value containing the @ character (e.g. mypublic@domain.tld).
  • Complete the wizard (a wildcard address is created automatically).
  • Run the following command from CLI:
api-cli run module/mail1/list-addresses | jq

Actual behavior

The API fails with validation errors because the local part of the address contains the @ character, which violates the expected schema:

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

Full API output:

Validation errors: [addresses.1: Must validate one and only one schema (oneOf) addresses.1.local: Does not match pattern '^[^@]+$' addresses.1: Must validate all the schemas (allOf)]
{
  "adduser_domains": [
    "domain.tld"
  ],
  "addgroup_domains": [],
  "addresses": [
    {
      "local": "postmaster",
      "destinations": [
        {
          "dtype": "public",
          "name": "postmaster"
        }
      ],
      "description": "RFC-mandatory postmaster alias",
      "atype": "wildcard",
      "delete_forbidden": true
    },
    {
      "local": "mypublic@domain.tld",
      "destinations": [
        {
          "dtype": "external",
          "name": "vmail+mypublic@domain.tld"
        }
      ],
      "atype": "wildcard"
    },
    {
      "atype": "adduser",
      "local": "admin",
      "description": "Builtin administrator user"
    },
    {
      "atype": "adduser",
      "local": "testuser",
      "description": "Test User"
    }
  ]
}

Components

  • mail:1.7.4

See also

Discussion https://mattermost.nethesis.it/nethesis/pl/tmmy76yz1fg55ppho3cmnsfwpw

Metadata

Metadata

Assignees

No one assigned

    Labels

    UXUser experience issuesverifiedAll test cases were verified successfully

    Type

    No fields configured for Bug.

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions