[Dovecot] Overriding Default Subscription Behavior
The subscription files we're migrating from have a "." for folder separation. We will be using Dovecot's maildir with LAYOUT=fs. It's looking for "/" as the separator in the subscription file. So, obviously we could simply write a script to swap the two characters. However, just curious if there are any options for doing this within a plugin (since we're already doing some things in a plugin) by overriding some of the subscription code.something like the "next_line()" in subscriptions.c. I don't see any vfuncs in this area, aside from set_subscribed() I believe.but maybe there's a better spot I'm not thinking of? One thing I've learned with Dovecot is that it somehow supports things I didn't believe it could/would, so I thought I'd ask.
Tony
On Thu, 2009-12-10 at 10:15 -0500, Tony Rutherford wrote:
The subscription files we're migrating from have a "." for folder separation. We will be using Dovecot's maildir with LAYOUT=fs. It's looking for "/" as the separator in the subscription file. So, obviously we could simply write a script to swap the two characters. However, just curious if there are any options for doing this within a plugin (since we're already doing some things in a plugin) by overriding some of the subscription code.something like the "next_line()" in subscriptions.c. I don't see any vfuncs in this area, aside from set_subscribed() I believe.but maybe there's a better spot I'm not thinking of? One thing I've learned with Dovecot is that it somehow supports things I didn't believe it could/would, so I thought I'd ask.
Once you've moved to '/' separator, it's possible that users create mailboxes with '.' characters. So you can't just always keep converting all '.' to '/', you need to do it only once for each user.
You could create a plugin that simply:
- Check if subscriptions.converted file exists, if not continue:
- Convert '.' to '/' in subscriptions and recreate it
- Create subscriptions.converted file
Or something like that.
participants (2)
-
Timo Sirainen
-
Tony Rutherford