mail/courier-imap: Apply hack to fix reported runtime issue

A runtime issue has been reported at [1] which causes courier-imap
to not work properly.

Experimenting shows this issue disappears by downgrading
devel/libunistring to previous version 1.2, but no clear reason why
has been uncovered.

This commit applies a patch similar to what is suggested in [1]
that makes it work as expected.

[1] https://lists.freebsd.org/archives/freebsd-questions/2025-February/006307.html

Reported by:	Benjamin Lutz <mail@maxlor.com>
This commit is contained in:
Guido Falsi 2025-04-07 13:20:25 +02:00
parent 86de5a07c0
commit c79b6d121b
2 changed files with 20 additions and 0 deletions

View file

@ -1,5 +1,6 @@
PORTNAME= courier-imap
PORTVERSION= 5.2.10
PORTREVISION= 1
PORTEPOCH= 2
CATEGORIES= mail
MASTER_SITES= SF/courier/imap/${PORTVERSION}

View file

@ -0,0 +1,19 @@
--- libs/maildir/maildircreate.c.orig 2022-05-23 09:00:05 UTC
+++ libs/maildir/maildircreate.c
@@ -146,6 +146,7 @@ static int maildir_tmpcreate_fd_do(struct maildir_tmpc
strcat(info->tmpname, hostname);
strcat(info->tmpname, len_buf);
+ errno = 0;
if (stat( info->tmpname, &stat_buf) == 0)
{
maildir_tmpcreate_free(info);
@@ -153,7 +154,7 @@ static int maildir_tmpcreate_fd_do(struct maildir_tmpc
return -1;
}
- if (errno != ENOENT)
+ if (errno != 0 && errno != ENOENT)
{
maildir_tmpcreate_free(info);
if (errno == EAGAIN)