POP3 & IMAP inbox setting for virtual
Posted Monday 7/25. Haven't seen a response. Trying again:
This is a noobie question, so bear with me if it's not worded correctly:
Primary Requirements:
- I'd like to have two namespaces - one private/per-user, and one public (visible by all logged-in users).
The public mailbox(s) would be used to distribute information to all users.
- 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?
Thanks,
Michael
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 28 Jul 2016, Michael Fox wrote:
- 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-----
Thanks Steffen.
you can select the passwd-file by %u , e.g. see the first example of passdb's on http://wiki2.dovecot.org/AuthDatabase/PasswdFile
I think you mean by %s. Correct?
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.
Hmm. But the goal is for both POP3 and IMAP to see both namespaces. POP3 would see both via the virtual namespace. So, following the idea of passwd-file per %s, it seems like I should do something like:
.../passwd.pop3: Set the "extra fields" = userdb_namespace/virtual/inbox=yes
.../passwd.imap: Set the "extra fields" = userdb_namespace/inbox/inbox=yes
Does that make sense?
Michael
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, 29 Jul 2016, Michael Fox wrote:
you can select the passwd-file by %u , e.g. see the first example of passdb's on http://wiki2.dovecot.org/AuthDatabase/PasswdFile
I think you mean by %s. Correct?
yes, %s = %{service}
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.
Hmm. But the goal is for both POP3 and IMAP to see both namespaces. POP3 would see both via the virtual namespace. So, following the idea of passwd-file per %s, it seems like I should do something like:
.../passwd.pop3: Set the "extra fields" = userdb_namespace/virtual/inbox=yes
.../passwd.imap: Set the "extra fields" = userdb_namespace/inbox/inbox=yes
Does that make sense?
yes :-)
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBV57qe3z1H7kL/d9rAQKX0Qf+KN9L0mgDLJTB27yrtJc9XmOifXqyzUGS D49BALfSOv5aRXUoIW0Y7cRVYbcPPyeJPN5jdWeg93Hbljk8VryLh0kGGuU+y8YC fToNd/rIyBVyX0nv4a4mxhbnxdwt5isSRzpr5aXANjJsUtJaCNqg7rs3l5vnvd7q gWDiM9XkbKkxWVmwpVR5vXio8EMNNCdtNQWsdBxqqNvpHvnnOGu1NWyO20IHiK/b NdPBxBImML8oxEmEGbIsbDs8wRefjXNak5RTAfIMpuQyb/31zwSIeOHWkLCGU9EQ kLVQbl/lnbMxLcxVK37B3Q9TlbyFAWzCGf00FCZnyv0loGw2OVAV9w== =QrF6 -----END PGP SIGNATURE-----
Thanks Steffen. I'll give that a try.
I think you mean by %s. Correct?
yes, %s = %{service}
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.
Hmm. But the goal is for both POP3 and IMAP to see both namespaces. POP3 would see both via the virtual namespace. So, following the idea of passwd-file per %s, it seems like I should do something like:
.../passwd.pop3: Set the "extra fields" = userdb_namespace/virtual/inbox=yes
.../passwd.imap: Set the "extra fields" = userdb_namespace/inbox/inbox=yes
Does that make sense?
yes :-)
participants (2)
-
Michael Fox
-
Steffen Kaiser