Bug 286695 - [new ports] mail/dovecot24, mail/dovecot24-pigeonhole
Summary: [new ports] mail/dovecot24, mail/dovecot24-pigeonhole
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:
: 294269 297760 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-05-09 13:23 UTC by Ian Dickens
Modified: 2026-08-30 01:03 UTC (History)
28 users (show)

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


Attachments
Screenshot 1 (148.51 KB, application/octet-stream)
2025-05-09 14:14 UTC, Ian Dickens
no flags Details
Screenshot2.1 (72.54 KB, image/jpeg)
2025-05-09 14:18 UTC, Ian Dickens
no flags Details
new port: mail/dovecot24 (43.88 KB, patch)
2025-05-21 13:24 UTC, Sebastian Oswald
no flags Details | Diff
diff dovecot -> dovecot24 (21.10 KB, text/plain)
2025-05-21 13:26 UTC, Sebastian Oswald
no flags Details
mail/dovecot24-pigeonhole: add new port (15.51 KB, patch)
2025-07-22 13:47 UTC, Sebastian Oswald
no flags Details | Diff
mail/dovecot24 refined (45.50 KB, application/octet-stream)
2025-07-22 19:51 UTC, Eugene R
no flags Details
new port: mail/dovecot24 in git diff format (40.15 KB, patch)
2026-06-05 10:31 UTC, Mark Linimon
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 (40.07 KB, patch)
2026-06-19 12:22 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24-pigeonhole creation with ver 2.4.4 (14.30 KB, patch)
2026-06-19 12:24 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 (39.05 KB, patch)
2026-06-19 18:43 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 (39.05 KB, patch)
2026-06-20 12:06 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24-pigeonhole creation with ver 2.4.4 (11.49 KB, patch)
2026-06-20 12:06 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24-pigeonhole creation with ver 2.4.4 (12.31 KB, patch)
2026-06-20 20:48 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 (39.05 KB, patch)
2026-06-20 20:59 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24-pigeonhole creation with ver 2.4.4 (12.91 KB, patch)
2026-06-21 13:37 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24-pigeonhole creation with ver 2.4.4 (9.79 KB, patch)
2026-06-21 14:25 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 (39.45 KB, patch)
2026-06-21 17:32 UTC, Herbert J. Skuhra
no flags Details | Diff
mail/dovecot24-pigeonhole creation with ver 2.4.4 with ldap fixes (9.78 KB, patch)
2026-06-21 21:24 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24-pigeonhole creation with ver 2.4.4 with ldap fixes (9.78 KB, patch)
2026-06-21 21:56 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 with ldap fixes (39.26 KB, patch)
2026-06-21 21:57 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 with ldap fixes (39.29 KB, patch)
2026-06-21 22:31 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 (40.36 KB, patch)
2026-06-22 13:35 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 v5 (40.76 KB, patch)
2026-06-22 18:16 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 v5 (40.92 KB, patch)
2026-06-22 19:32 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 v6 (40.99 KB, patch)
2026-06-22 21:26 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 v6 (41.24 KB, patch)
2026-06-23 14:19 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 v6 (41.36 KB, patch)
2026-06-23 14:28 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 v7 (41.05 KB, patch)
2026-06-24 10:18 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 v8 (44.89 KB, patch)
2026-06-25 20:20 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 v9 (44.89 KB, patch)
2026-06-27 20:35 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24-pigeonhole creation with ver 2.4.4 v4 (9.78 KB, patch)
2026-06-27 20:36 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 v10 (44.86 KB, patch)
2026-07-06 09:42 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24-pigeonhole creation with ver 2.4.4 v5 (9.57 KB, patch)
2026-07-06 09:43 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 v11 (46.40 KB, patch)
2026-07-18 12:30 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 v12 (47.24 KB, patch)
2026-07-18 21:06 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 v13 (47.21 KB, patch)
2026-07-19 09:22 UTC, Jordan Ostreff
jordan: maintainer-approval+
Details | Diff
mail/dovecot24-pigeonhole creation with ver 2.4.4 v6 (9.74 KB, patch)
2026-07-31 17:12 UTC, Jordan Ostreff
jordan: maintainer-approval+
Details | Diff
mail/dovecot24-pigeonhole creation with ver 2.4.4 v14 (44.34 KB, patch)
2026-08-05 22:23 UTC, Jordan Ostreff
no flags Details | Diff
mail/dovecot24 creation with ver 2.4.4 v14 (44.34 KB, patch)
2026-08-06 10:45 UTC, Jordan Ostreff
jordan: maintainer-approval+
Details | Diff
mail/dovecot24-wormhole (5.26 KB, patch)
2026-08-17 13:37 UTC, Michael Grimm
no flags Details | Diff
mail/dovecot24 fix LUA pkg-plist (4.47 KB, patch)
2026-08-21 10:18 UTC, Jordan Ostreff
jordan: maintainer-approval+
Details | Diff
mail/dovecot24 fix LUA pkg-plist (4.64 KB, patch)
2026-08-21 10:26 UTC, Jordan Ostreff
jordan: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Dickens 2025-05-09 13:23:53 UTC
Is there any chance of getting version 2.4.x available instead of 2.3x ?

https://www.dovecot.org/download/

Thanks,

Ian
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2025-05-09 13:36:07 UTC
^Triage: fix Summary and assign.
Comment 2 Ian Dickens 2025-05-09 14:06:45 UTC
(In reply to Mark Linimon from comment #1)
Thank you in advance
Comment 3 Ian Dickens 2025-05-09 14:07:52 UTC
(In reply to Mark Linimon from comment #1)
Tenable is always reporting a medium vulnerability with 2.3

Ian
Comment 4 Ian Dickens 2025-05-09 14:14:25 UTC
Created attachment 260293 [details]
Screenshot 1

I'll convert this to jpeg in a second
Comment 5 Ian Dickens 2025-05-09 14:18:19 UTC
Created attachment 260294 [details]
Screenshot2.1
Comment 6 Sebastian Oswald 2025-05-21 06:48:20 UTC
Dovecot 2.4 introduces a new config file syntax, which *will* break existing installations [1]. However, 2.3.x will still receive security patches [2], hence I propose to create a new port for dovecot 2.4 (e.g. 'mail/dovecot24') to not break existing installations.

We could add an informal message to pkg-descr about the new port and the required configuration changes by linking to [1].


[1] https://doc.dovecot.org/main/installation/upgrade/2.3-to-2.4.html
[2] https://dovecot.org/mailman3/archives/list/dovecot@dovecot.org/thread/3P45L76DOC3NKUNSSPIXQNKINGOCYH5K/
Comment 7 Michael Grimm 2025-05-21 07:00:59 UTC
+1 in keeping old dovecot23 for the time being

I do like the replication functionality, thus will stay at dovecot23

BUT: 
I'd opt for upgrading mail/dovecot to 24, and kee a mail/dovecot23, instead. That will be better for a future dovecot25 version ;-)
Comment 8 Sebastian Oswald 2025-05-21 13:23:44 UTC
(In reply to Michael Grimm from comment #7)

This would still break existing installations.

We could follow other ports where version updates need user intervention (and intention!) due to breakage, e.g. like with postgresql, python or php and add the version as flavours. OTOH - dovecot has a rather sane release cycle of several years with 2.3 being around since 2018. So this might be overkill.
Introducing new versions with a suffix (24, 25) and converting 'mail/dovecot' to a meta-port/package *after* 2.3 is EOL and gone might be the cleanest and most straightforward way to keep it future-proof and not immediately break every mailserver.


Anyways, to provide some actual code to the PR I tried to get 2.4 built. The diff is a very crude first attempt to 'just get it to build and run' with the default build options (plus PGSQL), so I'm sure there are still a lot of loose ends, especially when it comes to functionality provided by plugins that have been removed/replaced. 

The basic config file that is being installed works OOTB to start the service, however ALL example configuration known from earlier versions is gone. It seems they now only refer to the online documentation, but no longer provide example configuration with the tarball/source.

I also haven't updated anything in the pkg-message, pkg-descr or other documentation yet.
Comment 9 Sebastian Oswald 2025-05-21 13:24:58 UTC
Created attachment 260601 [details]
new port: mail/dovecot24

diff to add dovecot 2.4 as a new port
Comment 10 Sebastian Oswald 2025-05-21 13:26:27 UTC
Created attachment 260602 [details]
diff dovecot -> dovecot24

actual diff from mail/dovecot to mail/dovecot24 for comparison
Comment 11 Ian Dickens 2025-05-21 13:39:29 UTC
I agree that moving it all forward to 2.4 will be hard but I'd be willing to suffer that pain to eliminate the medium finding given it's an exposed port (even if geo-ip filtered along with fail2ban).  I dunno, maybe I'm over thinking it but I have to believe it's going to bite us in the long run.

$.02

Ian
Comment 12 Sebastian Oswald 2025-05-21 14:14:12 UTC
I think there was some misunderstanding. Just to clarify: I'm not proposing that the actual service/binary/etc should be renamed 'dovecot24'; only the PORTNAME and PKGNAME.
Just like with other ports where multiple versions are in the wild (e.g. postgresql, zabbix, openbgpd...) and the pkg/port name adds the version suffix, yet the actual binaries/service name etc don't.
Comment 13 Ian Dickens 2025-05-21 14:25:30 UTC
I actually meant network port not FBSD port.
Comment 14 Eugene R 2025-07-21 19:18:20 UTC
Any chance of getting this into the ports tree? 
Meanwhile, can I just duplicate mail/dovecot directory and apply the patch?
Also, what about dovecot-pigeonhole ?
Comment 15 Eugene R 2025-07-21 21:48:06 UTC
Among the old patches in the "files" directory, apparently only patch-src_plugins_fts_decode2text.sh is still relevant
Comment 16 Sebastian Oswald 2025-07-22 13:47:06 UTC
Created attachment 262342 [details]
mail/dovecot24-pigeonhole: add new port

(In reply to Eugene R from comment #14)
Regarding dovecot-pigeonhole: I wasn't able to get it to build because of various bugs if built without ldap:
--- sieve-ldap-storage.lo ---
sieve-ldap-storage.c:6:10: fatal error: 'ldap-utils.h' file not found
    6 | #include "ldap-utils.h"
      |          ^~~~~~~~~~~~~~
1 error generated.
*** [sieve-ldap-storage.lo] Error code 1

this header file is part of dovecot24 *if* it were built with LDAP; building pigeonhole with LDAP disabled (--with-ldap=no) still fails because it tries to include that header. This turned out it was a bug, so I tried the patch (https://github.com/dovecot/pigeonhole/commit/b37322a8d338bf999bc9774154dce79c4857d622.patch) from this bugreport: https://dovecot.org/mailman3/archives/list/dovecot@dovecot.org/thread/S3ME4NFBRWU4EAOQRCMYG4MFD42ZVXYR/
but even then it still fails with a linker error because it still tries to include some ldap-specific files:
ld: error: unable to find library -ldovecot-ldap
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [libdovecot-sieve.la] Error code 1

There have been various patches regarding LDAP since v2.4.1, but I didn't have the time to sift through all of them to try which subset of them leads to a buildable variant of pigeonhole.
If someone wants to deal with that mess, I've attached a patch for port 'www/dovecot24-pigeonhole' which I copied/adapted from the existing www/dovecot-pigeonhole port and contains the patch from the aforementioned bugreport.


(In reply to Eugene R from comment #15)
The upstream version is still the same (2.4.1), so I don't see why they should be obsolete?
In fact, glancing over the commits since 2.4.1 (https://github.com/dovecot/core/compare/release-2.4.1...main) and the ammount (and nature) of crashes and memory leaks that were fixed since release 2.4.1, this port needs _A LOT_ more patches - or one should wait for the next release.
TBH with bugs like "crashing when reloading config and logging to syslog", "memory leak when failing to connect to anvil" or "crash when trying to give multiple username parameters" and the cadence with which such bugs appear, I wouldn't want this anywhere near a production mailserver in its current state...
I'd give it at least another year until they have sorted out the worst bugs (and CVEs) and then give it another look.

However, anyone is welcome to use those patches and continue work from there and if I have some spare time available I'll be happy to help with testing.
Comment 17 Eugene R 2025-07-22 19:51:39 UTC
Created attachment 262349 [details]
mail/dovecot24 refined

Refined dovecot24 port, builds and compiles cleanly on FreeBSD 14.3
Comment 18 Eugene R 2025-07-22 20:02:26 UTC
I have uploaded the refined dovecot24 port. It now builds and compiles cleanly on FreeBSD 14.3. Major changes:
- Removed patches from 2.3 that are obsolete or no longer relevant for 2.4 (bugs already fixed in upstream, Lucene support removed).
- Handles installing dovecot.conf and dovecot.conf.sample correctly
- Small fixes in pkg-plist (imap-hibernate not working on FreeBSD)
- Updated pkg-message

However, based on your report, I think I also will wait at least for 2.4.2 or 2.4.3 before switching )) Not sure I have time for handling all those patches in dovecot and pigeonhole
Comment 19 Eugene R 2025-07-22 20:04:47 UTC
Oops, s/builds and compiles/builds and installs/ )))
Pity bugzilla comments can't be edited (
Comment 20 Herbert J. Skuhra 2025-10-29 08:46:43 UTC
Dovecot 2.4.2 is out with a security fix.
And there is now a plugin for replication support:
https://codeberg.org/errror/wormhole
Comment 21 Philip Jocks freebsd_committer freebsd_triage 2025-10-29 08:55:09 UTC
(In reply to Herbert J. Skuhra from comment #20)
https://www.wiz.io/vulnerability-database/cve/cve-2025-30189 says
...
The vulnerability was introduced in Dovecot version 2.4.1
...
so it seems, 2.3 is unaffected by this?
Comment 22 Herbert J. Skuhra 2025-10-29 09:45:30 UTC
(In reply to Philip Jocks from comment #21)
According to the announcement only 2.4.0 and 2.4.1 are affected:
<https://dovecot.org/mailman3/archives/list/dovecot@dovecot.org/thread/G3K5HMBKW6XOYNBXYV5GUM2GR6WPUD4M/>
Comment 23 Sean McBride 2025-12-29 23:27:40 UTC
Perhaps updating to dovecot 2.4 would be a good occasion to fix #290513 (building with LIBSODIUM in order to have Argon2id support).
Comment 24 Christos Chatzaras 2026-01-28 18:15:13 UTC
https://dovecot.org/upgrader/
Comment 25 Sebastian Oswald 2026-02-04 10:59:32 UTC
It might be worth noting this mail/thread[1] from the mailing list.

In summary:
Dovecot OY has pretty much moved all development efforts to the new 3.x tree, which is based on a completely new architecture called "Palomar"[2] (including "features" like "supports the interception of IMAP and POP3 protocol events, LMTP deliveries, appended messages, and more. Direct Integration with Lawful Intercept vendor APIs[...]" - YUCK!)
This architecture is of course proprietary and incompatible with the 2.x tree.

Given that 2.4 is still quite a mess (and not feature-complete to 2.3), I'd definitely hold on with any upgrades until it is clear if 2.4 will even be progressed or if (when) there will be a fork of 2.3 (which is the most logical path).


So I'm still holding on to my proposal to add a new port (e.g. mail/dovecot24) instead of updating mail/dovecot to the 2.4 tree. Anyone willing to jump right into the 2.4 mess is welcome to do so, but one has to intentionally install that version.
Breaking a lot of running installations and forcing them to re-build their configuration, just to have them possibly migrate back a few months later would be more than a "nuisance" (I'd be absolutely p*ssed...) and a violation of POLA (nobody wants to have a production service completely break by a pkg upgrade!)



[1] https://lists.freebsd.org/archives/freebsd-ports/2026-January/009018.html
[2] https://www.dovecotpro.com/solution
Comment 26 Kurt Jaeger freebsd_committer freebsd_triage 2026-02-04 11:09:17 UTC
(In reply to Sebastian Oswald from comment #25)
no problem with adding a new port so that anyone can test.
Comment 27 Ian Dickens 2026-02-19 17:23:08 UTC
(In reply to Sebastian Oswald from comment #25)
I'm just going to spitball some ideas I just thought of after reading what you wrote.


Idea 1) cobble some kind of migration tool to version 3 is someone needs it.  Maybe make it part of the port upgrade process if that's possible.  I'm not a port maintainer so I don't know if that's really something that can be done.
Idea 2) fork dovecot 2.3 or 2.4 and back port any patches.  I imagine this going to be labor intensive but probably the best route in order to maintain configurations.  Even then, who know how long this will work [I'm not a C/C++ coder]
Idea 3) if we can scrub config options in version 3.x offer them to be scrubed.  This might be a serious lift. I dunno.  Or even if patches can be made to remove this MITM code.

Idea 4) Once forked, it become something like dma is to sendmail - I think this idea is redundant.  But since I throwing spaghetti at the wall....

I'm retired now at 59yrs old and I'm just trying to brainstorm from my old days.  My real concern is that even though most if not all of us have geo-fenced this network port it's still exposed to the internet for some/most of us.

Just thoughts,

Ian
Comment 28 Jordan Ostreff 2026-03-18 17:39:08 UTC
Any news on this topic ? Or we wait 2.3.x do be declared as obsolete by dovecot.org?
Comment 29 Herbert J. Skuhra 2026-03-27 08:58:28 UTC
Dovecot and Pigeonhole 2.4.3 is out:

https://dovecot.org/mailman3/archives/list/dovecot-news@dovecot.org/thread/IKIHZX77IPTGSP5WBIPJUOFBUQFKVPE7/
Comment 30 Jose Quinteiro 2026-05-04 03:12:35 UTC
(In reply to Jordan Ostreff from comment #28)

Waiting for 2.3.x to be declared obsolete seems like the most reasonable course of action, sadly.
Comment 31 Herbert J. Skuhra 2026-05-12 13:31:22 UTC
Dovecot and Pigeonhole 2.4.4 are out:
https://dovecot.org/mailman3/archives/list/dovecot-news@dovecot.org/thread/YW7GVOH3VVLNAYW2C4TEBTGJW52J7F6H/
Comment 32 Jordan Montesse 2026-05-12 23:30:15 UTC
+1 for keeping mail/dovecot on 2.3.x
+1 for adding a new mail/dovecot24 port

Having both in the tree makes pre-emptive migration possible/easier
Comment 33 Alex Rosenberg 2026-05-19 03:36:26 UTC
A bug I tracked down was fixed in 2.4.3.

+1 to having a mail/dovecot24 port.

3.x appears to be reserved for their commercial product and they refer to 2.4 as "Community Edition." I take that to mean 2.>3 is going to be around for a while.

I don't see a continuing reason for delay here.
Comment 34 Jeff Kletsky 2026-05-26 00:26:00 UTC
As another reason to get 2.4 out there, flatcurve is no longer being maintained for 2.3 as it is now core in 2.4. 

While I have appreciated the conservative nature of FreeBSD over the years, this one has gone on for too long now.
Comment 35 Jeff Kletsky 2026-05-26 00:28:33 UTC
(In reply to Jeff Kletsky from comment #34)

https://slusarz.github.io/dovecot-fts-flatcurve/eol.html

FTS Flatcurve

FTS Flatcurve for Dovecot Community Edition (CE) is EOL (end of life).

There will be no further updates or fixes to this repository absent critical security issues!

Dovecot CE 2.4
FTS Flatcurve became the default Dovecot Community Edition (CE) FTS driver in v2.4.x (merged into Dovecot core in April 2022).
Comment 36 Mark Linimon freebsd_committer freebsd_triage 2026-06-05 10:25:10 UTC
Comment on attachment 260602 [details]
diff dovecot -> dovecot24

^Triage: although this is indeed a patch, it is for information only, and thus
does not need to be fed to the automation.
Comment 37 Mark Linimon freebsd_committer freebsd_triage 2026-06-05 10:31:04 UTC
Created attachment 271516 [details]
new port: mail/dovecot24 in git diff format
Comment 38 Kurt Jaeger freebsd_committer freebsd_triage 2026-06-05 17:08:42 UTC
(In reply to Sebastian Oswald from comment #16)

The generated Makefile for doc/man/ has issues:

make[4]: /wrkdirs/usr/ports/mail/dovecot24-pigeonhole/work-default/dovecot-pigeonhole-2.4.1-4/doc/man/Makefile:365: warning: Invalid character " " in variable name "wildcard *.1"
Comment 39 Kurt Jaeger freebsd_committer freebsd_triage 2026-06-05 19:34:47 UTC
(In reply to Mark Linimon from comment #37)
testbuilds at work for both dovecot24 and pigeonhole24
Comment 40 Kurt Jaeger freebsd_committer freebsd_triage 2026-06-06 07:31:41 UTC
(In reply to Kurt Jaeger from comment #39)
So, while it builds, it's 2.4.1-4, not 2.4.4 ?
Comment 41 Jordan Ostreff 2026-06-19 12:22:52 UTC
Created attachment 271949 [details]
mail/dovecot24 creation with ver 2.4.4

not tested it is the plist correct. distinfo corrected.
Comment 42 Jordan Ostreff 2026-06-19 12:24:03 UTC
Created attachment 271950 [details]
mail/dovecot24-pigeonhole creation with ver 2.4.4

not tested it, is the plist correct. distinfo updated.
Comment 43 Jordan Ostreff 2026-06-19 18:43:54 UTC
Created attachment 271958 [details]
mail/dovecot24 creation with ver 2.4.4

stages fine on my stable 15.1 amd64.
Comment 44 Jordan Ostreff 2026-06-20 12:06:16 UTC
Created attachment 271971 [details]
mail/dovecot24 creation with ver 2.4.4
Comment 45 Jordan Ostreff 2026-06-20 12:06:52 UTC
Created attachment 271972 [details]
mail/dovecot24-pigeonhole creation with ver 2.4.4
Comment 46 Jordan Ostreff 2026-06-20 20:48:46 UTC
Created attachment 271985 [details]
mail/dovecot24-pigeonhole creation with ver 2.4.4
Comment 47 Jordan Ostreff 2026-06-20 20:59:09 UTC
Created attachment 271986 [details]
mail/dovecot24 creation with ver 2.4.4
Comment 48 Jordan Ostreff 2026-06-21 13:37:14 UTC
Created attachment 272003 [details]
mail/dovecot24-pigeonhole creation with ver 2.4.4
Comment 49 Herbert J. Skuhra 2026-06-21 14:01:48 UTC
Am I wrong or is there zero feedback from the current dovecot maintainer? Can someone else maintain the dovecot24 ports? Does anyone plan to add wormhole (https://codeberg.org/errror/wormhole)? What else is needed to get this eventually committed?
Comment 50 Kurt Jaeger freebsd_committer freebsd_triage 2026-06-21 14:05:06 UTC
(In reply to Herbert J. Skuhra from comment #49)
I'm testbuilding, when I find the time. I have not yet tested the latest pigeonhole, but the latest 2.4.4 failed with pkg-plist errors.

I asked Jordan how he's testing those versions, and wait to hear from him.

I'd commit if it builds and some quick run-tests are fine as well.
Comment 51 Jordan Ostreff 2026-06-21 14:25:23 UTC
Created attachment 272005 [details]
mail/dovecot24-pigeonhole creation with ver 2.4.4
Comment 52 Herbert J. Skuhra 2026-06-21 17:32:43 UTC
Created attachment 272010 [details]
mail/dovecot24

This patch fixes some/all(?) PLIST issues. 
Port does not build with GSSAPI_HEIMDAL=on.
Comment 53 Herbert J. Skuhra 2026-06-21 18:06:01 UTC
(In reply to Jordan Ostreff from comment #51)
Option LDAP is broken:

/!\ dovecot24-pigeonhole-2.4.4: Makefile errors /!\

USE_OPENLDAP is unsupported, please use USES=ldap

*** Error code 1

Stop.

I guess you want:

diff --git a/Makefile.orig b/Makefile
index 58d222a..08c7fd0 100644
--- a/Makefile.orig
+++ b/Makefile
@@ -36,7 +36,7 @@ OPTIONS_DEFINE=               DOCS EXAMPLES LDAP MANAGESIEVE
 OPTIONS_DEFAULT=       DOCS MANAGESIEVE
 OPTIONS_SUB=           yes
 
-LDAP_USE=                      OPENLDAP=yes
+LDAP_USES=                     ldap
 LDAP_CONFIGURE_WITH=           ldap
 MANAGESIEVE_CONFIGURE_WITH=    managesieve
Comment 54 Jordan Ostreff 2026-06-21 21:24:00 UTC
Created attachment 272019 [details]
mail/dovecot24-pigeonhole creation with ver 2.4.4 with ldap fixes

Thanks Hurbert! Put correct ldap syntax.
Comment 55 Jordan Ostreff 2026-06-21 21:56:23 UTC
Created attachment 272021 [details]
mail/dovecot24-pigeonhole creation with ver 2.4.4 with ldap fixes
Comment 56 Jordan Ostreff 2026-06-21 21:57:00 UTC
Created attachment 272022 [details]
mail/dovecot24 creation with ver 2.4.4 with ldap fixes
Comment 57 Herbert J. Skuhra 2026-06-21 22:14:15 UTC
(In reply to Jordan Ostreff from comment #56)
Have you missed my patch in comment #52? It fixes more PLIST issues (SOLR, GSSAPI) and updates URL in pkg-message.in). GSSAPI_HEIMDAL is broken.
Comment 58 Jordan Ostreff 2026-06-21 22:17:09 UTC
(In reply to Kurt Jaeger from comment #50)
Hi Kurt, Herbert,
You are completely right. Dovecot 2.4 has completely removed the imap-hibernate process from its upstream codebase, which was causing the missing plist errors in the core port when certain option combinations were tested.
I have updated both ports:
	1.	mail/dovecot24: Removed the obsolete imap-hibernate line from pkg-plist and properly conditioned the new LDAP header/library artifacts via %%LDAP%%.
	2.	mail/dovecot24-pigeonhole: Replaced the legacy LDAP_USE macros with the modern framework standard LDAP_USES=ldap.
Both ports have now been thoroughly tested with make check-plist on my machine under all option combinations (both with LDAP enabled and disabled), and everything builds and packages perfectly clean now.
Attached are the finalized patches (v2 for dovecot24 and v3 for pigeonhole).
Comment 59 Jordan Ostreff 2026-06-21 22:19:09 UTC
(In reply to Herbert J. Skuhra from comment #52)
You are right. Will check tomorrow, it's late evening for me.
Comment 60 Jordan Ostreff 2026-06-21 22:31:45 UTC
Created attachment 272023 [details]
mail/dovecot24 creation with ver 2.4.4 with ldap fixes
Comment 61 Herbert J. Skuhra 2026-06-21 22:45:25 UTC
(In reply to Jordan Ostreff from comment #58)
Removing libexec/dovecot/imap-hibernate from pkg-plist is wrong:

====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: libexec/dovecot/imap-hibernate
===> Checking for items in pkg-plist which are not in STAGEDIR
===> Error: Plist issues found.
*** Error code 1

Stop.
make: stopped making "check-plist" in /usr/ports/mail/dovecot24
Comment 62 Jordan Ostreff 2026-06-22 11:48:03 UTC
(In reply to Herbert J. Skuhra from comment #61)
Hi Herbert,
Thanks for pointing that out. Interestingly, imap-hibernate is actually a conditional component in Dovecot, and it is not compiled or installed on all setups.
On my build machine (testing with FLAVOR=mysql), imap-hibernate is explicitly evaluated as FALSE by the configure script. Checking config.log shows:
BUILD_IMAP_HIBERNATE_FALSE=''
BUILD_IMAP_HIBERNATE_TRUE='#'

As a result, while the source directory src/imap-hibernate/ exists, the actual binary imap-hibernate is never built or staged into STAGEDIR/usr/local/libexec/dovecot/. This is why removing it straightforwardly or keeping it unconditionally static in pkg-plist creates a conflict between different environments (e.g., your environment where it builds vs. mine where it does not).
Since it is built on your system but skipped on mine, we definitely shouldn't just drop it from pkg-plist. Instead, we should find which specific platform feature or dependency triggers BUILD_IMAP_HIBERNATE so we can wrap it with the appropriate %%PORT_OPTION%% or plist macro to satisfy both build scenarios.
Comment 63 Jordan Ostreff 2026-06-22 12:18:33 UTC
(In reply to Jordan Ostreff from comment #62)
Prepared workaround for you inside Makefile + pkg-plist.

On which platform you are compiling because in configure.ac we have
AS_CASE(
   ["$notify"],
   [none],   [BUILD_IMAP_HIBERNATE=0],
   [kqueue], [BUILD_IMAP_HIBERNATE=0],
   [BUILD_IMAP_HIBERNATE=1])

and because 
I/O polling .... : kqueue
I/O notifys .... : kqueue

it finishes as BUILD_IMAP_HIBERNATE=0 for me.
Comment 64 Jordan Ostreff 2026-06-22 13:35:08 UTC
Created attachment 272037 [details]
mail/dovecot24 creation with ver 2.4.4

Status of the Dovecot 2.4.4 Port Update
What works:
•	Upgraded the port to version 2.4.4 with full support for modern Flavors (default, mysql, pgsql).
•	Reworked and cleaned up the post-install logic to ensure correctly structured stage directories across flavors.
•	The framework configuration matches user option choices cleanly without stepping over dependency flags during flavor overrides.
•	The base installation successfully compiles and stages when GSSAPI_NONE is selected.
Known Issues & Current Roadblock:
•	Base System Heimdal Conflict (GSSAPI_BASE): When the user explicitly selects GSSAPI_BASE to utilize the native FreeBSD Kerberos framework, the compilation breaks during the SASL/GSSAPI build phase.
•	The build system pulls in the base system's /usr/include/gssapi/gssapi_krb5.h. In FreeBSD's native Heimdal implementation, GSS_KRB5_NT_PRINCIPAL_NAME is defined as a preprocessor macro. When Dovecot attempts to declare this as a constant (const gss_OID GSS_KRB5_NT_PRINCIPAL_NAME = NULL;), the macro expansion corrupts the C syntax, causing the compiler to fail with multiple errors (e.g., error: expected identifier or '(').
•	GSSAPI_NONE works perfectly fine, but GSSAPI_BASE is currently broken due to this structural header conflict with base Heimdal.
Comment 65 Jordan Ostreff 2026-06-22 13:35:58 UTC
(In reply to Jordan Ostreff from comment #64)
Probably I've missed something - please describe.
Comment 66 Jordan Ostreff 2026-06-22 15:18:35 UTC
(In reply to Jordan Ostreff from comment #65)
In my default build environment i have following:
# make showconfig
===> The following configuration options are available for dovecot24-2.4.4:
     DOCS=on: Build and/or install documentation
     EXAMPLES=on: Build and/or install examples
     LIBSODIUM=on: Support libsodium based crypts (ARGON2I/ARGON2ID)
     LIBUNWIND=off: Get backtraces using libunwind
     LIBWRAP=on: TCP wrapper support
     LUA=on: Lua scripting language support
     LZ4=off: LZ4 compression support
====> Database support
     CDB=off: CDB database support
     LDAP=on: LDAP protocol support
     MYSQL=on: MySQL database support
     PGSQL=off: PostgreSQL database support
     SQLITE=off: SQLite database support
====> Full text search plugins
     ICU=on: Use libicu for FTS unicode normalization
     SOLR=off: Solr FTS support
     TEXTCAT=off: Libexttextcat FTS support
====> GSSAPI Security API support: you have to select exactly one of them
     GSSAPI_BASE=off: Use GSSAPI from base
     GSSAPI_HEIMDAL=off: Use Heimdal GSSAPI from security/heimdal
     GSSAPI_MIT=off: Use MIT GSSAPI from security/krb5
     GSSAPI_NONE=on: Build without GSSAPI support
===> Use 'make config' to modify these settings
Comment 67 Jordan Ostreff 2026-06-22 15:30:51 UTC
(In reply to Jordan Ostreff from comment #66)
TEXTCAT=on: Libexttextcat FTS support 
also tested to be working. For SOLR=off: Solr FTS support I can't test it - no machine where to bringup Apache Solr which is JAVA and needs too much memory. 
Maybe to disable this option, or write some description there that it was not tested and not recommended ?
Comment 68 Jeff Kletsky 2026-06-22 16:01:44 UTC
I appreciate all the work going into this. 

One (more) thing that might be worth considering is allowing stemming for FTS. It has been ages since I tried to work around it with an earlier version. One concise reference is https://forums.freebsd.org/threads/why-does-mail-dovecot-use-clucenes-snowball-stemmer-instead-of-textproc-snowballstemmer.100314/
Comment 69 Jordan Ostreff 2026-06-22 17:47:29 UTC
(In reply to Jeff Kletsky from comment #68)
For me doing it as hobby during my free time, it was huge work ... Personally i'm not good in auto-tools and also doesn't have powerful hardware to test most scenarios on it.
Comment 70 Jordan Ostreff 2026-06-22 18:14:30 UTC
(In reply to Herbert J. Skuhra from comment #57)
Hi Herbert, 
i'm publishing _v5 of patch, which incorporates all your recommendations. 
Regarding HEIMDAL - it's still not finished. Here is how it worked for me:

# make showconfig
===> The following configuration options are available for dovecot24-2.4.4:
     DOCS=on: Build and/or install documentation
     EXAMPLES=on: Build and/or install examples
     LIBSODIUM=on: Support libsodium based crypts (ARGON2I/ARGON2ID)
     LIBUNWIND=off: Get backtraces using libunwind
     LIBWRAP=on: TCP wrapper support
     LUA=on: Lua scripting language support
     LZ4=off: LZ4 compression support
====> Database support
     CDB=off: CDB database support
     LDAP=on: LDAP protocol support
     MYSQL=on: MySQL database support
     PGSQL=off: PostgreSQL database support
     SQLITE=off: SQLite database support
====> Full text search plugins
     ICU=on: Use libicu for FTS unicode normalization
     SOLR=off: Solr FTS support
     TEXTCAT=on: Libexttextcat FTS support
====> GSSAPI Security API support: you have to select exactly one of them
     GSSAPI_BASE=off: Use GSSAPI from base
     GSSAPI_HEIMDAL=off: Use Heimdal GSSAPI from security/heimdal
     GSSAPI_MIT=off: Use MIT GSSAPI from security/krb5
     GSSAPI_NONE=on: Build without GSSAPI support
===> Use 'make config' to modify these settings
Comment 71 Jordan Ostreff 2026-06-22 18:16:34 UTC
Created attachment 272050 [details]
mail/dovecot24 creation with ver 2.4.4 v5

improvements proposed by Herbert in files/pkg-message.in also files/dovecot.in.
"Solr FTS support (untested and NOT recommended)".
Comment 72 Jordan Ostreff 2026-06-22 18:20:05 UTC
(In reply to Jeff Kletsky from comment #68)
That is a very solid point, and the good news is that this exact issue is solved in the new Dovecot 2.4.x port layout.
In older versions, the port's FTS integration was heavily bundled with specific legacy databases. With Dovecot 2.4's modular architecture, it makes much more sense to drop the clucene dependency entirely.
In the updated port version, textproc/snowballstemmer is explicitly defined under LIB_DEPENDS:
LIB_DEPENDS=    libpcre2-32.so:devel/pcre2 \
                libstemmer.so:textproc/snowballstemmer \
                libxapian.so:databases/xapian-core \
                libzstd.so:archivers/zstd

This ensures that libdovecot_fts_flatcurve_plugin.so gets clean, native stemming support without forcing users to touch Solr or older Lucene implementations.
Comment 73 Jordan Ostreff 2026-06-22 19:32:08 UTC
Created attachment 272052 [details]
mail/dovecot24 creation with ver 2.4.4 v5
Comment 74 Herbert J. Skuhra 2026-06-22 20:53:22 UTC
Using poudriere libexec/dovecot/imap-hibernate is created on stable/15 and main (both amd64) but not on stable/14. So checking for OPSYS alone is not sufficient.

And the port uses some unrecognized configure options: e.g. --with-docs, --with-shadow, --with-ssl, --with-libwrap
Comment 75 Jordan Ostreff 2026-06-22 21:26:32 UTC
Created attachment 272053 [details]
mail/dovecot24 creation with ver 2.4.4 v6

rc.d also fixed in v6
Comment 76 Herbert J. Skuhra 2026-06-23 13:52:48 UTC
(In reply to Herbert J. Skuhra from comment #74)
FreeBSD >= 15.0 has inotify, so the following should work:

# imap-hibernate does not build on FreeBSD < 15.0 due to kqueue being used for notifications
.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1500000
PLIST_SUB+=     IMAP_HIBERNATE="@comment "
.else
PLIST_SUB+=     IMAP_HIBERNATE=""
.endif
Comment 77 Jordan Ostreff 2026-06-23 14:19:04 UTC
Created attachment 272072 [details]
mail/dovecot24 creation with ver 2.4.4 v6

Hi Herbert,
Thank you for the review. I believe I've addressed all the issues you raised:
1. imap-hibernate on stable/14
Fixed. The OSVERSION check now properly handles this:
stable/14 (OSVERSION < 1500000): IMAP_HIBERNATE="@comment " — binary excluded from PLIST
stable/15 and main (OSVERSION >= 1500000): IMAP_HIBERNATE="" — binary included
Also moved .include <bsd.port.options.mk> before the check so OSVERSION is actually defined.
2. Unrecognized configure options
Removed --disable-hibernate which does not exist in Dovecot 2.4.4 upstream. The configure: WARNING: unrecognized options is now gone.
The other options you mentioned (--with-docs, --with-shadow, --with-ssl, --with-libwrap) were already cleaned up in a previous revision — they are not present in the current Makefile.
3. pigeonhole
Checked mail/dovecot24-pigeonhole as well — its configure --help matches the options used in its Makefile. No stale options there.
Please let me know if you'd like any further changes.
Best regards,
Jordan Ostreff
Comment 78 Jordan Ostreff 2026-06-23 14:21:51 UTC
(In reply to Herbert J. Skuhra from comment #76)
Sorry, 
i've included only this in the block put into v6 patch which have just published:

+.if ${OSVERSION} < 1500000
+PLIST_SUB+=            IMAP_HIBERNATE="@comment "
+.else
+PLIST_SUB+=            IMAP_HIBERNATE=""
+.endif

Will take additional check for next version.

Thanks again for your reviews and help!

KR,
Jordan
Comment 79 Jordan Ostreff 2026-06-23 14:28:22 UTC
Created attachment 272073 [details]
mail/dovecot24 creation with ver 2.4.4 v6

Hi Herbert,
Thank you for the exact snippet — applied as suggested:

# imap-hibernate does not build on FreeBSD < 15.0 due to kqueue being used for notifications
.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1500000
PLIST_SUB+=	IMAP_HIBERNATE="@comment "
.else
PLIST_SUB+=	IMAP_HIBERNATE=""
.endif
Also removed the stale --disable-hibernate from CONFIGURE_ARGS.
Please let me know if anything else is needed.
Comment 80 Herbert J. Skuhra 2026-06-24 07:15:43 UTC
- Please don't add Bulgarian(?) text.
- What's QA_ALREADY_SUPP_SHARED_LIBS? No other port uses this.
- Why did you add %%MYSQL%%%%PGSQL%%%%SQLITE%% to some lines in pkg-plist? I think these files are built and installed by default and are now missing.
- I assume pkg-plist should be sorted by filename (ignoring %%XXX%%)
- Should lua:54 be moved from USES to LUA_USES? (And according to the Docs dovecot also supports lua 5.3.: https://doc.dovecot.org/2.4.4/core/admin/lua/)
- portlint, portclippy, etc. shows some warnings and errors
Comment 81 Jordan Ostreff 2026-06-24 10:18:49 UTC
Created attachment 272093 [details]
mail/dovecot24 creation with ver 2.4.4 v7

Addressed all review comments:

Removed Bulgarian comments and QA_ALREADY_SUPP_SHARED_LIBS
Moved lua from USES to LUA_USES, added lua:53 support
Removed %%MYSQL%%%%PGSQL%%%%SQLITE%% conditionals from pkg-plist (files are installed unconditionally)
Fixed Makefile variable ordering per portclippy
Sorted pkg-plist by filename (ignoring %%TOKEN%% prefixes)

# portlint -A -C
WARN: Makefile: Consider adding support for a NLS knob to conditionally disable gettext support. <- gettext is not optional
WARN: Makefile: "USES" has to appear earlier. <- false positive because .if
FATAL: pkg-descr not under git.
FATAL: distinfo not under git.
FATAL: Makefile not under git.
FATAL: pkg-plist not under git.
FATAL: files/pkg-message.in not under git.
FATAL: files/dovecot.in not under git.
6 fatal errors and 2 warnings found.
Comment 82 Jordan Ostreff 2026-06-24 15:17:18 UTC
My own mail server migration is fully complete.

Final Status

Component	Status
Dovecot package	dovecot24-2.4.4 ✅
Pigeonhole	dovecot24-pigeonhole-2.4.4 ✅
IMAP4rev1	✅
IMAP4rev2	✅
CONDSTORE	✅
QRESYNC	✅
UIDPLUS	✅
IMAP-hibernate	✅ (10 minutes)
MySQL caching	✅
FTS Flatcurve	✅
ZFS dedicated dataset	✅ (8K recordsize, zstd compression)
What We Achieved

Upgraded from Dovecot 2.3.21.1 to 2.4.4
Consolidated everything into a single dovecot.conf
Optimized MySQL with auth caching (reduced load).
Enabled IMAP-hibernate for RAM savings.
Configured ZFS with optimal settings for Maildir.
Added IMAP4rev2 support for modern clients.
Running On

OS: FreeBSD 15.1-STABLE amd64
ZFS: Dedicated dataset with 1.38x compression ratio
MySQL: 8.4.9 with optimized queries
Comment 83 Jordan Ostreff 2026-06-24 17:59:39 UTC
Subject: IMAP hibernation non-functional on FreeBSD 15.x due to major()/minor() returning invalid values for non-device files

Description:
IMAP hibernation compiles successfully on FreeBSD 15.x (tested with Dovecot 2.4.4 and FreeBSD 15.1), but fails at runtime with the following error:

imap-hibernate: Error: conn unix:imap-hibernate (uid=125): Failed to parse client input: Invalid peer_dev_major value: 18446744073709551615

Root cause for me:
In src/imap/imap-client-hibernate.c, the code serializes peer_dev_major and peer_dev_minor using major() and minor() macros:

str_printfa(cmd, "\tpeer_dev_major=%lu\tpeer_dev_minor=%lu\tpeer_ino=%llu",
            (unsigned long)major(peer_st.st_dev),
            (unsigned long)minor(peer_st.st_dev),
            (unsigned long long)peer_st.st_ino);

On FreeBSD, major() and minor() can return UINT64_MAX (18446744073709551615) for file descriptors that are not block/character devices (such as sockets on tmpfs/devfs). This value exceeds UINT_MAX and cannot be parsed by str_to_uint() in imap-master-client.c, causing hibernation to fail.

Historical context:
This issue was previously discussed on the Dovecot mailing list in July 2019 (thread: "Hibernation errors"). At that time, the problem was identified but apparently not resolved upstream. The same failure mode persists in Dovecot 2.4.4 on FreeBSD 15.x.

Impact:
IMAP hibernation is effectively non-functional on FreeBSD 15.x
The error occurs consistently when imap_hibernate_timeout is configured and clients enter IDLE state
No successful hibernation occurs; processes remain running indefinitely

Additional context:
The documentation states that hibernation "is not supported on kqueue based systems currently, such as FreeBSD." However, the code compiles and attempts to run, producing these errors rather than being disabled at compile time or gracefully skipped at runtime.
Comment 84 Jordan Ostreff 2026-06-25 20:20:04 UTC
Created attachment 272133 [details]
mail/dovecot24 creation with ver 2.4.4 v8

Bug Description / Comment
Title/Summary: mail/dovecot24: Unbreak IMAP Hibernation (imap-hibernate) on FreeBSD (Fix 64-bit dev_t overflow and verification bypass)
Comment:
The IMAP Hibernation feature (imap-hibernate) in Dovecot 2.4.x is currently broken on FreeBSD due to an architectural mismatch in how virtual/network socket device numbers are handled and parsed.
Problem Breakdown:
Integer Overflow on Hibernation Entry:
Under FreeBSD, invoking fstat() on a network or virtual socket descriptor returns NODEV (UINT64_MAX or 18446744073709551615) for both major() and minor() device numbers.
Dovecot serializes these values over IPC, but src/imap-hibernate/imap-hibernate-client.c and src/imap/imap-master-client.c store peer_dev_major and peer_dev_minor using 32-bit unsigned int variables mapped via str_to_uint(). This causes an immediate integer overflow parsing error when a client tries to hibernate:
imap-hibernate: Error: conn unix:imap-hibernate (uid=125): Failed to parse client input: Invalid peer_dev_major value: 18446744073709551615
Strict Verification Failure on Exit (Unhiberation):
When a client wakes up from hibernation, imap_master_client_verify() in src/imap/imap-master-client.c checks if the current socket's peer_st.st_dev matches the serialized master_input->peer_dev via the CMP_DEV_T macro. On FreeBSD, because these are virtual network descriptors, the device validation logic causes a structural mismatch check failure, triggering an artificial BUG panic assertion loop during the session restore phase.
Solution Implemented:
Expanded the internal IPC state parsers to uint64_t using str_to_uint64() inside both imap-hibernate-client.c and imap-master-client.c to natively accommodate 64-bit dev_t values without overflow.
Added an explicit exemption for FreeBSD's NODEV (-1) virtual device descriptors inside the imap_master_client_verify() assertion chain to bypass the strict local block-device check during descriptor restoration.
Testing Results:
The patches have been compiled and thoroughly tested in a live deployment on FreeBSD 15-STABLE.
Sessions transition into imap-hibernate cleanly without throwing memory alignment or parsing exceptions.
Background notifications (such as incoming mail delivery via external SMTP or mail flag modifications from parallel clients) successfully trigger the kernel event layers (kqueue).
The imap-hibernate process catches the event, seamlessly unhibernates the session, hands the descriptor back to a standard imap worker process, and pushes the immediate updates (* EXISTS, * FETCH, * EXPUNGE) to the IDLE client transparently without dropping connection strings.
The patch-set is attached to unbreak this crucial resource-saving feature for FreeBSD mail production environments.
Comment 85 Herbert J. Skuhra 2026-06-27 11:26:43 UTC
I guess this is a new port. I don't see any feedback from the maintainer of mail/dovecot here. Can you maintain mail/dovecot24(-pigenhole)? Maybe this will be finally committed when you set MAINTAINER to yourself. Thanks.

Does the imap-hibernate bug also affect dovecot 2.3 (mail/dovecot)?
Comment 86 Jose Quinteiro 2026-06-27 14:16:48 UTC
I don't understand why hibernate is not supported in Freebsd 14. Quoting the kqueue(2) man page:

HISTORY
       The kqueue() and	kevent() system	calls first appeared in	 FreeBSD  4.1.
       The  kqueuex()  system  call  and  kqueue1() function first appeared in
       FreeBSD 14.0.
Comment 87 Jordan Ostreff 2026-06-27 20:29:41 UTC
(In reply to Herbert J. Skuhra from comment #85)

Hi Herbert,

Thank you for the trust! I would be happy to take over the maintainership for mail/dovecot24. I'll update the MAINTAINER field in the next patch.

Regarding your question about the imap-hibernate bug and whether it affects Dovecot 2.3 (mail/dovecot):
The issue is tied to how Dovecot's autotools macro (m4/notify.m4) handles feature detection on different FreeBSD versions.

* On FreeBSD 14, the detection correctly identifies kqueue, setting BUILD_IMAP_HIBERNATE=0, meaning the hibernate binary is skipped and not compiled at all. This is why standard mail/dovecot (2.3) isn't affected on 14.x.

The issue stems from configure.ac, where the build logic ties BUILD_IMAP_HIBERNATE directly to the detected $notify mechanism:

AS_CASE(
   ["$notify"],
   [none],   [BUILD_IMAP_HIBERNATE=0],
   [kqueue], [BUILD_IMAP_HIBERNATE=0],
   [BUILD_IMAP_HIBERNATE=1])

The magic is inside m4/notify.m4 file, which causes FreeBSD 14 to skip imap-hibernate.

* On FreeBSD 15, due to OS changes, the macro misses kqueue, falls back to the default case, and builds imap-hibernate.

To handle this cleanly in the mail/dovecot24 port without breaking packaging on either OS version, I have added a conditional check in the Makefile to handle the PLIST_SUB properly:

.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1500000
PLIST_SUB+=     IMAP_HIBERNATE="@comment "
.else
PLIST_SUB+=     IMAP_HIBERNATE=""
.endif

I will submit the updated patch shortly. Thanks again!
Comment 88 Jordan Ostreff 2026-06-27 20:35:13 UTC
Created attachment 272193 [details]
mail/dovecot24 creation with ver 2.4.4 v9

with changed MAINTAINER.
Comment 89 Jordan Ostreff 2026-06-27 20:36:12 UTC
Created attachment 272194 [details]
mail/dovecot24-pigeonhole creation with ver 2.4.4 v4

with changed MAINTAINER.
Comment 90 Jordan Ostreff 2026-06-27 20:42:12 UTC
(In reply to Jose Quinteiro from comment #86)
Hi Jose,

The presence of kqueue is not the blocker here; the limitation is that Dovecot's upstream source code for `imap-hibernate` is explicitly written for Linux's epoll API and completely lacks a kqueue implementation.

FreeBSD 15 introduced significant updates to Linux API compatibility layers (including epoll translations under the hood), allowing the code to compile and link successfully on 15.x, whereas on FreeBSD 14 it lacks these native interfaces and relies strictly on the fallback logic that disables the build.

See also comment #87.
Comment 91 Herbert J. Skuhra 2026-06-27 22:17:07 UTC
(In reply to Jordan Ostreff from comment #90)
imap-hibernate compiles on FreeBSD 14 if you patch configure:

--- configure.orig      2026-05-12 12:49:14.000000000 +0200
+++ configure   2026-06-27 23:45:01.804558000 +0200
@@ -27602,7 +27602,7 @@
   none) :
     BUILD_IMAP_HIBERNATE=0 ;; #(
   kqueue) :
-    BUILD_IMAP_HIBERNATE=0 ;; #(
+    BUILD_IMAP_HIBERNATE=1 ;; #(
   *) :
     BUILD_IMAP_HIBERNATE=1 ;;
 esac 

No, idea if it works. 

Does imap-hibernate work in mail/dovecot (dovecot 2.3.x)? Or does it produce the same error as in comment #83 and #84? Does your patch for src/imap-hibernate/imap-hibernate-client.c and src/imap/imap-master-client.c also apply to dovecot 2.3?
Comment 92 Jordan Ostreff 2026-06-27 22:37:55 UTC
(In reply to Jordan Ostreff from comment #87)
Small correction and additional context:
The m4/notify.m4 logic is actually working as designed — on FreeBSD 15.1, configure detects both kqueue AND inotify_init (FreeBSD 15 introduced native inotify support). Because inotify is checked first and found present, $notify becomes inotify, which falls through to the default case and sets BUILD_IMAP_HIBERNATE=1.
On FreeBSD 14.x, inotify_init is not available, so $notify correctly falls back to kqueue, which explicitly disables hibernation.
The real issue is that Dovecot's imap-hibernate code assumes Linux-style device numbers where major()/minor() always return sensible values. On FreeBSD, these macros can return UINT64_MAX for non-device files (like sockets on tmpfs/devfs), causing the serialization to produce:
plain

peer_dev_major=18446744073709551615
The existing port patches (patch-src_imap-hibernate_imap-hibernate-client.c and patch-src_imap_imap-master-client.c) handle this by using uint64_t and str_to_uint64() for parsing, plus a CMP_DEV_T workaround that skips the device check when major() returns -1.
With these patches, hibernation works correctly on FreeBSD 15.1 — I've verified that IMAP processes are successfully hibernated and unhibernated without errors.
Comment 93 Martin Waschbüsch 2026-06-28 05:37:29 UTC
(In reply to Jordan Ostreff from comment #92)
Just for the record: Did you submit your patches to upstream? Or is this something that will need to be maintained by this port's maintainer?
Comment 94 Jordan Ostreff 2026-06-28 10:22:36 UTC
(In reply to Herbert J. Skuhra from comment #91)
Hi Herbert,
I checked Dovecot 2.3.21 — it turns out BUILD_IMAP_HIBERNATE doesn't exist in 2.3.x at all. Hibernation was introduced as a new feature in Dovecot 2.4.x, so mail/dovecot (2.3.x) is completely unaffected.
The m4/notify.m4 logic is identical between 2.3.21 and 2.4.4 (only syntax differs: if/then/else vs AS_IF), but the key difference is that 2.4.x added BUILD_IMAP_HIBERNATE logic in configure.ac which ties hibernation to the detected $notify mechanism.
So the issue is specific to Dovecot 2.4.x on FreeBSD 15.x.

Dovecot 2.3.x is approaching End-of-Life — according to the official Dovecot roadmap, the 2.3 series will reach EOL at the end of 2026, receiving only security patches from that point forward. New features and bug fixes (including hibernation-related issues) are being developed exclusively in the 2.4.x branch.
This means:
mail/dovecot (2.3.x) will not receive any hibernation fixes — the feature doesn't exist in this branch
mail/dovecot24 (2.4.x) is where all active development happens
The patches we've discussed (patch-src_imap-hibernate_imap-hibernate-client.c and patch-src_imap_imap-master-client.c) are only relevant for 2.4.x
Recommendation:
Keep mail/dovecot (2.3.x) as-is on FreeBSD 14 — hibernation is correctly disabled, no action needed
Focus efforts on mail/dovecot24 (2.4.x) for FreeBSD 15.x — apply the existing patches and consider upstreaming them to Dovecot before 2.3.x EOL


PS.

diff -u /usr/ports/mail/dovecot/work-default/dovecot-2.3.21.1/m4/notify.m4 /usr/ports/mail/dovecot24/work-default/dovecot-2.4.4/m4/notify.m4

grep -n -A15 -B5 "BUILD_IMAP_HIBERNATE" /usr/ports/mail/dovecot/work-default/dovecot-2.3.21.1/configure.ac

grep -n -A15 -B5 "BUILD_IMAP_HIBERNATE" /usr/ports/mail/dovecot24/work-default/dovecot-2.4.4/configure.ac
Comment 95 Jordan Ostreff 2026-06-28 10:26:40 UTC
(In reply to Martin Waschbüsch from comment #93)
Hi Martin,
I submitted the issue to the Dovecot mailing list (dovecot@dovecot.org) on June 25th, 2026, with a detailed root cause analysis and the proposed patches. However, I have not yet received any upstream response or acknowledgment.
The patches are currently maintained locally in the FreeBSD port (files/patch-src_imap-hibernate_imap-hibernate-client.c and files/patch-src_imap_imap-master-client.c). Given that Dovecot 2.3.x is approaching EOL (end of 2026) and 2.4.x is the active development branch, I believe the most practical path forward is:
Short-term: Keep the patches in the FreeBSD port for mail/dovecot24 — they are sufficient to make hibernation functional on FreeBSD 15.x
Medium-term: If upstream (Dovecot) integrates the fixes, the port can drop the local patches
Long-term: Consider whether hibernation should be explicitly disabled for FreeBSD via configure.ac checks, rather than relying on the current m4/notify.m4 fallback behavior
As the new maintainer for mail/dovecot24, I will track upstream responses and update the port accordingly. If anyone has contacts with the Dovecot core team, a nudge would be appreciated — the patches are minimal and the issue is well-defined.
Comment 96 Jordan Ostreff 2026-06-28 10:36:08 UTC
(In reply to Herbert J. Skuhra from comment #91)
Additional technical detail I should have mentioned earlier:
On FreeBSD 14.x, dev_t and the major()/minor() macros are 32-bit, which means they return sensible values that fit in unsigned int. 
On FreeBSD 15.x, dev_t and major()/minor() were changed to 64-bit to handle larger device numbers. For non-device files (like sockets on tmpfs/devfs), these macros now return UINT64_MAX (18446744073709551615), which exceeds UINT_MAX and breaks the str_to_uint() parsing in Dovecot's hibernation code.
This architectural difference between FreeBSD 14 and 15 is the root cause of why the hibernation issue only manifests on FreeBSD 15.x, and why the uint64_t + str_to_uint64() patches are specifically needed there.
Comment 97 Jordan Ostreff 2026-06-28 10:41:17 UTC
Question for the community:
Has anyone else tested Dovecot 2.4.x on FreeBSD 15.x with the IMAP hibernation patches (patch-src_imap-hibernate_imap-hibernate-client.c and patch-src_imap-master-client.c)?
Specifically, I'm curious about:
1. Configuration file migration issues — Have you encountered any problems translating/upgrading configuration files from Dovecot 2.3.x to 2.4.x format?
2. Runtime stability — Any unexpected crashes or hangs during hibernation/unhibernation cycles?
3. Performance impact — Noticeable differences in memory usage or connection handling compared to 2.3.x?
4. Other FreeBSD-specific issues — Any additional patches or workarounds needed beyond the hibernation fixes?

My testing so far shows the hibernation patches work correctly on FreeBSD 15.1-STABLE, but I'd like to hear from others before committing these in the FreeBSD port.
Comment 98 Herbert J. Skuhra 2026-06-28 10:45:38 UTC
(In reply to Jordan Ostreff from comment #94)

imap-hibernate was added in 2015 (dovecot 2.2):
https://dovecot.org/mailman3/archives/list/dovecot@dovecot.org/thread/HFVDZ45ICRDOPNOH6UGHZ6E4NTDQEIEF/#D4H7NYRVCEHU36JONNBC6EL2XC3G6VCJ

https://doc.dovecot.org/2.3/configuration_manual/hibernation/
https://cgit.freebsd.org/ports/tree/mail/dovecot/pkg-plist#n806

And for years there are similar reports about "Invalid peer_dev_major value" on FreeBSD:

https://dovecot.org/mailman3/archives/list/dovecot@dovecot.org/message/7KEUO3TOU4M32EQWQOL7PBTAYQQVRYJO/

So I think only the check is new: 

commit b78283cf9748e4c4fed8a5ec09cdba7b9bf18228
Author:     Aki Tuomi
AuthorDate: Mon Jan 22 10:52:50 2024 +0200
Commit:     Aki Tuomi
CommitDate: Fri Feb 2 11:18:48 2024 +0200

    imap-hibernate: Only build if supported by os
    
    IMAP hibernate needs to pass notifys across
    processes, which does not work with kqueue.

- Does imap-hibernate of mail/dovecot24 work on FreeBSD < 15 with your patch?
- Does imap-hibernate work in dovecot 2.3 with your patch? If not it should be disabled in mail/dovecot for FreeBSD < 15 too.

But maybe I am wrong.
Comment 99 Jordan Ostreff 2026-06-28 12:06:17 UTC
(In reply to Herbert J. Skuhra from comment #98)

Does imap-hibernate of mail/dovecot24 work on FreeBSD < 15 with your patch?

No — as we established earlier, FreeBSD 14 lacks the epoll_create1() compatibility layer that FreeBSD 15 introduced. Even with BUILD_IMAP_HIBERNATE=1 forced, it probably will fails at runtime with:
epoll_create1() failed: Function not implemented

So hibernation is correctly disabled on FreeBSD 14 via the kqueue detection in m4/notify.m4.

imap-hibernate was there for linux systems only.
Historically yes — the original implementation was Linux-centric (epoll-based). FreeBSD 15's Linux API compatibility layer (including epoll translation) is what allows it to compile and run now, albeit with the major()/minor() device number quirks we've patched.

The patches in mail/dovecot24 are specifically for FreeBSD 15.x and won't help on FreeBSD 14.x where the underlying epoll infrastructure is missing.
Comment 100 Jordan Ostreff 2026-06-28 12:17:05 UTC
(In reply to Herbert J. Skuhra from comment #98)
Hi Herbert,
To make sure I understand correctly — what exactly would you like me to do here?
From our discussion, I see a few possible paths:

For mail/dovecot24 (2.4.x): The existing patches work on FreeBSD 15.x. Should I commit them as-is, or do you want additional changes?
For FreeBSD 14: Hibernation is correctly disabled — no action needed.

Upstream: Should I push harder on the Dovecot mailing list to get these patches accepted upstream?

Regarding epoll specifically: As Aki Tuomi's commit message explains, hibernation requires epoll because it needs to pass file descriptor notifications across processes, which kqueue cannot do. FreeBSD 15's Linux compatibility layer provides epoll_create1(), making hibernation possible there. FreeBSD 14 lacks this, so hibernation is correctly disabled.

Regarding mail/dovecot (2.3.x): I don't intend to actively maintain hibernation patches for 2.3.x. My plan is only to update the port to a newer 2.3.x version if one is released after 2.3.21. Since 2.3.x is approaching EOL (end of 2026), I believe effort is better spent on 2.4.x.

So my question is: do you want me to focus on getting the mail/dovecot24 patches committed, or is there something else you need from me?
Comment 101 Jordan Ostreff 2026-06-28 12:18:52 UTC
(In reply to Jordan Ostreff from comment #100)
I see that latest 2.3.21.1 is from 2024 https://github.com/dovecot/core/releases/tag/2.3.21.1
Comment 102 Jordan Ostreff 2026-06-28 12:38:20 UTC
(In reply to Herbert J. Skuhra from comment #98)

Short answer: The patches will only work on FreeBSD 15.x, where both epoll emulation (via Linux compatibility layer) and kqueue exist.

The patches simply convert the 32-bit variables (unsigned int) to 64-bit (uint64_t) to match what FreeBSD 15's major()/minor() macros actually return.

This is exactly why upstream disabled building imap-hibernate via autotools when kqueue is detected — the code was written for Linux's epoll API and cannot work with native kqueue.

FreeBSD 15's epoll compatibility layer makes it possible, but the 32-bit → 64-bit mismatch still needed fixing via patches. I hope that they adapt his code for this FreeBSD specific implementation.
Comment 103 Jordan Ostreff 2026-07-02 13:59:26 UTC
Comment on attachment 272194 [details]
mail/dovecot24-pigeonhole creation with ver 2.4.4 v4

fixed type in description field?
Comment 104 Jordan Ostreff 2026-07-02 14:01:30 UTC
Are there some comments on the "mail/dovecot24 creation with ver 2.4.4 v9" and "mail/dovecot24-pigeonhole creation with ver 2.4.4 v4" patches attached here?
Comment 105 Jordan Ostreff 2026-07-06 09:42:55 UTC
Created attachment 272534 [details]
mail/dovecot24 creation with ver 2.4.4 v10

Fix port style and QA issues

- Run portfmt to fix Makefile formatting and whitespace issues
- Run portclippy to reorder Makefile variables according to the Porter's Handbook
- Run portlint to ensure compliance with port guidelines
Comment 106 Jordan Ostreff 2026-07-06 09:43:49 UTC
Created attachment 272535 [details]
mail/dovecot24-pigeonhole creation with ver 2.4.4 v5

Fix port style and QA issues

- Run portfmt to fix Makefile formatting and whitespace issues
- Run portclippy to reorder Makefile variables according to the Porter's Handbook
- Run portlint to ensure compliance with port guidelines
Comment 107 Ulas SAYGIN 2026-07-14 13:51:35 UTC
hello people, 

https://reviews.freebsd.org/D28719

can you review this and Add FLAVORs for CDB, LDAP, MYSQL, PGSQL, and SQLITE3.

I need sqlite3 supported package but there is no flavor for it. postfix has but dovecot does not have. can you add it too?
Comment 108 Ulas SAYGIN 2026-07-14 14:00:03 UTC
it has previous commit but i think it is deleted or not staged? why there is no flavors?

Bug 254164 - mail/dovecot: Add FLAVORs for CDB, LDAP, MYSQL, PGSQL, and SQLITE3 
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254164
Comment 109 Ulas SAYGIN 2026-07-14 14:28:58 UTC
https://github.com/freebsd/freebsd-ports/commit/c0ed6e0 commit deleted but dovecot only have FLAVORS=	default mysql pgsql but no sqlite3 can it be added?
Comment 110 Ulas SAYGIN 2026-07-16 10:09:54 UTC
please look this. 


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296790

thank you.
Comment 111 Jordan Ostreff 2026-07-18 12:29:12 UTC
(In reply to Ulas SAYGIN from comment #110)
Added following:
# make -V FLAVORS
default mysql pgsql sqlite3 ldap cdb

I'm using make config in FLAVOR=default. I believe this is what you want?
Comment 112 Jordan Ostreff 2026-07-18 12:30:31 UTC
Created attachment 272957 [details]
mail/dovecot24 creation with ver 2.4.4 v11

added more FLAVORS

# make -V FLAVORS
default mysql pgsql sqlite3 ldap cdb
Comment 113 Jordan Ostreff 2026-07-18 21:06:52 UTC
Created attachment 272976 [details]
mail/dovecot24 creation with ver 2.4.4 v12

Fixes of FLAVORS.
Comment 114 Jordan Ostreff 2026-07-19 09:22:38 UTC
Created attachment 272991 [details]
mail/dovecot24 creation with ver 2.4.4 v13

Some small fixes in pkg-plist. 
Tested all FLAVORS on FreeBSD stable/15 on amd64. 

Waiting some feedback.
Comment 115 Jordan Ostreff 2026-07-19 09:41:07 UTC
(In reply to Ulas SAYGIN from comment #107)
All mentioned by you was fixed in v13 of the creation patch. Please retest.

Regarding imap-hibernate on FreeBSD 15+ here is the proof that it works:

# doveadm who
username            # service (pids)  (ips)
jordan@ostreff.info 1 imap    (36023) (2001:470:20e7:0:c1db:f19:8bad:1e7f)
jordan@ostreff.info 2 imap-hibernate (35550) (46.10.221.52)
Comment 116 Ulas SAYGIN 2026-07-27 18:48:28 UTC
(In reply to Jordan Ostreff from comment #115)
thank you for reminder but i looked what i said , you are wrong and i also found that all changes was deleted because of some issues related other ports.
i also looked last status and i also created another ticket.ticket is below

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296790

if your upgrade solved everthing you did here. than it is ok.

dear  Jordan Ostreff  thank you for adding flavours. i will test what you did and tell the result. you can also looked my ticket also for information.

thanks a lot everyone who spends their time.
Comment 117 Ulas SAYGIN 2026-07-30 05:44:01 UTC
(In reply to Jordan Ostreff from comment #115)
are you looking flavors for source code build or pkg packages?
Comment 118 Jordan Ostreff 2026-07-31 16:50:30 UTC
(In reply to Ulas SAYGIN from comment #117)
I'm always using source code build. Or if needed my not-public available pkg repository.
Comment 119 Jordan Ostreff 2026-07-31 16:56:29 UTC
(In reply to Ulas SAYGIN from comment #116)
In Dovecot 2.4.x, FTS is merged/rewritten upstream, so external FTS ports like mail/dovecot-fts-xapian and mail/dovecot-fts-flatcurve are no longer needed/compatible with 2.4.4. Only mail/dovecot24-pigeonhole is maintained for 2.4+. That's why we don't need the complex flavor-dependency matrix for FTS modules in the 2.4.4 update, unlike in the 2.3 tree.
Comment 120 Jordan Ostreff 2026-07-31 16:58:50 UTC
(In reply to Ulas SAYGIN from comment #117)
Also, please note that Dovecot 2.4 introduces a complete redesign of the configuration file format (variable expansion syntax changed from %u to %{user}, mail_location split, mandatory dovecot_config_version settings, etc.). Configs from 2.3 will not work as-is without being migrated. Upstream even provides a dedicated configuration upgrader tool for this transition: https://dovecot.org/upgrader/.
Combine this with the fact that external FTS modules (fts-xapian, fts-flatcurve) are no longer used in 2.4, and it's clear that the upgrade to 2.4.4 requires a very different approach than fixing the 2.3 tree.
Comment 121 Jordan Ostreff 2026-07-31 17:12:22 UTC
Created attachment 273365 [details]
mail/dovecot24-pigeonhole creation with ver 2.4.4 v6

Key Details & Changes:
⚬	Upstream Version: Update to Pigeonhole 2.4.4 (matching mail/dovecot24).
⚬	Flavor Awareness: Implemented FLAVORS=default mysql pgsql sqlite3 ldap cdb to mirror mail/dovecot24. Dependencies are explicitly bound using mail/dovecot24@${FLAVOR} to avoid cross-flavor dependency conflicts.
⚬	QA & Compliance:
⚬	Clean output from portclippy and portfmt.
⚬	Verified builds and dependencies across defined flavors.
Comment 122 Herbert J. Skuhra 2026-08-05 06:20:59 UTC
Will this ever be commited? 

ler@ is maintainer of mail/dovecot and mail/dovecot-pigeonhole and obviously not interested in dovecot 2.4.x. At least I don't see any feedback. So why wait for maintainer-feedback from him/her?
Comment 123 Kurt Jaeger freebsd_committer freebsd_triage 2026-08-05 06:22:30 UTC
(In reply to Herbert J. Skuhra from comment #122)
we don't wait for ler@, it's just that the flood of entries in this PR and a lack of time to test the portbuild is the cause of the hold-up.

I'll have a look at it in the next few days.
Comment 124 Jordan Ostreff 2026-08-05 22:23:58 UTC
Created attachment 273496 [details]
mail/dovecot24-pigeonhole creation with ver 2.4.4 v14

### Update to v14

* This patch version contains an official update proposal directly from the **Dovecot developers**.
* **Key changes & improvements in v14:**
  * **Flavors & Dependencies:** Refined flavor handling (mysql, pgsql, sqlite3, ldap, cdb) to ensure correct dependency resolution and `PLIST_SUB` substitution without relying unnecessarily on the standard `OPTIONS` framework for non-default flavors.
  * **FreeBSD Version Guard for `imap-hibernate`:** Added strict checks for `FreeBSD` version (< 15.0) to appropriately toggle `IMAP_HIBERNATE` support based on OS capability.
  * **Patch Integration:** Included `patch-src_imap_imap-client-hibernate.c` to prevent invalid `peer_st.st_dev` evaluation during client hibernation.
  * **RC Script & Packaging:** Minor polish to `files/dovecot.in` (jail/svcj support) and updated `pkg-message.in` using the modern JSON format for FreeBSD ports.

PR / Patch updated and ready for review/testing.
Comment 125 Jordan Ostreff 2026-08-06 10:44:44 UTC
(In reply to Kurt Jaeger from comment #123)
Hi Kurt,

To make your review as smooth as possible:

1. Attached patch v14 / pigeonhole v6 / is up to date and includes the complete fix/refactoring provided directly by the upstream Dovecot developers.
2. The fix for the FreeBSD 15.x `imap-hibernate` issue ("Invalid peer_dev_major value") has been fully tested and confirmed working with the Dovecot team.

Whenever you get a chance to test the portbuild, v14/v6 is the definitive version ready for review.

Thanks!

KR, 
Jordan
Comment 126 Jordan Ostreff 2026-08-06 10:45:38 UTC
Created attachment 273498 [details]
mail/dovecot24 creation with ver 2.4.4 v14
Comment 127 Jordan Ostreff 2026-08-11 20:41:55 UTC
(In reply to Kurt Jaeger from comment #123)
Are there any findings from your investigation that you can share?
Comment 128 Jordan Ostreff 2026-08-11 20:45:49 UTC
(In reply to Kurt Jaeger from comment #123)

Apologies for the previous comment, please disregard it. 

Just wanted to check if you've had a chance to test the portbuild yet.
Comment 129 Michael Grimm 2026-08-17 13:37:34 UTC
Created attachment 273852 [details]
mail/dovecot24-wormhole

This will re-implement the lost replication feature starting Dovecot 2.4

This port will compile using 'poudriere bulk ...', but I cannot test it yet, because I am waiting for dovecot24 to land ;-)

And @jordan: I assigned you the maintainer because I won't have the time to be one. Fell free to assign someone else, if you won't take maintainership either.

HTH, Michael
Comment 130 Diego Linke 2026-08-17 19:10:56 UTC
*** Bug 294269 has been marked as a duplicate of this bug. ***
Comment 131 Kurt Jaeger freebsd_committer freebsd_triage 2026-08-17 20:11:46 UTC
(In reply to Jordan Ostreff from comment #126)
testbuilds@work, 151 was fine.
Comment 132 Jordan Ostreff 2026-08-18 09:12:39 UTC
(In reply to Kurt Jaeger from comment #131)
Thanks a lot for the update, Kurt! Great to hear the test builds passed.

@Michael: Thanks for attaching the wormhole patch! Once dovecot24 lands in the tree, I'll test it out and look into maintaining it as well.

Ready for commit!
Comment 133 commit-hook freebsd_committer freebsd_triage 2026-08-20 18:46:44 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=69eaa4454ab4c27852d1f8fbebbb84409e5b6ba5

commit 69eaa4454ab4c27852d1f8fbebbb84409e5b6ba5
Author:     Jordan Ostreff <jordan@ostreff.info>
AuthorDate: 2026-08-20 18:39:54 +0000
Commit:     Kurt Jaeger <pi@FreeBSD.org>
CommitDate: 2026-08-20 18:39:54 +0000

    mail/dovecot24: new port

    - adding the new version 2.4 of dovecot, while keeping 2.3 in place
    - please note that the config syntax has changed between 2.3
      and 2.4 and needs to be manually adapted, so use/upgrade with care

    PR:             286695
    Reported by:    Ian Dickens <ian_dickens@icloud.com>
    Author:         Jordan Ostreff <jordan@ostreff.info>
    Co-authored-by: Sebastian Oswald <sko@rostwald.de>
    Discussed with: Sebastian Oswald <sko@rostwald.de>,
                    Eugene R <genie@geniechka.ru>,
                    Herbert J. Skuhra <herbert@gojira.at>,
                    Christos Chatzaras <chris@cretaforce.gr>,
                    and others
    Tested by:      Jordan Ostreff <jordan@ostreff.info>

 mail/Makefile                                      |   1 +
 mail/dovecot24/Makefile (new)                      | 261 ++++++
 mail/dovecot24/distinfo (new)                      |   3 +
 mail/dovecot24/files/dovecot.in (new)              |  94 +++
 .../patch-src_imap_imap-client-hibernate.c (new)   |  12 +
 mail/dovecot24/files/pkg-message.in (new)          |  43 +
 mail/dovecot24/pkg-descr (new)                     |   9 +
 mail/dovecot24/pkg-plist (new)                     | 872 +++++++++++++++++++++
 8 files changed, 1295 insertions(+)
Comment 134 Kurt Jaeger freebsd_committer freebsd_triage 2026-08-20 18:47:35 UTC
(In reply to Michael Grimm from comment #129)
can you make a new PR for this new port ?
Comment 135 Kurt Jaeger freebsd_committer freebsd_triage 2026-08-20 18:48:41 UTC
I'll keep this PR open for fallout for the next few days.
Comment 136 Jordan Ostreff 2026-08-20 20:37:44 UTC
(In reply to Kurt Jaeger from comment #135)
Thanks!
Waiting for mail/dovecot24-pigeonhole to be committed to the tree as well.
Comment 137 Michael Grimm 2026-08-21 06:46:18 UTC
(In reply to Kurt Jaeger from comment #134)

Done, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297703
Comment 138 Michael Grimm 2026-08-21 06:48:28 UTC
(In reply to Jordan Ostreff from comment #132)

I have assigned you as maintainer for mail/dovecot24-wormhole

see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297703
Comment 139 Martin Waschbüsch 2026-08-21 08:48:29 UTC
I just stumbled across a problem:
If you unset LUA option, the port will not compile.

pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/include/dovecot/dict-lua-private.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/include/dovecot/dict-lua.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/include/dovecot/dlua-compat.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/include/dovecot/dlua-script-private.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/include/dovecot/dlua-script.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/include/dovecot/dlua-wrapper.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/include/dovecot/dns-lua.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/include/dovecot/doveadm-client-lua.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/include/dovecot/mail-lua-plugin.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/include/dovecot/mail-lua-settings.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/include/dovecot/mail-storage-lua-private.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/include/dovecot/mail-storage-lua.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/lib/dovecot/lib01_mail_lua_plugin.a:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/lib/dovecot/lib01_mail_lua_plugin.so:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/lib/dovecot/lib22_push_notification_lua_plugin.a:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/lib/dovecot/lib22_push_notification_lua_plugin.so:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/lib/dovecot/libdovecot-lua.a:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/lib/dovecot/libdovecot-lua.so:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/lib/dovecot/libdovecot-lua.so.0:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/lib/dovecot/libdovecot-lua.so.0.0.0:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/lib/dovecot/libdovecot-storage-lua.a:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/lib/dovecot/libdovecot-storage-lua.so:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/lib/dovecot/libdovecot-storage-lua.so.0:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/mail/dovecot24/work-pgsql/stage/usr/local/lib/dovecot/libdovecot-storage-lua.so.0.0.0:No such file or directory


I guess this is because pkg-plist lists stuff like

lib/dovecot/lib01_mail_lua_plugin.a
lib/dovecot/lib01_mail_lua_plugin.so

etc. even if LUA-plugin is disabled.
Comment 140 Herbert J. Skuhra 2026-08-21 09:42:29 UTC
(In reply to Martin Waschbüsch from comment #139)
Yeah, the %%LUA%% was removed from pkg-plist. I added them in:

https://bugs.freebsd.org/bugzilla/attachment.cgi?id=272010&action=diff
Comment 141 Jordan Ostreff 2026-08-21 10:18:11 UTC
Created attachment 273954 [details]
mail/dovecot24 fix LUA pkg-plist

When the LUA option is turned off for mail/dovecot24, the build/staging stage fails because several Lua-related headers and library files are unconditionally listed in pkg-plist.

This patch adds the missing LUA substitution logic to Makefile and prefixes the affected files in pkg-plist with %%LUA%% so they are ignored when the option is disabled.

PR / Reporter: Martin Waschbüsch
Comment 142 Jordan Ostreff 2026-08-21 10:26:42 UTC
Created attachment 273955 [details]
mail/dovecot24 fix LUA pkg-plist

PORTREVISION=  1
Comment 143 Jordan Ostreff 2026-08-21 10:28:19 UTC
(In reply to Herbert J. Skuhra from comment #140)
Thanks @Herbert for pointing out the missing %%LUA%% tags! I've updated the patch to also include the Makefile PLIST_SUB logic and bumped PORTREVISION.
Comment 144 Herbert J. Skuhra 2026-08-21 10:34:47 UTC
(In reply to Jordan Ostreff from comment #143)
Are you sure that is needed? Here it works by only updating pkg-plist.
Comment 145 Jordan Ostreff 2026-08-21 18:24:55 UTC
(In reply to Herbert J. Skuhra from comment #144)

You are right that OPTIONS_SUB=yes handles basic PLIST_SUB automatically for options in OPTIONS_DEFINE. 

However, since this Makefile explicitly defines PLIST_SUB entries for other optional features (like LDAP and IMAP_HIBERNATE), I added it explicitly to maintain consistency with the existing Makefile structure.

Either way, bumping PORTREVISION and tagging the files in pkg-plist with %%LUA%% fixes the stage-qa/staging failure when LUA option is unselected.
Comment 146 Martin Waschbüsch 2026-08-24 09:01:01 UTC
About pigeonhole:

I tried with poudriere and the current patch in this PR (v6).
Chosing a flavor (pgsql in my case), poudriere complains thus:

[00:00:06] Warning: mail/dovecot24-pigeonhole@pgsql dependency on mail/dovecot24 has wrong PKGNAME of 'dovecot24@pgsql' but should be 'dovecot24'; Is the dependency missing a @FLAVOR?

In the Makefile it says:

BUILD_DEPENDS= dovecot24>=2.4.4:mail/dovecot24@${FLAVOR}
RUN_DEPENDS=   dovecot24>=2.4.4:mail/dovecot24@${FLAVOR}

Howver, with a flavor, the syntax should be (if I am not mistaken):

# Dependencies
BUILD_DEPENDS=  dovecot24-${FLAVOR}>=2.4.4:mail/dovecot24@${FLAVOR}
RUN_DEPENDS=    dovecot24-${FLAVOR}>=2.4.4:mail/dovecot24@${FLAVOR}

The problem with that is that no flavor no longer works, so (off the top of my head - no expert on Makefile syntax) it would have to be something like this:

BUILD_DEPENDS= dovecot24>=2.4.4:mail/dovecot24
RUN_DEPENDS=   dovecot24>=2.4.4:mail/dovecot24
.if ${FLAVOR:U} != ""
BUILD_DEPENDS=  dovecot24-${FLAVOR}>=2.4.4:mail/dovecot24@${FLAVOR}
RUN_DEPENDS=    dovecot24-${FLAVOR}>=2.4.4:mail/dovecot24@${FLAVOR}
.endif
Comment 147 Alexander Wittig 2026-08-24 09:04:49 UTC
*** Bug 297760 has been marked as a duplicate of this bug. ***
Comment 148 Michael Grimm 2026-08-24 10:55:52 UTC
(In reply to Martin Waschbüsch from comment #146)

IMHO that should be:

BUILD_DEPENDS=  dovecot24${PKGNAMESUFFIX}>=2.4.4:mail/dovecot24@${FLAVOR}
RUN_DEPENDS=    dovecot24${PKGNAMESUFFIX}>=2.4.4:mail/dovecot24@${FLAVOR}

This works with and without a FLAVOR set, because PKGNAMESUFFIX is defined as follows (line 6):

PKGNAMESUFFIX=  ${FLAVOR:Ndefault:C/.+/-${FLAVOR}/}

HTH, Michael
Comment 149 Martin Waschbüsch 2026-08-24 11:33:30 UTC
(In reply to Michael Grimm from comment #148)
Much cleaner! Thx.
Comment 151 Jordan Ostreff 2026-08-29 21:16:27 UTC
new version of dovecot software 2.4.5 
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298045
new port of mail/dovecot24-pigeonhole - this is sieve support by dovecot - it works only with dovecot 2.4.5. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298046

Please if somebody can close this PR here - I don't have permission to do it.
Comment 152 Jordan Ostreff 2026-08-29 21:18:17 UTC
(In reply to Herbert J. Skuhra from comment #150)
Created 2 separate PR as mentioned by me into thread here. 
This is new version
# pkg info | grep dovecot24
dovecot24-2.4.5                Secure, fast and powerful IMAP and POP3 server
dovecot24-pigeonhole-2.4.5     Sieve plugin for the Dovecot '2.4' IMAP and POP3 server
Comment 153 Kurt Jaeger freebsd_committer freebsd_triage 2026-08-30 01:03:36 UTC
Thanks for all involved!