Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong migration of Mail's "Accept Unknown Recipients" setting #7257

Closed
stephdl opened this issue Jan 15, 2025 · 3 comments
Closed

Wrong migration of Mail's "Accept Unknown Recipients" setting #7257

stephdl opened this issue Jan 15, 2025 · 3 comments
Assignees
Labels
verified All test cases were verified successfully

Comments

@stephdl
Copy link

stephdl commented Jan 15, 2025

The bug occurs when we have set in NS7 domain the "Accept unknown recipients" flag

Steps to reproduce

  • install a mail server with an AD
  • create a simple user foo, in a group with a true password (user enabled)
  • in the domain of the mail server, set the flag true "Accept unknown recipients" and deliver the anonymous email to foo
  • install nethserver-ns8-migration
  • migrate the stack to a NS8

Expected behavior

I expect a migration without issue

Actual behavior

The migration goes well, no warnings or errors but when you go to the domain of the mail server in NS8, the page is no longer browseable, you have an error displayed

Image

Validation errors: [0.catchall: Must validate one and only one schema (oneOf) 0.catchall.dtype: 0.catchall.dtype must be one of the following: "user", "group", "public", "apo"]

this is what the api output

[root@R1-pve ~]# api-cli run module/mail2/list-domains | jq
Warning: using user "cluster" credentials from the environment
Validation errors: [0.catchall: Must validate one and only one schema (oneOf) 0.catchall.dtype: 0.catchall.dtype must be one of the following: "user", "group", "public", "apo"]
[
  {
    "domain": "ns7-pve2.org",
    "addusers": true,
    "addgroups": false,
    "catchall": {
      "dtype": "external",
      "name": "[email protected]"
    },
    "bccaddr": null,
    "description": ""
  }
]

If I set to null the catchall option, I can display the form and set a catchall from the ns8 UI


[root@R1-pve ~]# api-cli run module/mail2/alter-domain --data '{"domain":"ns7-pve2.org","catchall":null}'
Warning: using user "cluster" credentials from the environment
{"domain": "ns7-pve2.org", "addusers": true, "addgroups": false, "catchall": null, "bccaddr": null, "description": ""}
[root@R1-pve ~]# api-cli run module/mail2/list-domains | jq
Warning: using user "cluster" credentials from the environment
[
  {
    "domain": "ns7-pve2.org",
    "addusers": false,
    "addgroups": false,
    "catchall": {
      "dtype": "user",
      "name": "stephane",
      "ui_name": "stephane de labrusse"
    },
    "bccaddr": null,
    "description": ""
  }
]

However we can see that we have probably an incompatible option between NS7 and NS8 because the option add user from user domain is not allowed with accept unknown recipient

Image

if we look to the domains.json that we have migrated to NS8, we find

[mail2@R1-pve state]$ cat domains.json 
[{"props":{"UnknownRecipientsActionDeliverMailbox":"[email protected]","TransportType":"LocalDelivery","AlwaysBccStatus":"disabled","DisclaimerStatus":"disabled","RelayHost":"","AlwaysBccAddress":"","Description":"","UnknownRecipientsActionType":"deliver"},"name":"ns7-pve2.org","type":"domain"}][mail2@R1-pve state]$ 

Components

nethserver-ns8-migration-1.1.0-1

See also

--

thank Mark Albrecht

@stephdl stephdl self-assigned this Jan 15, 2025
@stephdl stephdl converted this from a draft issue Jan 15, 2025
@stephdl stephdl closed this as completed Jan 15, 2025
@github-project-automation github-project-automation bot moved this from ToDo to Done in NethServer Jan 15, 2025
@stephdl stephdl reopened this Jan 15, 2025
@github-project-automation github-project-automation bot moved this from Done to In Progress in NethServer Jan 15, 2025
stephdl added a commit to NethServer/ns8-mail that referenced this issue Jan 16, 2025
Remove non-migratable catchall handling for UnknownRecipientsActionAction  NethServer/dev#7257
@stephdl
Copy link
Author

stephdl commented Jan 16, 2025

QA

prepare a NS7 mail server with the option Accept unknown recipients enabled
install nethserver-ns8-migration
modify the file /usr/share/nethesis/nethserver-ns8-migration/apps/nethserver-mail/bind.env to point to the goo ns8-mail version ghcr.io/nethserver/mail:1.5.2-dev.1
migrate the NS7 mail server to NS8
once migrated you can open the domain page of the mail server in NS8, the bug is no more reproducible

@stephdl stephdl moved this from In Progress to Testing in NethServer Jan 16, 2025
@stephdl stephdl added the testing Packages are available from testing repositories label Jan 16, 2025
@stephdl stephdl removed their assignment Jan 16, 2025
@lucagasparini lucagasparini self-assigned this Jan 16, 2025
@lucagasparini
Copy link

VERIFIED
I confirm that the bug is not reproducible 👍

@lucagasparini lucagasparini added the verified All test cases were verified successfully label Jan 17, 2025
@github-actions github-actions bot removed the testing Packages are available from testing repositories label Jan 17, 2025
@nethbot nethbot moved this from Testing to Verified in NethServer Jan 17, 2025
@DavidePrincipi DavidePrincipi added this to the NethServer 8.4 milestone Jan 22, 2025
@stephdl
Copy link
Author

stephdl commented Jan 27, 2025

@stephdl stephdl closed this as completed Jan 27, 2025
@github-project-automation github-project-automation bot moved this from Verified to Done in NethServer Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
verified All test cases were verified successfully
Projects
Status: Done
Development

No branches or pull requests

3 participants