1

Topic: No permissions to move emails with sieve (fileto) to public folders

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: FreeBSD
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes 3.5
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I want to move specific emails with sieve to a public folder. After generating a sieve script like

require ["fileinto"];
if allof (header :contains "subject" "test", address :is "from" "X@Y.Z") {
  fileinto "Public/test";
}

I get an error in the log file (user var/vmail/vmail1/account.com/.../sieve/dovecot.sieve.log):

error: from=X@Y.Z envelope_sender=X@Y.Z, subject=test, msgid=f6fdbb9e-b2d8-4e27-ad65-efd040f3b6cb@Y.Z, size=3079, failed to store into mailbox 'Public/test': Permission denied.

I think dovecot wants to access the public folder with the user/sender X@Y.Z which doesn't have permissions to do so. If I use a local IMAP folder the script has no problems. I can also drag the emails manually to the public folder.

Gerhard

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: No permissions to move emails with sieve (fileto) to public folders

Did you try to grant required privileges on public folder to the user?

3

Re: No permissions to move emails with sieve (fileto) to public folders

Yes, with Thunderbird there's no problem to save or delete messages the IMAP public folder.

4

Re: No permissions to move emails with sieve (fileto) to public folders

What ACL do you set for the public folder?

5

Re: No permissions to move emails with sieve (fileto) to public folders

doveadm acl get -u myuser@mydomain.com "Public/test"

ID                             Global Rights
anyone                      lookup read
user=myuser@mydomain.com  create delete expunge insert lookup read write write-deleted write-seen

6

Re: No permissions to move emails with sieve (fileto) to public folders

You missed permission "post" (Messages can be posted to the mailbox by LDA, e.g. from Sieve scripts):
https://docs.iredmail.org/public.folder … th-doveadm

7

Re: No permissions to move emails with sieve (fileto) to public folders

Yes! Thanks a lot. You'll get your coffee tomorrow!