`Spam' folder creation for multiple users

Aki Tuomi aki.tuomi at open-xchange.com
Sun Mar 17 20:43:25 EET 2019


> On 17 March 2019 20:37 Marek Kozlowski via dovecot <dovecot at dovecot.org> wrote:
> 
>  
> :-)
> 
> I've just added pigeonhole and a simple sieve script:
> -------------------------------------------------
> require "fileinto";
> if header :contains "X-Spam-Flag" "YES" {
>    fileinto "Spam";
> }
> -------------------------------------------------
> 
> If a user has this folder (`Spam') it works fine. If they haven't it 
> results in an error.
> 
> 1. Can I modify the script to create this folder if the need arise?

require ["fileinto","mailbox"];
if header :contains "X-Spam-Flag" "YES" {
   fileinto :create "Spam";
}

> 2. If not - what's the most recommended way of adding this folder for 
> all users (~1000)?
> 

namespace {
  inbox = yes

  mailbox Spam {
     special_use = \Spam
     auto = subscribe
  } 

  <other namespace specific options if necessary>
}


> Thanks!
> Best regards,
> Marek

Aki


More information about the dovecot mailing list