Bug 225078 - mail/dovecot: update to 2.3.0
Summary: mail/dovecot: update to 2.3.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Larry Rosenman
URL:
Keywords:
: 227919 (view as bug list)
Depends on:
Blocks: 225079
  Show dependency treegraph
 
Reported: 2018-01-11 18:58 UTC by Piotr Kubaj
Modified: 2020-04-12 21:36 UTC (History)
13 users (show)

See Also:
bugzilla: maintainer-feedback? (ler)


Attachments
patch (10.34 KB, patch)
2018-01-11 18:58 UTC, Piotr Kubaj
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer freebsd_triage 2018-01-11 18:58:58 UTC
Created attachment 189626 [details]
patch

This patch updates Dovecot to 2.3.0. It builds on 10.3-RELEASE and 11.1-STABLE and runs on 11.1-STABLE (I didn't test 10.x for running).

I tested build with all options enabled and all disabled. It also builds on Poudriere.

There's one problem, when starting Dovecot there is an error:
doveconf: Error: t_readlink(/var/run/dovecot/dovecot.conf) failed: readlink() failed: No such file or directory                                                                                                                                                               

It doesn't actually do anything, Dovecot starts just fine and works. I couldn't trace this error, but I guess it's OK.
Comment 1 Adam Weinberger freebsd_committer freebsd_triage 2018-01-11 19:31:18 UTC
Hi Piotr. Thank you for submitting this!

I'm closing out this PR because there's a lot of work already underway to upgrade Dovecot. It fixes the error you've identified as well. There are a number of other FreeBSD breakages in 2.3, most of which are already fixed upstream. At this point I think I'm going to wait for 2.3.1 before I commit it to ports.
Comment 2 pvoigt 2018-04-07 17:01:34 UTC
I am running latest mail/dovecot-2.3.1_1 on 11.1-RELEASE-p9 (amd64). I still get the following error message when dovecot ist started for the first time:

doveconf: Error: t_readlink(/var/run/dovecot/dovecot.conf) failed: readlink() failed: No such file or directory

On subsequent restarts this error does not occur.

In spite of the above error dovecot works as expected.
Comment 3 Adam Weinberger freebsd_committer freebsd_triage 2018-04-07 18:00:16 UTC
(In reply to pvoigt from comment #2)
Can you verify that /var/run/dovecot/dovecot.conf is symlinked correctly to the real dovecot.conf?
Comment 4 Marek 2018-04-07 22:49:38 UTC
(In reply to Adam Weinberger from comment #3)

Same here... FreeBSD 11.1-RELEASE-p9 (amd64)
Durin Dovecot startup this ocuurs:

----
Apr  8 00:39:26 mail dovecot: master: Dovecot v2.3.1 (8e2f634) starting up for pop3
Apr  8 00:39:26 mail kernel: doveconf: Error: t_readlink(/var/run/dovecot/dovecot.conf) failed: readlink() failed: No such file or directory
Apr  8 00:39:26 mail kernel: Starting dovecot.
---

Everything works ok, but this error...
Here's some ls:

# ls -las /var/run/dovecot | grep ot.conf
0 lrwx------   1 root     wheel       35 Apr  8 00:39 dovecot.conf -> /usr/local/etc/dovecot/dovecot.conf

so yes, it's correctly symlinked :)
Comment 5 pvoigt 2018-04-10 09:25:46 UTC
Sorry for late response. Either email notification did not work or I have missed it. Here is my dovecot.conf:

# dir /var/run/dovecot/dovecot.conf 
lrwx------ 1 root wheel 35 Apr  7 00:38 /var/run/dovecot/dovecot.conf -> /usr/local/etc/dovecot/dovecot.conf

But as already mentioned the described error only occurs on first start of dovecot. Subsequent start look fine.
Comment 6 Adam Weinberger freebsd_committer freebsd_triage 2018-04-11 03:12:39 UTC
Just to clarify here, does this occur only the first time you spin up dovecot after upgrading, or every time you spin up dovecot?
Comment 7 pvoigt 2018-04-11 05:05:37 UTC
(In reply to Adam Weinberger from comment #6)
You're right, I must be more precise: I have been observing that dovecot shows this error on my machines on every first spin up after a reboot.
Comment 8 William Elasio Moreno Albarracin 2018-04-13 07:48:27 UTC
Problem:
doveconf: Error: t_readlink(/var/run/dovecot/dovecot.conf) failed: readlink() failed: No such file or directory
Cause:
Unknown
Description:
This issue arised when upgrade dovecot to version 2.3
Detail:
This occurs only at start up the system, after upgrading dovecot to 2.3, then all OK with dovecot, restart normal, no fails.
Support:
root@server:~ # uname -a
FreeBSD myserver.domain 11.1-RELEASE-p6 FreeBSD 11.1-RELEASE-p6 #3: Wed Feb 14 05:28:12 -05 2018     root@myserver.domain:/usr/obj/usr/src/sys/TCPOPEN  amd64
root@server:~ # service dovecot restart
Stopping dovecot.
Waiting for PIDS: 1630.
Starting dovecot.
root@server:~ # dmesg -a | grep dovecot
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/dovecot /usr/local/lib/gcc6 /usr/local/lib/graphviz /usr/local/lib/heimdal /usr/local/lib/mysql /usr/local/lib/mysql/plugin /usr/local/lib/nss /usr/local/lib/perl5/5.26/mach/CORE /usr/local/lib/qt5 /usr/local/libexec/openldap /usr/local/llvm50/lib
doveconf: Error: t_readlink(/var/run/dovecot/dovecot.conf) failed: readlink() failed: No such file or directory
Starting dovecot.
root@server:~ # pkg info | grep dovecot
dovecot-2.3.1_1                Secure, fast and powerful IMAP and POP3 server.

This problem continues in my system. Why it appears here as: "Status:	Closed FIXED" ?
Comment 9 Adam Weinberger freebsd_committer freebsd_triage 2018-04-13 12:47:43 UTC
I'm at a bit of a loss why this is happening. I don't get this behaviour on my box.

The very first time after upgrading, that message is unavoidable. The /var/run/dovecot/dovecot.conf symlink always got removed by etc/rc.d/dovecot for 2.2.x, but 2.3.x needs it to exist on startup.

The rc.d/dovecot script for 2.3.1 should be leaving that file alone. Can one of you please issue 'service dovecot stop', and then 'ls -lasF /var/run/dovecot'? I'm wondering whether that symlink is actually getting deleted when dovecot is stopped, instead of sticking around.
Comment 10 William Elasio Moreno Albarracin 2018-04-13 14:21:55 UTC
You request:
"
root@server:~ # service dovecot stop
Stopping dovecot.
Waiting for PIDS: 4126.
root@server:~ # ls -lasF /var/run/dovecot
total 8
4 drwxr-xr-x   2 root  wheel  1024 Apr 13 09:16 ./
4 drwxr-xr-x  13 root  wheel  1024 Apr 13 03:17 ../
0 lrwx------   1 root  wheel    35 Apr 13 02:40 dovecot.conf@ -> /usr/local/etc/dovecot/dovecot.conf
"
Comment 11 pvoigt 2018-04-13 15:20:45 UTC
(In reply to Adam Weinberger from comment #9)

Directly after a reboot:

# ls -lasF /var/run/dovecot
total 9K
1K drwxr-xr-x  2 root wheel  2 Apr 13 17:13 ./
9K drwxr-xr-x 16 root wheel 38 Apr 13 17:13 ../

Then the first spin up with the know error message:
# service dovecot start
doveconf: Error: t_readlink(/var/run/dovecot/dovecot.conf) failed: readlink() failed: No such file or directory

And after a subsequent spin down:
# service dovecot stop
# ls -lasF /var/run/dovecot
total 10K
1K drwxr-xr-x  2 root wheel  3 Apr 13 17:19 ./
9K drwxr-xr-x 16 root wheel 44 Apr 13 17:16 ../
1K lrwx------  1 root wheel 35 Apr 13 17:16 dovecot.conf -> /usr/local/etc/dovecot/dovecot.conf
Comment 12 Adam Weinberger freebsd_committer freebsd_triage 2018-04-13 15:56:27 UTC
Ahh, I see what's going on. It's getting removed from /etc/rc.d/cleanvar.

Can you try putting 
   [ -L ${base_dir}/dovecot.conf ] || ln -sf ${config} ${base_dir}/dovecot.conf

after line 63?
Comment 13 William Elasio Moreno Albarracin 2018-04-13 17:25:43 UTC
I did this:

"
        fi
   [ -L ${base_dir}/dovecot.conf ] || ln -sf ${config} ${base_dir}/dovecot.conf
        if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then
"

But negative, still the issue at startup
Comment 14 Alexey 2018-04-16 08:22:43 UTC
I confirm the words of previous speakers. This error message appears after the system reboots. No errors appear after restarting only dovecot. I saw this error after upgrading to dovecot-2.3.1_1, but after updating to version 2.3.1 I didn't reboot my system.

11.1-RELEASE-p9 FreeBSD 11.1-RELEASE-p9
Comment 15 Christos Chatzaras 2018-04-16 14:54:29 UTC
It happens with dovecot-2.3.1 too.
Comment 16 Hasse 2018-04-25 13:32:16 UTC
Persists in 2.3.1_2

dovecot --version
2.3.1 (8e2f634)
hasse@ymer:~ % pkg info |grep "dovecot"
dovecot-2.3.1_2                Secure, fast and powerful IMAP and POP3 server
Comment 17 Adam Weinberger freebsd_committer freebsd_triage 2018-04-25 21:37:02 UTC
Sorry, I should have commented on here sooner. It's definitely a bug, I am aware of the behaviour, and I don't have a fix right now. I can't work on this much until the second week of May. I welcome patches in the meantime.
Comment 18 pvoigt 2018-04-25 22:27:48 UTC
(In reply to Adam Weinberger from comment #17)
Thanks, Adam, for this status message. Please let us know, when we can start testing again.
Comment 19 Adam Weinberger freebsd_committer freebsd_triage 2018-05-02 11:48:59 UTC
*** Bug 227919 has been marked as a duplicate of this bug. ***
Comment 20 Adam Weinberger freebsd_committer freebsd_triage 2018-05-18 15:25:09 UTC
Over to new maintainer
Comment 21 Larry Rosenman freebsd_committer freebsd_triage 2018-07-15 02:27:44 UTC
Is this still happening with 2.3.2?
Comment 22 Rys Sommefeldt 2018-08-19 18:22:43 UTC
(In reply to Larry Rosenman from comment #21)
Yes, it is for me, running 11.2-RELEASE and Dovecot 2.3.2 (582970113)
Comment 23 Larry Rosenman freebsd_committer freebsd_triage 2018-08-19 18:38:48 UTC
looks like /etc/rc.d/cleanvar was changed in 11-STABLE by:
revision 332038 by kevans, Wed Apr 4 17:00:18 2018 UTC

to NOT remove symlinks. 

I think this is a better solution than working around it in the dovecot start script. 

Can you update to past this revision, or pull this version of /etc/rc.d/cleanvar from svn?

Thanks!
Comment 25 commit-hook freebsd_committer freebsd_triage 2018-08-19 21:00:24 UTC
A commit references this bug:

Author: ler
Date: Sun Aug 19 21:00:19 UTC 2018
New revision: 477601
URL: https://svnweb.freebsd.org/changeset/ports/477601

Log:
  mail/dovecot, mail/dovecot22: suppress harmless error message when the symlink in /var/run/dovecot
  to the config file doesn't exist.

  PR:		225078
  Reported by:	pkubaj@anongoth.pl
  Reviewed by:	adamw
  MFH:		2018Q3

Changes:
  head/mail/dovecot/Makefile
  head/mail/dovecot/files/dovecot.in
  head/mail/dovecot22/Makefile
  head/mail/dovecot22/files/dovecot.in
Comment 26 Larry Rosenman freebsd_committer freebsd_triage 2018-08-19 21:03:41 UTC
I've committed a "fix" to suppress this (harmless) error message. 

The reason for the message is the dovecot binary tries to access that symlink, even when the full config path is passed to the binary.
Comment 27 commit-hook freebsd_committer freebsd_triage 2018-08-20 13:26:57 UTC
A commit references this bug:

Author: ler
Date: Mon Aug 20 13:26:10 UTC 2018
New revision: 477651
URL: https://svnweb.freebsd.org/changeset/ports/477651

Log:
  MFH: r474275 r477601

  mail/dovecot: upgrade to 2.3.2.1.
  v2.3.2 still had a few unexpected bugs:

  - SSL/TLS servers may have crashed during client disconnection
  - lmtp: With lmtp_rcpt_check_quota=yes mail deliveries may have
     sometimes assert-crashed.
  - v2.3.2: "make check" may have crashed with 32bit systems

  mail/dovecot, mail/dovecot22: suppress harmless error message when the symlink in /var/run/dovecot
  to the config file doesn't exist.

  PR:		225078
  Reported by:	pkubaj@anongoth.pl
  Reviewed by:	adamw

  Approved by:	ports-secteam (miwi)

Changes:
_U  branches/2018Q3/
  branches/2018Q3/mail/dovecot/Makefile
  branches/2018Q3/mail/dovecot/distinfo
  branches/2018Q3/mail/dovecot/files/dovecot.in
  branches/2018Q3/mail/dovecot22/Makefile
  branches/2018Q3/mail/dovecot22/files/dovecot.in