Spam is sent to wrong mailbox if `Junk` mailbox isn't called "Junk"
Issue description
If you remove the "Junk" mailbox
and add another mailbox with specialUse = "Junk"
,
junk mail is still sent to "Junk".
What I expected to happen:
I expect junk mail to be sent to the mailbox with specialUse = "Junk"
.
What happened:
A mailbox with name "Junk" was created, and junk mail was sent to it.
Technical details
- system: `"x86_64-linux"`
- host os: `Linux 5.10.40, NixOS, 21.05.1268.21b696caf39 (Okapi)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.3.12`
- channels(root): `"nixos-21.05.1268.21b696caf39, nixos-unstable-21.11pre293089.1c2986bbb80"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
SNM release branch name and Commit ID
nixos-21.05
6e0690093c24261192ee5c0557f85791a67eec29
.
Relevant part of the config to reproduce:
mailserver.mailboxes = {
spam = {
auto = "subscribe";
specialUse = "Junk";
};
};
Other Information
I think the issue is with with following lines:
https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/blob/master/mail-server/dovecot.nix#L112,
https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/blob/master/mail-server/dovecot.nix#L232,
https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/blob/master/mail-server/dovecot.nix#L238.
You may be able to find the mailbox with specialUse = "Junk"
and use that name instead of "Junk".
Otherwise,
an explicit option to name the junk mailbox
could work.