POP3 & IMAP inbox setting for virtual

Steffen Kaiser skdovecot at smail.inf.fh-brs.de
Fri Jul 29 07:03:30 UTC 2016


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 28 Jul 2016, Michael Fox wrote:

> 2)  I'd like both POP3 and IMAP users to see both namespaces.
>
> As I understand it, this requires the use of the virtual plugin for POP3, in
> order to create a virtual namespace which would mix together the private and
> public namespaces into one mailbox.

> I have read:
>
> http://wiki.dovecot.org/Plugins/Virtual
>
> https://sys4.de/de/blog/2013/02/11/dovecot-virtual-setup-mit-globaler-sieve-
> spamfilter-regel-fur-pop3-nutzer/ (via Google translation)
>
> The example uses a CASE statement in the MySQL userdb query.  As I
> understand it, this is done to set which namespace contains the inbox:  the
> private namespace or the virtual namespace -- depending on if the user is
> connected via the imap or pop3 service, respectively.

> Question:  how do I accomplish the same goal (setting the proper namespace
> for the inbox) when using a passwd-file style flat file userdb?

you can select the passwd-file by %u , e.g. see the first example of 
passdb's on http://wiki2.dovecot.org/AuthDatabase/PasswdFile

So, generate a passwd-file with namespace/inbox/inbox, make a script to 
strip this settings from it and dump into another file. This script is to 
run each time, the main file changes (or by cron), in order to keep both 
files in sync.

Then:

userdb {
   driver = passwd-file
   args = username_format=%n /etc/passwd.%s
  # default_fields = uid=vmail gid=vmail home=/home/vmail/%u
}

Then symlink /etc/passwd.POP3 to the file with and /etc/passwd.IMAP (and 
any other that generates not-found errors) to the file without the virtual 
namespace.

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEVAwUBV5r/wnz1H7kL/d9rAQIpkQgAyFra84aSp8q/osbQyI0J0Z+pEmcGGHeu
stQmW/VLD9Nwtzlg2yLlFs6gUUBNaFhn0bREj0ZKB476lv1mjuY9/blanJFdn1zL
sDGuWrNU+HbrG5aKusp/o3j5Box9YzkCxpVuxBOHvV+11uG1uWxiUkQ+o3tL/+K+
mJq1Hy9ADHan/yUfneJ+S4PFa3EeGYw1DX/iUwnNhILEwd4xY1ZunhSHVwpoKBhj
sxkS4RmTzmCwcQ6qyLXXQAPM7zTsXkK5/uxzQlZC0TB9pTDLlyv5FFf8vH/fQIq8
CHOjC7Mgl4yXnYcA2m8QuQvB9VS8ae6Yy+1QO2/kaaPLQhZvT2HrQQ==
=OrWi
-----END PGP SIGNATURE-----


More information about the dovecot mailing list