Discussion:
Dovecot errors on startup
(too old to reply)
Mik J
2016-07-30 08:56:18 UTC
Permalink
Olivier Burelli
2016-07-30 12:08:06 UTC
Permalink
On Sat, 30 Jul 2016 08:56:18 +0000 (UTC)
Hello,
I'm able to start dovecot manually as a root# dovecot
But I can't using the startup script# /etc/rc.d/dovecot start
the best way is to use : rcctl start || stop dovecot

previously you have to enable it on rc : rcctl enable dovecot
I notice errorsJul 30 10:50:52 x dovecot: master: Dovecot v2.2.21 (5345f22)
starting up for imap
Too many open files
Jul 30 10:50:52 x dovecot: master: Error: service(imap-hibernate): pipe()
failed: Too many open files
Jul 30 10:50:52 x dovecot: master: Error: service(doveadm): pipe() failed: Too
many open files
Even if my login.conf is modifieddovecot:\
______________ :openfiles-cur=512:\
______________ :openfiles-max=2048:\
And I ran# cap_mkdb /etc/login.conf
I increased both values up to 8192 and it's still the same.
It's almost a fresh install, there are just 5 or 6 mails in the mailbox
Does any of you have an idea about what could be the problem and how to debug
further ?
Seems that you followed intructions from /usr/local/share/doc/pkg-readmes/dovecot-2.2.21p0

For my configuration, informations below are ok.

+-----------------------------------------------------------------------
| Running dovecot-2.2.21p0 on OpenBSD
+-----------------------------------------------------------------------

By default, the _dovecot user, and so the Dovecot processes run in
the login(1) class of "daemon". The default limits on file descriptors
are insufficient to run Dovecot; instead you should put the _dovecot
user and processes in their own login(1) class with tuned resources.

For example, add this to the login.conf(5) file:

dovecot:\
:openfiles-cur=512:\
:openfiles-max=2048:\
:tc=daemon:

Rebuild the login.conf.db file if necessary:

# [ -f /etc/login.conf.db ] && cap_mkdb /etc/login.conf
For larger servers these numbers and memory limits (e.g. datasize
and stacksize) may also need to be increased. In particular, indexing
emails for full-text search is likely to need an increased datasize.
Please report any changes and experiences to the package maintainers
so that we can update this file for future versions.

+----------------------------------------------------------------------


dovecot -n provides wich informations ?
--
regards,
Olivier
Mik J
2016-07-30 10:39:30 UTC
Permalink
Olivier Burelli
2016-07-30 14:08:25 UTC
Permalink
On Sat, 30 Jul 2016 10:39:30 +0000 (UTC)
Mik J <***@yahoo.fr> wrote:

Hello Mik J.

in first, sorry for my bad english.

Did you mix sysuser and user required to read the dedicated mount point for
virtual users (virtual mailboxes storage) ?

OpenBSD team provided the sysuser _dovecot to run the daemon.

I use on my side specific user also to read the Maildir folder in a specific
mount point : /var/vmail with user vmail
(vmail created manually : vmail:*:xxxx:xxxx:Virtual
Mail:/var/vmail:/sbin/nologin)

Only the user vmail writes on the dedicated mount point for all virtual
mailboxes.
Dovecot is running with _dovecot sys account.

May i suggest you to read in parallel : http://wiki.dovecot.org/HowTo

Mainly the section userdb configuration, where you declare the user required
to read & write the virtuals mailboxes stored.

In my case i mixed sql authentication with static userdb part.

my dovecot -n :

# 2.2.21 (5345f22): /etc/dovecot/dovecot.conf
# OS: OpenBSD 5.9 amd64 ffs
first_valid_uid = 1000
listen = *
mail_gid = vmail
mail_location = maildir:/var/vmail/%d/%n/Maildir
mail_privileged_group = vmail
mail_uid = vmail
(...)
passdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
(...)
userdb {
args = uid=vmail gid=vmail home=/var/vmail/%d/%n
driver = static
}
Thank you for your answer Olivier
As I was writting you I started to understand what could be wrong
My dovecot.conf# dovecot -n
# 2.2.21 (5345f22): /etc/dovecot/dovecot.conf
# OS: OpenBSD 5.9 amd64  ffs
mail_gid = _vmail
...
mail_uid = _vmail
I run dovecot with another user and that's why I was feeling the login.conf
parameters were not taken into account.
Do you know how my login.conf should look like if I run dovecot with the
_vmail user ?
Regards
On Sat, 30 Jul 2016 08:56:18 +0000 (UTC)
Hello,
I'm able to start dovecot manually as a root# dovecot
But I can't using the startup script# /etc/rc.d/dovecot start
the best way is to use : rcctl start || stop dovecot
previously you have to enable it on rc : rcctl enable dovecot
I notice errorsJul 30 10:50:52 x dovecot: master: Dovecot v2.2.21
(5345f22)
starting up for imap
Jul 30 10:50:52 x dovecot: master: Error: service(imap-login): pipe()
Too many open files
Jul 30 10:50:52 x dovecot: master: Error: service(imap-hibernate): pipe()
failed: Too many open files
Too
many open files
Even if my login.conf is modifieddovecot:\
______________ :openfiles-cur=512:\
______________ :openfiles-max=2048:\
And I ran# cap_mkdb /etc/login.conf
I increased both values up to 8192 and it's still the same.
It's almost a fresh install, there are just 5 or 6 mails in the mailbox
Does any of you have an idea about what could be the problem and how to
debug
further ?
Seems that you followed intructions from
/usr/local/share/doc/pkg-readmes/dovecot-2.2.21p0
For my configuration, informations below are ok.
+-----------------------------------------------------------------------
| Running dovecot-2.2.21p0 on OpenBSD
+-----------------------------------------------------------------------
By default, the _dovecot user, and so the Dovecot processes run in
the login(1) class of "daemon". The default limits on file descriptors
are insufficient to run Dovecot; instead you should put the _dovecot
user and processes in their own login(1) class with tuned resources.
      dovecot:\
                :openfiles-cur=512:\
                :openfiles-max=2048:\
        # [ -f /etc/login.conf.db ] && cap_mkdb /etc/login.conf
For larger servers these numbers and memory limits (e.g. datasize
and stacksize) may also need to be increased. In particular, indexing
emails for full-text search is likely to need an increased datasize.
Please report any changes and experiences to the package maintainers
so that we can update this file for future versions.
+----------------------------------------------------------------------
dovecot -n provides wich informations ?
--
regards,
Olivier
--
regards,
Olivier
Mik J
2016-07-30 19:19:08 UTC
Permalink
Edgar Pettijohn
2016-07-30 19:52:26 UTC
Permalink
Sent from my iPhone
Hello Olivier,
About your configuration, I don't understand why you use
"mail_privileged_group = vmail" because it's only for mailbox not for
MaildirThey say "Currently this is used only with INBOX when either its
initial creation or dotlocking fails."
Then the only difference I have is that I don't have this specific line
that
overrides the global settingsargs = uid=vmail gid=vmail
home=/var/vmail/%d/%n
Also I notice after a reboot that I have the initial problem even if I
start
dovecot from command line. Before writing the first email I had touched the
ulimit
You told me that dovecot runs with the _dovecot user, ok. Still I don't
understand why the dovecot section in the login.conf is not taken into
account
after the command[ -f /etc/login.conf.db ] && cap_mkdb /etc/login.confI
think
this is the source of my problem
Check what the class is.
# user info _dovecot

If not dovecot then change with:
# user mod -L dovecot _dovecot
Here's my dovecot config, nothing special I think
# dovecot -n
# 2.2.21 (5345f22): /etc/dovecot/dovecot.conf
# OS: OpenBSD 5.9 amd64 ffs
auth_mechanisms = cram-md5
debug_log_path = /tmp/dovecot.log
first_valid_uid = 1000
listen = *
mail_gid = _vmail
mail_location = maildir:/var/mail/vmail/%d/%n/Maildir
mail_uid = _vmail
mbox_write_locks = fcntl
mmap_disable = yes
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 =
}
passdb {
args = /etc/dovecot/dovecot.passwd
driver = passwd-file
}
protocols = imap
ssl_ca = /etc/ssl/certs/CA_Root_and_Intermediate.crt
ssl_cert = </etc/ssl/certs/server_chained.crt
ssl_key = </etc/ssl/private/server.key
ssl_key_password = # hidden, use -P to show it
ssl_protocols = !SSLv2 !SSLv3
userdb {
driver = static
}
On Sat, 30 Jul 2016 10:39:30 +0000 (UTC)
Hello Mik J.
in first, sorry for my bad english.
Did you mix sysuser and user required to read the dedicated mount point for
virtual users (virtual mailboxes storage) ?
OpenBSD team provided the sysuser _dovecot to run the daemon.
I use on my side specific user also to read the Maildir folder in a
specific
mount point : /var/vmail with user vmail
(vmail created manually : vmail:*:xxxx:xxxx:Virtual
Mail:/var/vmail:/sbin/nologin)
Only the user vmail writes on the dedicated mount point for all virtual
mailboxes.
Dovecot is running with _dovecot sys account.
May i suggest you to read in parallel : http://wiki.dovecot.org/HowTo
Mainly the section userdb configuration, where you declare the user
required
to read & write the virtuals mailboxes stored.
In my case i mixed sql authentication with static userdb part.
# 2.2.21 (5345f22): /etc/dovecot/dovecot.conf
# OS: OpenBSD 5.9 amd64 ffs
first_valid_uid = 1000
listen = *
mail_gid = vmail
mail_location = maildir:/var/vmail/%d/%n/Maildir
mail_privileged_group = vmail
mail_uid = vmail
(...)
passdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
(...)
userdb {
args = uid=vmail gid=vmail home=/var/vmail/%d/%n
driver = static
}
Thank you for your answer Olivier
As I was writting you I started to understand what could be wrong
My dovecot.conf# dovecot -n
# 2.2.21 (5345f22): /etc/dovecot/dovecot.conf
# OS: OpenBSD 5.9 amd64 ffs
mail_gid = _vmail
...
mail_uid = _vmail
I run dovecot with another user and that's why I was feeling the
login.conf
parameters were not taken into account.
Do you know how my login.conf should look like if I run dovecot with the
_vmail user ?
Regards
a
On Sat, 30 Jul 2016 08:56:18 +0000 (UTC)
Hello,
I'm able to start dovecot manually as a root# dovecot
But I can't using the startup script# /etc/rc.d/dovecot start
the best way is to use : rcctl start || stop dovecot
previously you have to enable it on rc : rcctl enable dovecot
I notice errorsJul 30 10:50:52 x dovecot: master: Dovecot v2.2.21
(5345f22)
starting up for imap
Jul 30 10:50:52 x dovecot: master: Error: service(imap-login): pipe()
Too many open files
Jul 30 10:50:52 x dovecot: master: Error: service(imap-hibernate): pipe()
failed: Too many open files
Jul 30 10:50:52 x dovecot: master: Error: service(doveadm): pipe()
Too
many open files
Even if my login.conf is modifieddovecot:\
______________ :openfiles-cur=512:\
______________ :openfiles-max=2048:\
And I ran# cap_mkdb /etc/login.conf
I increased both values up to 8192 and it's still the same.
It's almost a fresh install, there are just 5 or 6 mails in the mailbox
Does any of you have an idea about what could be the problem and how to
debug
further ?
Seems that you followed intructions from
/usr/local/share/doc/pkg-readmes/dovecot-2.2.21p0
For my configuration, informations below are ok.
+-----------------------------------------------------------------------
| Running dovecot-2.2.21p0 on OpenBSD
+-----------------------------------------------------------------------
By default, the _dovecot user, and so the Dovecot processes run in
the login(1) class of "daemon". The default limits on file descriptors
are insufficient to run Dovecot; instead you should put the _dovecot
user and processes in their own login(1) class with tuned resources.
dovecot:\
:openfiles-cur=512:\
:openfiles-max=2048:\
# [ -f /etc/login.conf.db ] && cap_mkdb /etc/login.conf
For larger servers these numbers and memory limits (e.g. datasize
and stacksize) may also need to be increased. In particular, indexing
emails for full-text search is likely to need an increased datasize.
Please report any changes and experiences to the package maintainers
so that we can update this file for future versions.
+----------------------------------------------------------------------
dovecot -n provides wich informations ?
--
regards,
Olivier
--
regards,
Olivier
Mik J
2016-07-30 20:32:24 UTC
Permalink
Loading...