[Dovecot] dovecot 1.2 virtual folders question rules like RestrictAccess ?

Robert Schetterer robert at schetterer.org
Wed Jan 28 16:26:05 EET 2009


Robert Schetterer schrieb:
> Hi Timo
> 
> Timo Sirainen schrieb:
>> On Jan 26, 2009, at 7:45 PM, Robert Schetterer wrote:
>>
>>> is this possible a possible setup ?
>>> for downloading imap folders ( including inbox )
>>> with pop3 controlled by a a dovecot-virtual file
>>> in usr/local/virtual/%d/%u/
>> Place that in to e.g.: /etc/dovecot/virtual/INBOX
> 
> Ahhh understand, done *g
>>> namespace private {
>>>  prefix = virtual/
>>>  separator = /
>>>  location = virtual:/usr/local/virtual/%d/%u:LAYOUT=maildir++
>>> inbox = no
>>> }
>> For pop3 to use virtual mailbox you must use something like:
>>
>> namespace private {
>>   prefix = virtual/
>>   separator = /
>>   location = virtual:/etc/dovecot/virtual:INDEX=~/virtual
>>   subscriptions = no
>> }
> 
> Ok done understand
>>> namespace private {
>>> separator = /
>>> prefix = ""
>>> location=maildir:/usr/local/virtual/%d/%u/:CONTROL=/usr/local/virtual/%d/%u/:INDEX=/usr/local/virtual/%d/%u/
>>>
>>> inbox = yes
>>> subscriptions = yes
>>> list = yes
>> list = no here.
> 
> done
> 
>>> }
>>
>> Then depending on if user is logging in with imap or pop3, set inbox=yes
>> to one of those namespaces. What userdb are you using? You'll anyway
> 
>> need to return something like namespace_0_inbox=yes or ..1.._inbox=yes
> 
> i am not clear here, you mean i have to change inbox=yes
> in namespace depend on pop3 or imap login?
> so this means some split at login process by script etc?
> like i.e.
> http://wiki.dovecot.org/PostLoginScripting?highlight=(login)
> 
> i use sql backend, and have no fields relate to imap or
> pop3
> 
> like this
> 
> driver = mysql
> connect = host=localhost dbname=... user=... password=...
> default_pass_scheme = PLAIN
> 
> password_query = \
>    SELECT password \
>    FROM mailbox WHERE username = '%u' AND active = '1'
> 
> user_query = SELECT concat('/usr/local/virtual/', maildir) AS home, \
> concat('*:bytes=', mailbox.quota) AS quota_rule, \
> #when saving to Trash mailbox the user gets additional 50MB
> "Trash:storage=50240" AS quota_rule2, \
> #when saving to Sent mailbox the user gets additional 50MB
> "Sent:storage=50240" AS quota_rule3, \
> #when saving to Drafts mailbox the user gets additional 50MB
> "Drafts:storage=50240" AS quota_rule4, \
> #when saving to Templates mailbox the user gets additional 50MB
> "Templates:storage=50240" AS quota_rule5, \
> #when saving to Junk mailbox the user gets additional 50MB
> "Junk:storage=50240" AS quota_rule6, \
> #ignore quota on shared
> #"shared:ignore" AS quota_rule7, \
> concat('maildir:/usr/local/virtual/', maildir) AS mail, \
> 1001 AS uid, 1001 AS gid  FROM mailbox WHERE username = '%u' AND active
> = '1'
> 
> 

Hi Timo, after study

http://wiki.dovecot.org/Authentication/RestrictAccess

it should be possible
to include
namespace_0_inbox=yes or ..1.._inbox=yes
to a sql query

i.e ( sorry i am not good in sql so this is just a stupid non working
example to show what i mean )


 password_query = \
   SELECT password \
   FROM mailbox WHERE username = '%u' AND active = '1' \
   CASE '%Ls' = 'pop3' THEN namespace_1_inbox=yes


whats your meaning with this, would dovecot understand changing
inbox=yes depend by login type ( pop3/imap ) this way?

-- 
Best Regards

MfG Robert Schetterer

Germany/Munich/Bavaria


More information about the dovecot mailing list