On 15-11-2021 23:04, dovecot@ptld.com wrote:
On 11-15-2021 3:46 pm, Kees van Vloten wrote:
I am trying to move incoming mails into subfolders with this sieve script:
require ["fileinto", "variables", "mailbox"]; if header :matches "Delivered-To" "*@*" { fileinto :create "INBOX/${2}"; }
I am not using variables and my folders are pre-created. But just to give you a starting point, this is what works using maildir++ format with default directory layout. https://doc.dovecot.org/configuration_manual/mail_location/Maildir/
require ["fileinto"]; # rule:[Dovecot] if header :contains "sender" "@dovecot.org" { fileinto "INBOX.Dovecot"; }
ok, I am trying to start simple:
removed the mail_plugin "listescape"
set mail_location = maildir:%h/%d/%n/Maildir
and changed the sieve script into:
require ["fileinto", "variables", "mailbox"];
if header :contains "Delivered-To" "@example.com" { fileinto :create "INBOX.example"; }
Running sieve from the cmdline returns:
error: msgid=76c62f93-527a-d8d9-f787-65926d9c3e25@domain.com: fileinto action: failed to store into mailbox 'INBOX.example': Character not allowed in mailbox name: '.'. sieve-filter(vmail): Info: sieve: msgid=76c62f93-527a-d8d9-f787-65926d9c3e25@domain.com: left message in mailbox 'INBOX'
For some reason the :create seems to have a problem with the folder separator '.'
Any clue how to get '.example' recognized as a subfolder?
- Kees