Skip to content

Paths for personal sieve scripts should be based on the virtual users home directory #109

Done

Description

@stephanblanke

Hi,

Dovecots sieve configuration contains the path for personal sieve files:

sieve_script personal {
type = personal
driver = file
path = /var/mail/vhosts/%{user | domain}/%{user | username}/sieve
active_path = /var/mail/vhosts/%{user | domain}/%{user | username}/.dovecot.sieve
}

These paths assume the following specific configuration of postfixadmin:
$CONF['domain_path'] = 'YES';

Since that might not always be the case, it would be better to build the personal sieve file locations based on the users virtual home directory:

sieve_script personal {
  type = personal
  driver = file
  path = ~/sieve
  active_path = ~/.dovecot.sieve
}

This could be potentially a breaking change for existing installations though, where users in postfixadmin are currently configured with $CONF['domain_path'] = 'NO'; and there are already existing sieve files in the opinionated directory tree. Simple changing the sieve file location in dovecots configuration would lead to users losing access to their sieve filters. I am unsure, whether adding an additional location to the config or trying to move the users files automatically on container startup is a feasible mitigation strategy.

Activity

  1. AndrewSav commented on Nov 28, 2026

    @AndrewSav
    Collaborator

    Since that might not always be the case

    I'm pretty sure this is always the case

    Separately, If I understand how this is set up correctly nothing is really broken and sieve filters still works regardless of the path where they are stored.

    Since changing this is potentially breaking, and the gain is not obvious to me I'm currently leaning towards just leaving it. Can you explain why this is a problem please? You say "it would be better" - better in what way?

  2. stephanblanke commented on Nov 28, 2026

    @stephanblanke
    Author

    I encountered this during a migration scenario. I restored a postfixadmin db dump from another installation, that had the conflicting configuration of $CONF['domain_path'] = 'NO';.

    You say "it would be better" - better in what way?

    It would support the given migration scenario - although I understand that this might be a special case. Also it would consistently implement the logic that was intended: all data (mail and data) of a virtual user is stored in one place. Since the maildir is read from the mailbox table, the same should be true for the sieve location.

    Considering the default value of mailserver2/postfixadmin is hard-coded, the above scenario is the only one, that could cause the inconsistency. From my understanding that would make the change non-breaking and therefore allows import of postfixadmin db dumps which contain conflicting maildir paths. For all installations that are set up from scratch, the change would still generate the same paths as before.

  3. AndrewSav commented on Dec 1, 2026

    @AndrewSav
    Collaborator

    @stephanblanke Can you check if this is in line with your thinking? #112

  4. self-assigned this
    on Dec 1, 2026
  5. stephanblanke commented on Dec 3, 2026

    @stephanblanke
    Author

    Thank you, that looks fine to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions