Sieve: fileinto a subfolder of inbox

Federico Fanton federico at panizzolo.it
Mon Dec 5 08:19:07 UTC 2022


Krisztián Szegi wrote:

>>> I'm trying to write a sieve script that moves emails to a *subfolder* of the inbox.
>>> My script:
>>> require ["envelope", "fileinto", "mailbox"];
>>> if anyof( address "to" "support at domain.cc",
>>>           address "cc" "support at domain.cc",
>>>           envelope "to" "support at domain.cc" ) {
>>>   fileinto :create "INBOX.support";
>>> }
>>> But this creates a new "support" folder BESIDE the inbox, not INSIDE it.
>> 
>> 
>> Mine looks like this:
>>      if anyof (header :contains "sender" "@dovecot.org", header :contains "to" "redacted at example.com")
>>      {
>>          fileinto "INBOX.Dovecot";
>>      }
>> 
>> 
>> I notice your rule has ":create" which might be why its always creating a new folder.
>> Try the rule without the ":create"


I'm sorry, I think I've explained myself poorly :( What I'm trying to 
achieve is a "support" folder INSIDE Inbox, so that an email client will 
show a structure like this one:

Inbox
   +--- support
Sent
Trash

What I'm getting instead is:

Inbox
Sent
Trash
support


> See here for the relevant stuff.
> Basically you haven' passed "LAYOUT=fs" to mail_location
> So you need to use "." for hierarchical separator.
> 
> I presume there IS some advantage for the default Maildir++ format, but I don't know what that is...

I have used the "." separator, but the new folder gets created beside 
the inbox instead of inside :( Do you mean that using "LAYOUT=fs" I 
could achieve that? Can this setting be changed without breaking other 
stuff? This is a fairly active email server

Many thanks again!


More information about the dovecot mailing list