[Dovecot] dovecot 1.2 virtual folders question
Hi Timo
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/ with content something like that
- -Trash -Trash/* -Sent -Sent/* -Drafts -Drafts/* all
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 }
namespace private { prefix = virtual/ separator = / location = virtual:/usr/local/virtual/%d/%u:LAYOUT=maildir++ inbox = no }
it doesnt work yet, but i am nearly sure that i havent understand http://wiki.dovecot.org/Plugins/Virtual
perhaps you might bring me on the way
background : i want to include a global sieve rule which sorts marked spam mails in a subfolder of inbox called Junk, so that users never can overide it and set perhaps an autoreply by an Sieve rule by incomming mail to inbox
to make it possible that pop3 users may fetch sorted Spam mails outta the Junk folder too, i wanna use virtual setup folders
Trash , Sent , Drafts are standart folders are standart and should be ignored with that
-- Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
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
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 }
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.
}
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
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'
-- Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
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
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
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 }
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.
this does not work
--log namespace configuration error: Empty prefix requires list=yes
}
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
-- Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
Hi Timo,
whenever i use * or in INBOX in dovecot-virtual
like
/etc/dovecot/virtual/dovecot-virtual/INBOX * Junk
or
INBOX Junk
i get a Virtual mailbox loops: INBOX
it works nice with i.e. Junk only
with namespaces
namespace private { separator = / prefix = "" location = maildir:/usr/local/virtual/%d/%u/:CONTROL=/usr/local/virtual/%d/%u/:INDEX=/usr/local/virtual/%d/%u/ :INBOX=/usr/local/virtual/%d/%u/ inbox = no subscriptions = yes list = yes }
namespace private { prefix = virtual/ separator = / location = virtual:/etc/dovecot/virtual/:INDEX=/usr/local/virtual/%d/virtual/%u/ inbox = yes list = yes }
any idea ?, i saw an option http://wiki.dovecot.org/Plugins/Virtual?highlight=(virtual) using maildir layout :LAYOUT=maildir++
but i cant fix it with that, running in other problems
Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
On Sun, 2009-02-01 at 08:50 +0100, Robert Schetterer wrote:
/etc/dovecot/virtual/dovecot-virtual/INBOX * Junk
or
INBOX Junk
i get a Virtual mailbox loops: INBOX
This is because INBOX points to the virtual INBOX, which is itself.
with namespaces
namespace private { separator = / prefix = "" location = maildir:/usr/local/virtual/%d/%u/:CONTROL=/usr/local/virtual/%d/%u/:INDEX=/usr/local/virtual/%d/%u/ :INBOX=/usr/local/virtual/%d/%u/ inbox = no subscriptions = yes list = yes }
This configuration wouldn't give the error message. My guess is that you're overriding this configuration from userdb. You could set mail_debug=yes to make it log the exact namespace configuration Dovecot is seeing.
On Fri, 2009-02-20 at 18:32 -0500, Timo Sirainen wrote:
namespace private { separator = / prefix = "" location = maildir:/usr/local/virtual/%d/%u/:CONTROL=/usr/local/virtual/%d/%u/:INDEX=/usr/local/virtual/%d/%u/ :INBOX=/usr/local/virtual/%d/%u/ inbox = no subscriptions = yes list = yes }
This configuration wouldn't give the error message. My guess is that you're overriding this configuration from userdb. You could set mail_debug=yes to make it log the exact namespace configuration Dovecot is seeing.
No, sorry, I wasn't thinking right. This namespace has inbox=no and the virtual namespace has inbox=yes. That's why it gives the error.
http://wiki.dovecot.org/Plugins/Virtual now has a hopefully working example of how it should be set up.
Timo Sirainen schrieb:
http://wiki.dovecot.org/Plugins/Virtual now has a hopefully working example of how it should be set up.
thx for looking at it, i ll try again but i think you re right in general about userdb settings overide, but i have mine in mysql so i have to have a hard look at it as well as the virtual setup should be only for pop3 users which i also might set somehow in mysql or per login scripting
-- Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
Robert Schetterer schrieb:
Timo Sirainen schrieb:
http://wiki.dovecot.org/Plugins/Virtual now has a hopefully working example of how it should be set up.
thx for looking at it, i ll try again but i think you re right in general about userdb settings overide, but i have mine in mysql so i have to have a hard look at it as well as the virtual setup should be only for pop3 users which i also might set somehow in mysql or per login scripting
Timo , youre great the examples are fully fitting to my needs so i will try and report
-- Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
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
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 }
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.
this does not work
--log namespace configuration error: Empty prefix requires list=yes
}
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
Hi Tim, is there something new about virtual plugin ? cant get it to work as described, list no is not possible, and rules dont work either cause * means i.e INBOX which cant be found until its maildir ( speculate ) or it gets to loop
-- Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
participants (2)
-
Robert Schetterer
-
Timo Sirainen