imap & pop3 using same mailbox with virtual plugin

Michael Fox
Tue, 26 Jul 2016 04:55:20 -0000

This is a noobie question, so bear with me if it's not worded correctly:

Primary Requirements:
1)  I'd like to have two namespaces - one private/per-user, and one public
(visible by all logged-in users).
The public mailbox would be used to distribute information to all users.

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 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)


I don't really understand the example MySQL code (too much "..."
for me to
follow) in the above web pages.  As I understand it (and I could be very
wrong), the solution relies on a MySQL query to determine which namespace
should have inbox = yes -- the private namespace or the virtual namespace --
depending on if the user is an imap or pop3 user, respectively.

Question 1:  How would this be done on a user-by-user basis if the userdb is
a passwd-file flat file?  Would it be something like this?
-- Userdb extra fields for IMAP User: userdb_namespace/inbox/inbox=yes
-- Userdb extra fields for POP3 User: userdb_namespace/virtual/inbox=yes

Question 2:  If I want to allow any user to use either POP3 or IMAP, then
could I do it this way?

protocol imap {
  namespace inbox {
    inbox = yes
  }
}
protocol pop3 {
  namespace virtual {
    inbox = yes
  }
}

Thanks,
Michael