• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Changing sieve fileinto "INBOX.Junk"; into fileinto ".Junk"; IMAP problem

Teamdrews

New Pleskian
Hi everyone,

yesterday I changed my IMAP directory structure in dovecot because Android mobile phones using the standard maill app weren't able to delete mails permanently. The problem is the standard IMAP structure of dovecot wich is nomally like this:

INBOX
INBOX.Junk
INBOX.Sent
INBOX.Trash

I added the following lines into /etc/dovecot/conf.d/40-plesk-imap_structure.conf for changing the prefix:

namespace inbox {
separator = .
prefix =
inbox = yes
}

Now the new IMAP structure looks like this:

INBOX
.Junk
.Sent
.Trash

This works fine for me and my android mobile phone but after this change mails wich where marked as ***SPAM*** wasn't moved to the IMAP junk folder correctly. I know that I have to change the sieve filter but damn i can't find this file....


where can I find the following SIEVE FILTER lines:
require "fileinto";
if header :contains "X-Spam-Flag" "YES" {
fileinto "INBOX.Junk";
}

I need to change them to:
require "fileinto";
if header :contains "X-Spam-Flag" "YES" {
fileinto ".Junk";
}

Can someone please help me?

Merry X-MAS!!!!

greetz
Dennis
 
Hi Dennis.
Last week I try to found information about this and anybody responds my questions.
Finally I found a Dovecot plugin maybe it could be a solution.
But I dont know how to install or enable it, and I dont know if Plesk rewrite this settings.
Its crazy but I come from Courier to Dovecot, and I never have aniy problem with Courier. All the problems was started using Dovecot.
Maybe we can help together.
This is the information I have found:

Dovecot Mailbox alias plugin

Requires Dovecot v2.1.10+ (and currently mailbox_list_index=no). This plugin can be used to configure mailbox aliases, which on the filesystem level are symlinks to other mailboxes. This doesn't magically solve the problem of showing clients e.g. multiple Sent mailboxes, but it can be used to make sure that all of the different variants will have the same mails in them. Unfortunately it also means that some clients will download the same mails to local cache multiple times.

The way it works is that:

  • The aliases won't be visible until the mailbox is CREATEd
  • When alias is CREATEd, a symlink is created to the original mailbox. If the original mailbox didn't exist yet, it's also created.
  • If a mailbox with the same name as alias was already created before this plugin was enabled, its behavior won't change unless it's deleted.
  • When alias is DELETEd, the symlink is removed without deleting any of the mails.
  • The original mailbox can't be DELETEd while it still has aliases.
  • Mailbox can't be RENAMEd if it's an alias or if it has aliases.
Example configuration where "Sent" is the real mailbox and it has aliases "Sent Messages" and "Sent Items":

Code:
mail_plugins = $mail_plugins mailbox_alias
plugin {
  mailbox_alias_old = Sent
  mailbox_alias_new = Sent Messages
  mailbox_alias_old2 = Sent
  mailbox_alias_new2 = Sent Items
}
# Usually you want the Sent mailbox to be autocreated and advertised as SPECIAL-USE \Sent:
namespace inbox {
  mailbox Sent {
    auto = create # or subscribe
    special_use = \Sent
  }
}
 
  • Like
Reactions: H9k
This works fine for me and my android mobile phone but after this change mails wich where marked as ***SPAM*** wasn't moved to the IMAP junk folder correctly. I know that I have to change the sieve filter but damn i can't find this file....


where can I find the following SIEVE FILTER lines:
require "fileinto";
if header :contains "X-Spam-Flag" "YES" {
fileinto "INBOX.Junk";
}

I need to change them to:
require "fileinto";
if header :contains "X-Spam-Flag" "YES" {
fileinto ".Junk";
}

Can someone please help me?

Talking with Plesk support they said about this question:

As of now there is no way to change the target folder for spam.
You have to set a filter for your mails, subject " ***SPAM*** " moved to spam folder.
Additionally you can provide your suggestion for the "special folder of IMAP" on User Voice:
https://plesk.uservoice.com/forums/184549-feature-suggestions
But, I think whit this Dovecot plugin will work.
:(
 
I can confirm that the mailbox_alias plugin did the trick.
In my case, on Ubuntu 16.04, there was no need to install anything.
I just created a new configuration file /etc/dovecot/conf.d/24-mailbox-aliases.conf with the following content:

Code:
mail_plugins = $mail_plugins mailbox_alias
plugin {
  mailbox_alias_old = Junk
  mailbox_alias_new = INBOX.Spam
  mailbox_alias_old2 = Spam
  mailbox_alias_new2 = INBOX.Spam
}
 
Back
Top