stalwartlabs / mail-server

Secure & Modern All-in-One Mail Server (IMAP, JMAP, POP3, SMTP)
https://stalw.art
3.53k stars 135 forks source link

[bug][sieve]: fileinto not moving emails into subfolders #566

Closed Megver83 closed 3 days ago

Megver83 commented 4 days ago

What happened?

The fileinto sieve extension is only working with root folders, not subfolders. When a subfolder is specified, the email goes to inbox. I suspect it might be sieve-rs's fault, but I'm not sure so I'm reporting the bug here.

How can we reproduce the problem?

Create a rule like the following:

require ["fileinto"];

if header :contains "to" "address@example.com"
{
        fileinto "INBOX.subfolder";
}

The email will not reach INBOX/subfolder but inbox. Also tested with / instead of dot, the same happens. This was first seen in https://github.com/stalwartlabs/mail-server/issues/396#issuecomment-2120826246

Version

v0.8.x

What database are you using?

None

What blob storage are you using?

None

Where is your directory located?

None

What operating system are you using?

None

Relevant log output

No response

Code of Conduct

mdecimus commented 4 days ago

Folder names are case sensitive and the separator is /, you can try with:

require ["fileinto"];

if header :contains "to" "address@example.com"
{
        fileinto "Inbox/subfolder";
}
Megver83 commented 3 days ago

That did the trick. I was using the dot because of this example.

Didn't know that the inbox folder was Inbox, Thunderbird and K9 Mail where showing it as INBOX.

These deserve documentation, if there isn't any, with examples: