Junk Mail folder ID Ingestion / Rebuild store #385
Replies: 7 comments 1 reply
-
Hi, Perhaps your mail client created another Junk Folder and you are looking at the wrong Junk Mail folder? This common with Thunderbird for instance, you have to make sure you are subscribed to the Stalwart Junk Mail folder and not the one created by TB. |
Beta Was this translation helpful? Give feedback.
-
Hi @mdecimus Thanks for the response, I should have provided that detail. I don't believe there is a duplicated Junk Mail folder:
I'm just looking through the code to see if I can find where the mailbox / folders are initialised, I was thinking perhaps if I remove the Junk Mail folder it will be recreated? |
Beta Was this translation helpful? Give feedback.
-
Okay it seems a good way to test if there is a "Junk Mail" folder with the incorrect ID is to try deleting it. I think I'm in the right place in the code here: https://github.com/stalwartlabs/mail-server/blob/main/crates/jmap/src/mailbox/set.rs#L329 I tried deleting the Junk Mail from an account and got the expected denied response:
Then on another mailbox which seems had a second Junk Mail that seems to be hiding the system generated Junk Mail:
So I was able to delete the offending Junk Mail which then allowed the list to show the real system generated Junk Mail into which spam mails are being delivered. |
Beta Was this translation helpful? Give feedback.
-
I see here: mail-server/crates/imap/src/core/mailbox.rs Line 257 in 58b8c5b That there's a test for duplicate INBOX. I wonder if it might be useful to do a similar test for other system folders? During my search on this issue I was having I did come across a handful of similar issues created by others, perhaps a check for duplicates there might reduce this. |
Beta Was this translation helpful? Give feedback.
-
The system should not have allowed your IMAP client to create a folder with a duplicate one. I am not able to reproduce this issue though, do you have an easy way to reproduce this? |
Beta Was this translation helpful? Give feedback.
-
Let me see if I can come up with a test case for you |
Beta Was this translation helpful? Give feedback.
-
Well, I don't know either! I can't seem to create a test case unfortunately. I did note that I can rename "Junk Mail" and then create a new "Junk Mail", this isn't really related to my initial post as in that case when I deleted the "Junk Mail" folder it was shadowing the system one. In this case they are separately named folders. Not really a bug so much - I'm not sure if you want to restrict renaming system folders or not, but I figure more info is better than none :) I'll see if I can come up with anything else more related to the first case.
|
Beta Was this translation helpful? Give feedback.
-
First off, really impressive work with the entire ecosystem, I've been keeping an eye on it for quite some time and you've made amazing progress and it's looking great.
I'm running 0.7.2.
Ref #195
I'm not sure how I got into this situation but similar to the above issue my "Junk Mail" folder id appears to not correlate with where spam is delivered which I believe is here?
https://github.com/stalwartlabs/mail-server/blob/main/crates/jmap/src/email/ingest.rs#L121
I'm using postgres as an internal directory store. I created the accounts with the web interface.
Is there a way to somehow rebuild the (JMAP?) store to make the folder id correlate with what Stalwart is expecting when ingesting mail, or force the id for the folder to match somehow?
I believe from this output the mail tagged as spam is being delivered to a folder which I can't seem to see over IMAP, but I'm very happy to be corrected, or for any other assistance. There have definitely been spam mails delivered to the account. I believe this log line shows that:
This is one account:
This is another:
Beta Was this translation helpful? Give feedback.
All reactions