You could try checking with gdb what the values are that are passed in the failing assert, maybe it provides clues. 

---
Aki Tuomi
Dovecot oy

-------- Original message --------
From: "Andre Hoepner - i.based: Systemhaus GmbH + Co. KG" <a.hoepner@ibased.de>
Date: 18/09/2018 19:57 (GMT+02:00)
To: dovecot@dovecot.org
Subject: Re: dovecot (2.2.13) panic on imap-login from iphone se

here is our config: (doveconf -n)

# 2.2.13: /etc/dovecot/dovecot.conf
# OS: Linux 3.6.11-gentoo x86_64 Gentoo Base System release 2.2
auth_cache_size = 10 M
auth_mechanisms = plain login
default_client_limit = 1024
default_process_limit = 256
hostname = HOSTNAME
imap_client_workarounds = delay-newmail tb-extra-mailbox-sep
info_log_path = /var/log/dovecot.log
listen = *
mail_location = maildir:~/Maildir
mail_plugins = quota acl zlib
mail_privileged_group = mail
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 ihave duplicate
namespace {
  list = yes
  location =
maildir:/home/shared/Maildir:CONTROL=~/Maildir/control/shared:INDEX=~/Maildir/index/shared
  prefix = Shared
  separator = /
  subscriptions = no
  type = public
}
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
  }
  prefix =
  separator = /
  type = private
}
passdb {
  args = *
  driver = pam
}
passdb {
  driver = passwd
}
passdb {
  driver = shadow
}
plugin {
  acl = vfile
  autocreate = Trash
  autocreate2 = Junk
  autocreate3 = Sent
  autocreate4 = Drafts
  quota = maildir:User quota
  quota_rule = *:storage=3800M
  quota_rule2 = Trash:storage=+500M
  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=85%% quota-warning 85 %u
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
}
postmaster_address = ADMIN-EMAIL
protocols = imap lmtp sieve
service auth {
  unix_listener /var/spool/postfix/private/auth {
    mode = 0666
  }
}
service imap-login {
  inet_listener imaps {
    ssl = yes
  }
}
service managesieve-login {
  inet_listener sieve {
    port = 4190
  }
}
service quota-warning {
  executable = script /usr/bin/dovecot-quota-warning.sh
  user = dovecot
}
ssl_ca = </etc/ssl/ssl.pem
ssl_cert = </etc/ssl/ssl.crt
ssl_key = </etc/ssl/ssl.key
ssl_protocols = !SSLv2 !SSLv3
userdb {
  driver = passwd
}
protocol lmtp {
  mail_fsync = optimized
}
protocol lda {
  mail_fsync = optimized
  mail_plugins = sieve quota
}
protocol imap {
  mail_plugins = quota acl zlib imap_quota imap_acl
}

##############

# doveadm user USERNAME
field value
uid 950
gid 501
home /home/USERNAME
mail maildir:~/Maildir
system_groups_user USERNAME

###############

Hope this helps.

Andre




Am 18.09.2018 um 18:49 schrieb Aki Tuomi:
> Please keep replies on list. Can you provide doveconf -n and output of
> doveadm user victim ?
>
> ---
> Aki Tuomi
> Dovecot oy
>
> -------- Original message --------
> From: "Andre Hoepner - i.based: Systemhaus GmbH + Co. KG"
> <a.hoepner@ibased.de>
> Date: 18/09/2018 19:13 (GMT+02:00)
> To: Aki Tuomi <aki.tuomi@dovecot.fi>
> Subject: Re: dovecot (2.2.13) panic on imap-login from iphone se
>
>
> Sorry. I think upgrade is not possible because it is a very outdated
> gentoo installation and im not abe to compile without compiling the
> whole source stack of glibc and all other dependencies.
>
> It is planned to replace the server in the next 8 weeks with a new
> system, but this 8 weeks the server must do the work.
>
> Andre
>
>
> Am 18.09.2018 um 17:09 schrieb Aki Tuomi:
>> Can you upgrade to 2.2.36 or 2.3.2.1 and reproduce this issue? 2.2.13 is
>> quite old.
>>
>>
>>
>> ---
>> Aki Tuomi
>> Dovecot oy
>>
>> -------- Original message --------
>> From: "Andre Hoepner - i.based: Systemhaus GmbH + Co. KG"
>> <a.hoepner@ibased.de>
>> Date: 18/09/2018 16:17 (GMT+02:00)
>> To: dovecot@dovecot.org
>> Subject: dovecot (2.2.13) panic on imap-login from iphone se
>>
>>
>> Hi to all,
>>
>> we have trouble with one user account, when using imap-login with iphone
>> se. The user can login and use the account from webmail (roundcube) and
>> from thunderbird without any errors and without any restrictions.
>>
>> But if we use the account on an iphone se and try to use imap based
>> emails, there comes the following error (look at the end of the mail).
>> I have no idea, what for an error it is. Same account on an iphone 5
>> works without any trouble.
>>
>> We have delete the homedir of the user and also recreated the user with
>> new uid and new password. Webmail and thunderbird are fine, but if we
>> use the iphone se we got this error.
>>
>> Are there any known issues with this combination?
>> Thanks for your help.
>>
>> best regardings
>> Andre Hoepner
>>
>> ---8<----
>> # HOST = hostname of the system; USER = username that gets this error
>>
>> Sep 18 12:46:02 HOST dovecot: imap(USER): Panic: file mailbox-list.c:
>> line 1125
>> (mailbox_list_try_mkdir_root): assertion failed: (strncmp(root_dir,
>> path, strlen(root_dir)) == 0)
>>
>> Sep 18 12:46:02 HOST dovecot: imap(USER): Error: Raw backtrace:
>> /usr/lib64/dovecot/libdovecot.so.0(+0x6552e) [0x7f4333e0452e]
>> -> /usr/lib64/dovecot/libdovecot.so.0(+0x65596) [0x7f4333e04596]
>> -> /usr/lib64/dovecot/libdovecot.so.0(i_fatal+0) [0x7f4333dc423e]
>> ->
>>
> /usr/lib64/dovecot/libdovecot-storage.so.0(mailbox_list_try_mkdir_root+0x469)
>> [0x7f43340d3a5a]
>> ->
>> /usr/lib64/dovecot/libdovecot-storage.so.0(mailbox_list_mkdir_root+0x15)
>> [0x7f43340d3ac0]
>> -> /usr/lib64/dovecot/libdovecot-storage.so.0(+0x570cb) [0x7f43340c40cb]
>> -> /usr/lib64/dovecot/libdovecot-storage.so.0(maildir_set_deleted+0x11a)
>> [0x7f43340c465c]
>> -> /usr/lib64/dovecot/libdovecot-storage.so.0(+0x563d5) [0x7f43340c33d5]
>> ->
>> /usr/lib64/dovecot/libdovecot-storage.so.0(maildir_uidlist_sync_init+0x33)
>> [0x7f43340c34f7]
>> -> /usr/lib64/dovecot/libdovecot-storage.so.0(+0x517ac) [0x7f43340be7ac]
>> -> /usr/lib64/dovecot/libdovecot-storage.so.0(+0x51c59) [0x7f43340bec59]
>> ->
>> /usr/lib64/dovecot/libdovecot-storage.so.0(maildir_storage_sync_init+0xb5)
>> [0x7f43340bef35]
>> -> /usr/lib64/dovecot/libdovecot-storage.so.0(mailbox_sync_init+0x2b)
>> [0x7f43340cc405]
>> -> /usr/lib64/dovecot/libdovecot-storage.so.0(mailbox_sync+0x27)
>> [0x7f43340cc4f1]
>> ->
>> /usr/lib64/dovecot/libdovecot-storage.so.0(index_storage_get_status+0x2f)
>> [0x7f43340f1f6a]
>> -> /usr/lib64/dovecot/lib01_acl_plugin.so(+0xdff9) [0x7f43335ffff9]
>> -> /usr/lib64/dovecot/libdovecot-storage.so.0(mailbox_get_status+0x31)
>> [0x7f43340cd36c]
>> -> dovecot/imap(imap_status_get+0x5f) [0x41dc1d]
>> -> dovecot/imap() [0x410cf9]
>> -> dovecot/imap(cmd_list_full+0x49d) [0x411297]
>> -> dovecot/imap(command_exec+0x37) [0x417f20]
>> -> dovecot/imap() [0x4170c9]
>> -> dovecot/imap() [0x417174]
>> -> dovecot/imap(client_handle_input+0x106) [0x417400]
>> -> dovecot/imap(client_input+0x72) [0x417768]
>> -> /usr/lib64/dovecot/libdovecot.so.0(io_loop_call_io+0x3f)
> [0x7f4333e13536]
>> -> /usr/lib64/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0xd1)
>> [0x7f4333e142e6]
>> -> /usr/lib64/dovecot/libdovecot.so.0(io_loop_handler_run+0x9)
>> [0x7f4333e13598]
>>
>> Sep 18 12:46:02 HOST dovecot: imap(USER): Fatal: master: service(imap):
>> child 32253
>> killed with signal 6 (core dumps disabled)
>> ---8<----
>
> --
>
> Sie möchten wissen, warum wir die Richtigen für Ihr
> Unternehmen sind? Lesen Sie hier ...
> http://www.11-gute-gruende.de
>
>
> i.based: Systemhaus GmbH & Co. KG
> Langenstrasse 38
> 18439 Stralsund
> Deutschland
>
> http://www.ibased.de
> a.hoepner@ibased.de
>
> fon: 03831-28944-0
> fax: 03831-28944-29
>
> Registergericht:
> HRA 2072 Amtsgericht Stralsund
>
> Geschäftsführung:
> i.based: Systemhaus Verwaltungs GmbH
>
> Steuer-Nr: 082/187/38401
> USt.-ID: DE254322988
>
> persönlich haftend:
> i.based: Systemhaus Verwaltungs-
> GmbH, Stralsund
> HRB 7189 Amtsgericht Stralsund
>
> vertreten durch:
> André Höpner, Mathias Waldeck
>
> https://www.linkedin.com/in/andre-hoepner/
> https://www.xing.com/hp/andre_hoepner

--

Sie möchten wissen, warum wir die Richtigen für Ihr
Unternehmen sind? Lesen Sie hier ...
http://www.11-gute-gruende.de


i.based: Systemhaus GmbH & Co. KG
Langenstrasse 38
18439 Stralsund
Deutschland

http://www.ibased.de
a.hoepner@ibased.de

fon: 03831-28944-0
fax: 03831-28944-29

Registergericht:
HRA 2072 Amtsgericht Stralsund

Geschäftsführung:
i.based: Systemhaus Verwaltungs GmbH

Steuer-Nr: 082/187/38401
USt.-ID: DE254322988

persönlich haftend:
i.based: Systemhaus Verwaltungs-
GmbH, Stralsund
HRB 7189 Amtsgericht Stralsund

vertreten durch:
André Höpner, Mathias Waldeck

https://www.linkedin.com/in/andre-hoepner/
https://www.xing.com/hp/andre_hoepner