dsync to backup to directory?

2019-05-08 Thread Felipe Gasper via dovecot
Hello,

We have a hosting operation and are interested in offloading mail for 
some of our machines to a separate machine.

We want the ability, though, to migrate accounts between the 
“offloaded” and “unified” configurations.

Toward that end, is it possible to “merge” two different mail 
directories (either maildir or mdbox) via doveadm? “doveadm backup” looks like 
the closest match, but it doesn’t appear to accept an arbitrary directory as 
its synchronization source.

Thank you!

-Felipe Gasper
Mississauga, Ontario

How to auto-subscribe to virtual namespace/prefix?

2019-05-08 Thread MRob via dovecot

In virtual namespace I can have:

namespace myvirt {
  location = blah
  prefix=Virtual/
  separator=/

  mailbox "My folder" {
auto = subscribe
  }
}

And i see email clients successful display subscribed "My folder" but 
the top-level prefix "Virtual/" is not subscribed. I see the Virtual/ 
prefix available as a noselect folder in the list of unsubscribed 
folders and if I manual subscribe to it, folder tree display is perfect.


So how can i also make auto-subscription to the "Virtual/" prefix 
noselect folder?


Re: How to auto-subscribe to virtual namespace/prefix?

2019-05-08 Thread MRob via dovecot
FYI in subscription file for namespace I see empty line when the top 
level prefix is subscribed. Works perfectly just need to make it 
automatic



On 2019-05-08 20:50, MRob via dovecot wrote:

In virtual namespace I can have:

namespace myvirt {
  location = blah
  prefix=Virtual/
  separator=/

  mailbox "My folder" {
auto = subscribe
  }
}

And i see email clients successful display subscribed "My folder" but
the top-level prefix "Virtual/" is not subscribed. I see the Virtual/
prefix available as a noselect folder in the list of unsubscribed
folders and if I manual subscribe to it, folder tree display is
perfect.

So how can i also make auto-subscription to the "Virtual/" prefix
noselect folder?


Re: How to auto-subscribe to virtual namespace/prefix?

2019-05-08 Thread MRob via dovecot

one solution that work is put a mailbox into the parent namespace like:
mailbox "Virtual/" {
  auto = subscribe
}
nothing in the "namespace myvirt" would work.


On 2019-05-08 21:02, MRob via dovecot wrote:

FYI in subscription file for namespace I see empty line when the top
level prefix is subscribed. Works perfectly just need to make it
automatic


On 2019-05-08 20:50, MRob via dovecot wrote:

In virtual namespace I can have:

namespace myvirt {
  location = blah
  prefix=Virtual/
  separator=/

  mailbox "My folder" {
auto = subscribe
  }
}

And i see email clients successful display subscribed "My folder" but
the top-level prefix "Virtual/" is not subscribed. I see the Virtual/
prefix available as a noselect folder in the list of unsubscribed
folders and if I manual subscribe to it, folder tree display is
perfect.

So how can i also make auto-subscription to the "Virtual/" prefix
noselect folder?


UID to file?

2019-05-08 Thread Carles Pina i Estany via dovecot


Hello,

In the past I was in a situation that given an email UID I wanted to
know which file in the Maildir directory this UID was saved.

I did a small parser for $HOME/Maildir/dovecot-uidlist where, if the
file had:

1000 W1838 S1796 :1557351041.10447_1.example

I would ask for the UID 1000 and would return
:1557351041.10447_1.example (and I knew that it was in
$HOME/Maildir/new)

Is there any other way using dovecot tools to do the same, to avoid
parsing an internal dovecot file?

Thank you!

-- 
Carles Pina i Estany
GPG Key 0x8CD5C157


dict lookup too long time

2019-05-08 Thread hfh--- via dovecot
hi,

The following error message sometimes appears on my server log,it causes the 
mailbox to exceed the disk capacity limit.

May  9 09:54:11 imap dovecot: imap(h...@cndns.com): Error: dict-client: Lookup 
'priv/quota/storage' failed: Connection closed: read(size=8192) failed: 
Connection reset by peer (reply took 2.728 secs (2.729 in dict wait, 0.000 in 
other ioloops, 0.000 in locks))

dovecot -n

# 2.2.36 (1f10bfa63): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.24 (124e06aa)
# OS: Linux 2.6.32-504.el6.x86_64 x86_64 CentOS release 6.6 (Final) 
# Hostname: imap3bak.sh.chengmail.me
auth_master_user_separator = *
auth_mechanisms = PLAIN LOGIN
deliver_log_format = msgid=%m, subject=%s, from=%f, %$
dict {
  acl = mysql:/etc/dovecot/dovecot-share-folder.conf
  quotadict = mysql:/etc/dovecot/dovecot-used-quota.conf
}
disable_plaintext_auth = no
first_valid_uid = 2000
last_valid_uid = 2000
listen = *
mail_fsync = never
mail_gid = 2000
mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/
mail_plugins = quota lazy_expunge zlib
mail_uid = 2000
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 extracttext
mmap_disable = yes
namespace {
  list = children
  location = maildir:/%%Lh/Maildir/:INDEX=/%%Lh/Maildir/Shared/%%u
  prefix = Shared/%%u/
  separator = /
  subscriptions = yes
  type = shared
}
namespace {
  hidden = yes
  list = no
  location = maildir:/var/vmail/backup/expunged/%d/%n
  prefix = .DELETED/
  separator = /
}
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
auto = subscribe
special_use = \Drafts
  }
  mailbox Junk {
auto = subscribe
special_use = \Junk
  }
  mailbox Sent {
auto = subscribe
special_use = \Sent
  }
  mailbox Trash {
auto = subscribe
special_use = \Trash
  }
  prefix = 
  separator = /
}
passdb {
  args = /etc/dovecot/dovecot-mysql.conf
  driver = sql
}
passdb {
  args = /etc/dovecot/dovecot-fallback-password-mysql.conf
  driver = sql
}
passdb {
  args = /etc/dovecot/dovecot-fallback-mysql.conf
  driver = sql
}
passdb {
  args = /etc/dovecot/dovecot-master-users-password
  driver = passwd-file
  master = yes
}
plugin {
  acl = vfile:/etc/dovecot/dovecot-acl
  acl_globals_only = yes
  auth_socket_path = /var/run/dovecot/auth-master
  lazy_expunge = .DELETED/
  quota = dict:user::proxy::quotadict
  quota_grace = 0%%
  quota_max_mail_size = 70M
  quota_rule = *:storage=1G
  quota_rule2 = *:messages=0
  quota_warning = storage=85%% quota-warning 85 %u
  quota_warning2 = storage=90%% quota-warning 90 %u
  quota_warning3 = storage=95%% quota-warning 95 %u
  sieve = /%Lh/sieve/dovecot.sieve
  sieve_default = /var/vmail/sieve/dovecot.sieve
  sieve_default_name = managesieve
  sieve_dir = /%Lh/sieve
}
protocols = pop3 imap sieve
service anvil {
  client_limit = 20500
}
service auth {
  client_limit = 20500
  unix_listener /var/spool/postfix/dovecot-auth {
group = postfix
mode = 0666
user = postfix
  }
  unix_listener auth-master {
group = vmail
mode = 0666
user = vmail
  }
  unix_listener auth-userdb {
group = vmail
mode = 0660
user = vmail
  }
}
service dict {
  unix_listener dict {
group = vmail
mode = 0660
user = vmail
  }
}
service imap-login {
  process_min_avail = 24
  service_count = 0
  vsz_limit = 2 G
}
service imap {
  process_limit = 1024000
  process_min_avail = 24
  vsz_limit = 2 G
}
service pop3-login {
  service_count = 0
}
service quota-warning {
  executable = script /usr/local/bin/dovecot-quota-warning.sh
  unix_listener quota-warning {
group = vmail
mode = 0660
user = vmail
  }
}
ssl_ca = 

Dovecot does not recognize imported messages

2019-05-08 Thread lty via dovecot
 

Today I tried to import mail directly on the server's home directory on
the server. I copied it directly. I didn't use the imap protocol. Dovcot
didn't recognize these emails. I didn't display these imported emails on
my page, recalculating disk quotas. It will not increase the used
capacity. I try to send an email to this user, dovcot recognizes all the
emails, and recalculates the disk cooperation, this time is correct.
Why can't I identify the mail I imported? 

> [root@imap2 ~]# dovecot -n
> # 2.2.36 (1f10bfa63): /etc/dovecot/dovecot.conf
> # Pigeonhole version 0.4.24 (124e06aa)
> # OS: Linux 2.6.32-431.el6.x86_64 x86_64 CentOS release 6.5 (Final) 
> # Hostname: imap
> auth_master_user_separator = *
> auth_mechanisms = PLAIN LOGIN
> default_internal_user = vmail
> default_vsz_limit = 2 G
> deliver_log_format = msgid=%m, subject=%s, from=%f, %$
> dict {
> acl = mysql:/etc/dovecot/dovecot-share-folder.conf
> quotadict = mysql:/etc/dovecot/dovecot-used-quota.conf
> }
> disable_plaintext_auth = no
> first_valid_uid = 2000
> last_valid_uid = 2000
> listen = *
> mail_fsync = never
> mail_gid = 2000
> mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/
> mail_plugins = quota lazy_expunge zlib fts fts_solr
> mail_uid = 2000
> maildir_stat_dirs = yes
> 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 extracttext
> mmap_disable = yes
> namespace {
> list = children
> location = maildir:/%%Lh/Maildir/:INDEX=/%%Lh/Maildir/Shared/%%u
> prefix = Shared/%%u/
> separator = /
> subscriptions = yes
> type = shared
> }
> namespace {
> hidden = yes
> list = no
> location = maildir:/var/vmail/backup/expunged/%d/%n
> prefix = .DELETED/
> separator = /
> }
> namespace inbox {
> inbox = yes
> location = 
> mailbox Drafts {
> auto = subscribe
> special_use = Drafts
> }
> mailbox Junk {
> auto = subscribe
> special_use = Junk
> }
> mailbox Sent {
> auto = subscribe
> special_use = Sent
> }
> mailbox Trash {
> auto = subscribe
> special_use = Trash
> }
> prefix = 
> separator = /
> }
> passdb {
> args = /etc/dovecot/dovecot-mysql.conf
> driver = sql
> }
> passdb {
> args = /etc/dovecot/dovecot-fallback-password-mysql.conf
> driver = sql
> }
> passdb {
> args = /etc/dovecot/dovecot-fallback-mysql.conf
> driver = sql
> }
> passdb {
> args = /etc/dovecot/dovecot-master-users-password
> driver = passwd-file
> master = yes
> }
> plugin {
> acl = vfile:/etc/dovecot/dovecot-acl
> acl_globals_only = yes
> auth_socket_path = /var/run/dovecot/auth-master
> fts_autoindex_exclude = Junk
> fts_autoindex_exclude2 = Trash
> fts_autoindex_exclude3 = Sent
> fts_autoindex_exclude4 = Drafts
> fts_autoindex_max_recent_msgs = 20
> lazy_expunge = .DELETED/
> mail_replica = tcp:10.0.11.152:
> quota = dict:user::proxy::quotadict
> quota_grace = 0%%
> quota_max_mail_size = 70M
> quota_rule = *:storage=1G
> quota_rule2 = *:messages=0
> quota_warning = storage=85%% quota-warning 85 %u
> quota_warning2 = storage=90%% quota-warning 90 %u
> quota_warning3 = storage=95%% quota-warning 95 %u
> sieve = /%Lh/sieve/dovecot.sieve
> sieve_default = /var/vmail/sieve/dovecot.sieve
> sieve_default_name = managesieve
> sieve_dir = /%Lh/sieve
> }
> protocols = pop3 imap sieve
> service anvil {
> client_limit = 20500
> }
> service auth {
> client_limit = 20500
> unix_listener /var/spool/postfix/private/auth {
> group = postfix
> mode = 0666
> user = postfix
> }
> unix_listener auth-master {
> group = vmail
> mode = 0666
> user = vmail
> }
> unix_listener auth-userdb {
> group = vmail
> mode = 0660
> user = vmail
> }
> }
> service dict {
> unix_listener dict {
> group = vmail
> mode = 0660
> user = vmail
> }
> }
> service imap-login {
> process_min_avail = 24
> service_count = 0
> vsz_limit = 2 G
> }
> service imap {
> process_limit = 1024000
> process_min_avail = 24
> vsz_limit = 2 G
> }
> service pop3-login {
> service_count = 0
> }
> service quota-warning {
> executable = script /usr/local/bin/dovecot-quota-warning.sh
> unix_listener quota-warning {
> group = vmail
> mode = 0660
> user = vmail
> }
> }
> ssl_ca =  ssl_cert =  ssl_key = # hidden, use -P to show it
> syslog_facility = local6
> userdb {
> args = /etc/dovecot/dovecot-mysql.conf
> driver = sql
> }
> userdb {
> args = /etc/dovecot/dovecot-fallback-user-mysql.conf
> driver = sql
> }
> protocol lda {
> auth_socket_path = /var/run/dovecot/auth-master
> lda_mailbox_autocreate = yes
> mail_fsync = optimized
> mail_plugins = quota lazy_expunge zlib fts fts_solr sieve
> syslog_facility = local6
> }
> protocol imap {
> imap_client_workarounds = tb-extra-mailbox-sep
> imap_id_send = NAME dovecot VERSION 2.1.17
> mail_max_userip_connections = 20
> mail_plugins = quota lazy_expunge zlib fts fts_solr imap_quota mail_log 
> imap_zlib notify
> }
> protocol pop3 {

Re: Dovecot does not recognize imported messages

2019-05-08 Thread Aki Tuomi via dovecot
Did you put it under cur/ or new/ directory?

Aki

> On 8 May 2019 12:54 lty via dovecot  wrote:
> 
> 
>  
> Today I tried to import mail directly on the server's home directory on the 
> server. I copied it directly. I didn't use the imap protocol. Dovcot didn't 
> recognize these emails. I didn't display these imported emails on my page, 
> recalculating disk quotas. It will not increase the used capacity. I try to 
> send an email to this user, dovcot recognizes all the emails, and 
> recalculates the disk cooperation, this time is correct.
> Why can't I identify the mail I imported?
>  
>  
>  
> > [root@imap2 ~]# dovecot -n
> > # 2.2.36 (1f10bfa63): /etc/dovecot/dovecot.conf
> > # Pigeonhole version 0.4.24 (124e06aa)
> > # OS: Linux 2.6.32-431.el6.x86_64 x86_64 CentOS release 6.5 (Final) 
> > # Hostname: imap
> > auth_master_user_separator = *
> > auth_mechanisms = PLAIN LOGIN
> > default_internal_user = vmail
> > default_vsz_limit = 2 G
> > deliver_log_format = msgid=%m, subject=%s, from=%f, %$
> > dict {
> >  acl = mysql:/etc/dovecot/dovecot-share-folder.conf
> >  quotadict = mysql:/etc/dovecot/dovecot-used-quota.conf
> > }
> > disable_plaintext_auth = no
> > first_valid_uid = 2000
> > last_valid_uid = 2000
> > listen = *
> > mail_fsync = never
> > mail_gid = 2000
> > mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/
> > mail_plugins = quota lazy_expunge zlib fts fts_solr
> > mail_uid = 2000
> > maildir_stat_dirs = yes
> > 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 extracttext
> > mmap_disable = yes
> > namespace {
> >  list = children
> >  location = maildir:/%%Lh/Maildir/:INDEX=/%%Lh/Maildir/Shared/%%u
> >  prefix = Shared/%%u/
> >  separator = /
> >  subscriptions = yes
> >  type = shared
> > }
> > namespace {
> >  hidden = yes
> >  list = no
> >  location = maildir:/var/vmail/backup/expunged/%d/%n
> >  prefix = .DELETED/
> >  separator = /
> > }
> > namespace inbox {
> >  inbox = yes
> >  location = 
> >  mailbox Drafts {
> >  auto = subscribe
> >  special_use = \Drafts
> >  }
> >  mailbox Junk {
> >  auto = subscribe
> >  special_use = \Junk
> >  }
> >  mailbox Sent {
> >  auto = subscribe
> >  special_use = \Sent
> >  }
> >  mailbox Trash {
> >  auto = subscribe
> >  special_use = \Trash
> >  }
> >  prefix = 
> >  separator = /
> > }
> > passdb {
> >  args = /etc/dovecot/dovecot-mysql.conf
> >  driver = sql
> > }
> > passdb {
> >  args = /etc/dovecot/dovecot-fallback-password-mysql.conf
> >  driver = sql
> > }
> > passdb {
> >  args = /etc/dovecot/dovecot-fallback-mysql.conf
> >  driver = sql
> > }
> > passdb {
> >  args = /etc/dovecot/dovecot-master-users-password
> >  driver = passwd-file
> >  master = yes
> > }
> > plugin {
> >  acl = vfile:/etc/dovecot/dovecot-acl
> >  acl_globals_only = yes
> >  auth_socket_path = /var/run/dovecot/auth-master
> >  fts_autoindex_exclude = \Junk
> >  fts_autoindex_exclude2 = \Trash
> >  fts_autoindex_exclude3 = \Sent
> >  fts_autoindex_exclude4 = \Drafts
> >  fts_autoindex_max_recent_msgs = 20
> >  lazy_expunge = .DELETED/
> >  mail_replica = tcp:10.0.11.152:
> >  quota = dict:user::proxy::quotadict
> >  quota_grace = 0%%
> >  quota_max_mail_size = 70M
> >  quota_rule = *:storage=1G
> >  quota_rule2 = *:messages=0
> >  quota_warning = storage=85%% quota-warning 85 %u
> >  quota_warning2 = storage=90%% quota-warning 90 %u
> >  quota_warning3 = storage=95%% quota-warning 95 %u
> >  sieve = /%Lh/sieve/dovecot.sieve
> >  sieve_default = /var/vmail/sieve/dovecot.sieve
> >  sieve_default_name = managesieve
> >  sieve_dir = /%Lh/sieve
> > }
> > protocols = pop3 imap sieve
> > service anvil {
> >  client_limit = 20500
> > }
> > service auth {
> >  client_limit = 20500
> >  unix_listener /var/spool/postfix/private/auth {
> >  group = postfix
> >  mode = 0666
> >  user = postfix
> >  }
> >  unix_listener auth-master {
> >  group = vmail
> >  mode = 0666
> >  user = vmail
> >  }
> >  unix_listener auth-userdb {
> >  group = vmail
> >  mode = 0660
> >  user = vmail
> >  }
> > }
> > service dict {
> >  unix_listener dict {
> >  group = vmail
> >  mode = 0660
> >  user = vmail
> >  }
> > }
> > service imap-login {
> >  process_min_avail = 24
> >  service_count = 0
> >  vsz_limit = 2 G
> > }
> > service imap {
> >  process_limit = 1024000
> >  process_min_avail = 24
> >  vsz_limit = 2 G
> > }
> > service pop3-login {
> >  service_count = 0
> > }
> > service quota-warning {
> >  executable = script /usr/local/bin/dovecot-quota-warning.sh
> >  unix_listener quota-warning {
> >  group = vmail
> >  mode = 0660
> >  user = vmail
> >  }
> > }
> > ssl_ca =  > ssl_cert =  > ssl_key = # hidden, use -P to show it
> > syslog_facility = local6
> > userdb {
> >  args = /etc/dovecot/dovecot-mysql.conf
> >  driver 

Dovecot not surviving OpenLDAP restart

2019-05-08 Thread Dag Nygren via dovecot




Hi!

Running Dovecot 2.2.36 and authenticating against
an OpenLDAP 2.4.45 server.

Now since some update of dovecot it will not be able to authenticate
your logins after a restart of the LDAP service is restarted
without a reboot of the dovecot server.

Anything new here that I should be aware of?

Best Regards
Dag



Re: Dovecot does not recognize imported messages

2019-05-08 Thread lty via dovecot
 

I put it in the cur/ directory. 

Re: Dovecot not surviving OpenLDAP restart

2019-05-08 Thread A. Schulze via dovecot



Am 08.05.19 um 15:32 schrieb Dag Nygren via dovecot:
> Now since some update of dovecot it will not be able to authenticate
> your logins after a restart of the LDAP service is restarted
> without a reboot of the dovecot server.

Hello,

This sounds more like a configuration glitch.
Could you show the ldap related dovecot configuration?

Logs with failure message will also be helpful.

Andreas