Re: shared folders not working with . separator

2016-02-17 Thread Christian Kivalo

On 2016-02-17 18:23, Hugh Bragg wrote:

Hi,

I've been trying this for weeks and never managed to get my mail client
to see shared folders.
Apparently imap_acl works fine as I can see these entries in the
dovecot-acl-list files and the correct entries persist in the client.
This is my first dovecot setup so I hope I've configured it right.
Everything else works beautifully, thanks.

What client do you use?

Are there folders shared from user1 to user2?

what does dovecadm acl get -u  -m shared..mailbox show?

doveadm debug -u user2 -m shared..mailbox

Whats in your logs? Enable debug log and look for errors.


# dovecot -n
# 2.2.21 (5345f22): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.11 (6ddf62b87f60+)
# OS: Linux 4.3.5-300.fc23.x86_64 x86_64 Fedora release 23 (Twenty 
Three)

auth_mechanisms = plain login
auth_socket_path = /var/run/dovecot/auth-userdb
imap_client_workarounds = tb-extra-mailbox-sep
listen = *
log_path = /var/log/dovecot.log
mail_access_groups = mail, vmail
mail_home = /var/mail/vmail/%d/%n
mail_location = maildir:~/mail
mail_plugins = virtual, acl
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope
encoded-character vacation subaddress comparator-i;ascii-numeric
relational regex imap4flags copy include variables body enotify
environment mailbox date index ihave duplicate mime foreverypart
mbox_write_locks = fcntl
namespace {
  location = virtual:/var/mail/vhosts/%d/%n/virtual
  prefix = virtual.
  separator = .
}
namespace {
  list = children
  location =
maildir:/var/mail/vhosts/%%d/%%n/mail:INDEX=/var/mail/vhosts/%d/%n/shared/%%u:CONTROL=/var/mail/vhosts/%d/%n/shared/%%u
  prefix = shared.%%u.
  separator = .
  subscriptions = yes
  type = shared
}


According to http://wiki2.dovecot.org/SharedMailboxes/Shared the "list = 
Children" hides the namespace from the imap list command, if there is no 
folder shared to the user. Try to set list = yes that should show the 
shared namespace in the imap list.


Also scroll down to shared mailbox listing, you should setup a dict so 
that dovecot knows which folders are shared.

namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
special_use = \Drafts
  }
  mailbox Junk {
special_use = \Junk
  }
  mailbox Sent {
special_use = \Sent
  }
  mailbox "Sent Messages" {
special_use = \Sent
  }
  mailbox Trash {
special_use = \Trash
  }
  mailbox virtual/All {
comment = All my messages
special_use = \All
  }
  mailbox virtual/Flagged {
comment = All my flagged messages
special_use = \Flagged
  }
I have my virtual mailboxes configuration in the virtual namespace { } 
section, not in the general inbox namespace.

  prefix =
}
passdb {
  args = scheme=PLAIN username_format=%u /etc/dovecot/dovecot-users
  driver = passwd-file
}
plugin {
  acl = vfile
  acl_shared_dict = file:/var/mail/vhosts/shared-mailboxes.db
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
  sieve_global_dir = /var/mail/vhosts/sieve-global
}
protocols = imap lmtp sieve
service auth-worker {
  user = vmail
}
service auth {
  unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
  }
  unix_listener auth-userdb {
group = vmail
mode = 0660
user = vmail
  }
}
service imap-login {
  inet_listener imap {
port = 143
  }
  inet_listener imaps {
port = 0
ssl = yes
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0600
user = postfix
  }
}
service managesieve-login {
  inet_listener sieve {
port = 4190
  }
}
service pop3-login {
  inet_listener pop3 {
port = 0
  }
  inet_listener pop3s {
port = 0
  }
}
ssl = required
ssl_cert = 

--
 Christian Kivalo


Re: shared folders not working with . separator

2016-02-17 Thread Hugh Bragg
On 18/02/2016 1:45 PM, Hugh Bragg wrote:
> On 18/02/2016 5:22 AM, Chris wrote:
>> Hugh Bragg wrote:
>>> I've been trying this for weeks and never managed to get my mail client
>>> to see shared folders.
>>> Apparently imap_acl works fine as I can see these entries in the
>>> dovecot-acl-list files and the correct entries persist in the client.
>>> This is my first dovecot setup so I hope I've configured it right.
>>> Everything else works beautifully, thanks.
>> Are they shown with telnet? e.g.
>>
>> http://www.anta.net/misc/telnet-troubleshooting/imap.shtml
> Absolutely nothing for shared only the usual. Very frustrating.
Nothing listed for shared with doveadm either:
doveadm mailbox list -u

Should I file a bug report?


Re: shared folders not working with . separator

2016-02-17 Thread Hugh Bragg
On 18/02/2016 5:22 AM, Chris wrote:
> Hugh Bragg wrote:
>> I've been trying this for weeks and never managed to get my mail client
>> to see shared folders.
>> Apparently imap_acl works fine as I can see these entries in the
>> dovecot-acl-list files and the correct entries persist in the client.
>> This is my first dovecot setup so I hope I've configured it right.
>> Everything else works beautifully, thanks.
> Are they shown with telnet? e.g.
>
> http://www.anta.net/misc/telnet-troubleshooting/imap.shtml
Absolutely nothing for shared only the usual. Very frustrating.


Re: dovecot Digest, Vol 154, Issue 14

2016-02-17 Thread Richard Platel
Thanks, Hajo

This mostly works, but we can’t seem to send an arbitrary mailbox name with 
UserDB, we have to initialize it in the config:

"namespace/inbox/mailbox=Junk namespace/inbox/mailbox/Junk/name"="Spam"
seems to initialize the folder somehow so that the subsequent
"namespace/inbox/mailbox/Junk/auto"="subscribe"
and
"namespace/inbox/mailbox/Junk/special_use"="\Junk"
have something to act upon.

(the first line doesn't work quite properly, however - it ends up
causing a folder named "" to show up)

we've noticed that if we set a very minimal config for the mailbox in
the main config (that wouldn't cause the mailbox to be autocreated),
that this also initializes the folder name allowing for subsequent auto
and subscribe directives to be processed for it:
namespace inbox {
 inbox = yes
 mailbox "Spam" {
   auto = no
 }
}

is there some userdb response that will simply initialize the folder
(without doing any name remapping) in the same way that the above config
lines do?

we have tried a few things based off Hajo's first line, but nothing we
guess at seems to do the trick. ie:
"namespace/inbox/mailbox"="Spam"
"namespace/inbox/mailbox=Spam"=“Spam"

> 
> --
> 
> Message: 2
> Date: Tue, 9 Feb 2016 23:33:53 +0100
> From: Hajo Locke 
> To: dovecot@dovecot.org
> Subject: Re: Per-user special folder?
> Message-ID: <56ba6951.8010...@gmx.de>
> Content-Type: text/plain; charset=windows-1252; format=flowed
> 
> Hello,
> 
> Am 09.02.2016 um 22:28 schrieb Richard Platel:
>> Hi
>> 
>> It's possible to mark some folders as special use for IMAP in the config 
>> like:
>> 
>> namespace inbox {
>>   mailbox Spam {
>> special_use = \Junk
>>   }
>> }
>> 
>> 
>> Our webmail allows users to use an arbitrary folder for Spam, and we have 
>> this settings and we'd like to return it in from our UserDB (which is a 
>> custom dict proxy).
>> 
>> For testing were able to set a namespace parameter like "separator" by 
>> returning:
>> "namespace/inbox/separator" : "=",
>> 
>> from UserDB, but can't figure out a way to set mailbox settings,
>> 
>> "namespace/inbox/mailbox Spam/special_use" : "\Junk", for example doesn't 
>> work.
>> 
>> Is there a way to return this setting from a UserDB query?
>> 
> we use this a lot with userdb to allow individual folders marked as special.
> your userbd-query should return something like this:
> 
> namespace/inbox/mailbox=Junk namespace/inbox/mailbox/Junk/name=Spam 
> namespace/inbox/mailbox/Junk/auto=subscribe 
> namespace/inbox/mailbox/Junk/special_use=\Junk
> Spam is visible name in this case.
> 
> Hajo


Re: edit ACL files

2016-02-17 Thread Robert Schetterer
Am 17.02.2016 um 20:09 schrieb Chris:
> Dear All,
> 
> is it possible to edit ACL files regularly with an editor or is there any
> reason to use doveadm?
> 
> - Chris
> 

webmailers have acl imap guis , such as Horde/imp

you can also use Thunderbird

https://addons.mozilla.org/de/thunderbird/addon/imap-acl-extension/

doveadm is a multi admin tool for dovecot which covers many complex tasks


Best Regards
MfG Robert Schetterer

-- 
[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein


Re: shared folders not working with . separator

2016-02-17 Thread Chris
Hugh Bragg wrote:
> I've been trying this for weeks and never managed to get my mail client
> to see shared folders.
> Apparently imap_acl works fine as I can see these entries in the
> dovecot-acl-list files and the correct entries persist in the client.
> This is my first dovecot setup so I hope I've configured it right.
> Everything else works beautifully, thanks.

Are they shown with telnet? e.g.

http://www.anta.net/misc/telnet-troubleshooting/imap.shtml


Re: doveadm backup to local drive

2016-02-17 Thread Terry Barnum

> On Feb 15, 2016, at 11:43 AM, Terry Barnum  wrote:
> 
> I'm trying to get doveadm to backup all users to a local drive without any 
> luck.
> 
> $ sudo doveadm backup -A /Volumes/mail_bak/mailstore_backup/
> Error: User listing returned failure
> doveadm: Error: Failed to iterate through some users
> 
> The doveadm-backup man page has the instruction to make sure the iterate 
> query matches the database layout but I'm not sure what that means.
> 
> If the user_query in dovecot-sql.conf.ext looks like this, what should the 
> iterate_query look like?
> 
> user_query = \
>  SELECT '/opt/local/virtual/%d/%n/mail' as home, \
>  'maildir:/opt/local/virtual/%d/%n/mail' as mail, 501 as uid, \
>  501 as gid, concat("*:storage=", quota) AS quota \
>  FROM mailbox WHERE username = "%u" AND active = "1"
> 
> # Query to get a list of all usernames.
> iterate_query = SELECT username AS user FROM users

I didn't see my original email show up on the mailing list so I'm resending. To 
recap, is it possible to backup all users to a local drive with doveadm?

Thanks,
-Terry

Terry Barnum
digital OutPost
Carlsbad, CA

http://www.dop.com
800/464-6434


Dovecot IMAP permissions issue (see original)

2016-02-17 Thread Steve Cole

/ >/What purpose does vpopmail serve that dovecot alone does not? Isn't it

just an ancient leftover from historic qmail times?


qmail and vpopmail are still quite prominent on the Internet.  I see no reason 
to change my setup at the moment.  Possibly I could re-architect to read user 
info directly from mysql but that would not help with the fact that dovecot 
then likely read or write as the wrong userid on the system (since mailboxes 
are virtual).

Have recreated the same issue (sans mysql) on another vpopmail system.

Regardless, it is a bug.

From my process list:

25813 vpopmail  20   0   26468   4984   4016 R   0.7  0.0   0:00.02 imap
26730 vpopmail  20   0   28332   5940   4212 S   0.7  0.0   0:00.06 imap

For certain, imap being ANY other user than root means that the 
/var/run/dovecot/imap-* sockets would be unwritable.


shared folders not working with . separator

2016-02-17 Thread Hugh Bragg
Hi,

I've been trying this for weeks and never managed to get my mail client
to see shared folders.
Apparently imap_acl works fine as I can see these entries in the
dovecot-acl-list files and the correct entries persist in the client.
This is my first dovecot setup so I hope I've configured it right.
Everything else works beautifully, thanks.

# dovecot -n
# 2.2.21 (5345f22): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.11 (6ddf62b87f60+)
# OS: Linux 4.3.5-300.fc23.x86_64 x86_64 Fedora release 23 (Twenty Three)
auth_mechanisms = plain login
auth_socket_path = /var/run/dovecot/auth-userdb
imap_client_workarounds = tb-extra-mailbox-sep
listen = *
log_path = /var/log/dovecot.log
mail_access_groups = mail, vmail
mail_home = /var/mail/vmail/%d/%n
mail_location = maildir:~/mail
mail_plugins = virtual, acl
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope
encoded-character vacation subaddress comparator-i;ascii-numeric
relational regex imap4flags copy include variables body enotify
environment mailbox date index ihave duplicate mime foreverypart
mbox_write_locks = fcntl
namespace {
  location = virtual:/var/mail/vhosts/%d/%n/virtual
  prefix = virtual.
  separator = .
}
namespace {
  list = children
  location =
maildir:/var/mail/vhosts/%%d/%%n/mail:INDEX=/var/mail/vhosts/%d/%n/shared/%%u:CONTROL=/var/mail/vhosts/%d/%n/shared/%%u
  prefix = shared.%%u.
  separator = .
  subscriptions = yes
  type = shared
}
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
special_use = \Drafts
  }
  mailbox Junk {
special_use = \Junk
  }
  mailbox Sent {
special_use = \Sent
  }
  mailbox "Sent Messages" {
special_use = \Sent
  }
  mailbox Trash {
special_use = \Trash
  }
  mailbox virtual/All {
comment = All my messages
special_use = \All
  }
  mailbox virtual/Flagged {
comment = All my flagged messages
special_use = \Flagged
  }
  prefix =
}
passdb {
  args = scheme=PLAIN username_format=%u /etc/dovecot/dovecot-users
  driver = passwd-file
}
plugin {
  acl = vfile
  acl_shared_dict = file:/var/mail/vhosts/shared-mailboxes.db
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
  sieve_global_dir = /var/mail/vhosts/sieve-global
}
protocols = imap lmtp sieve
service auth-worker {
  user = vmail
}
service auth {
  unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
  }
  unix_listener auth-userdb {
group = vmail
mode = 0660
user = vmail
  }
}
service imap-login {
  inet_listener imap {
port = 143
  }
  inet_listener imaps {
port = 0
ssl = yes
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0600
user = postfix
  }
}
service managesieve-login {
  inet_listener sieve {
port = 4190
  }
}
service pop3-login {
  inet_listener pop3 {
port = 0
  }
  inet_listener pop3s {
port = 0
  }
}
ssl = required
ssl_cert = 

Re: How to understand NFS lookup (requests) spike?

2016-02-17 Thread Mark Moseley
On Wed, Feb 17, 2016 at 12:49 AM, Alessio Cecchi  wrote:

> Hi, I'm are running a classic Dovecot setup:
>
> About ten thousand connected users
> mailbox in Maildir format shared via NFS (NetApp)
> Director for POP/IMAP
> Delivery via Dovecot LDA
>
> All works fine but sometimes I see a spike on the load of POP/IMAP servers
> and high disk usage (close to 100%) on NFS NetApp.
>
> When this happens on NFS stats (of POP/IMAP) I can see an high volume of
> "lookup, remove, rename" requests.
>
> Example (avg is during normal load, max is request number during the
> spike):
>
> Lookup avg 100 max 700
> Remove avg 50 max 300
> Rename avg 50 max 300
> Getattr avg 200 max 250
> Total NFS avg 600 max 1800
>
> I think that some users are doing some kinds of "intensive" operations on
> their mailbox but what and who?
>
> I am currently using "iotop" to monitor the activity of individual users
> but I can't figure out who is causing the high number of I/O requests.
>
>
>
One suggestions is that I'd walk those directories and see if someone has a
mailbox with 100k files in it.


How to understand NFS lookup (requests) spike?

2016-02-17 Thread Alessio Cecchi

Hi, I'm are running a classic Dovecot setup:

About ten thousand connected users
mailbox in Maildir format shared via NFS (NetApp)
Director for POP/IMAP
Delivery via Dovecot LDA

All works fine but sometimes I see a spike on the load of POP/IMAP 
servers and high disk usage (close to 100%) on NFS NetApp.


When this happens on NFS stats (of POP/IMAP) I can see an high volume of 
"lookup, remove, rename" requests.


Example (avg is during normal load, max is request number during the spike):

Lookup avg 100 max 700
Remove avg 50 max 300
Rename avg 50 max 300
Getattr avg 200 max 250
Total NFS avg 600 max 1800

I think that some users are doing some kinds of "intensive" operations 
on their mailbox but what and who?


I am currently using "iotop" to monitor the activity of individual users 
but I can't figure out who is causing the high number of I/O requests.


Have you any suggestions?
Thanks
--
Alessio Cecchi
Postmaster @ http://www.qboxmail.it
https://www.linkedin.com/in/alessice