Skip to content

Commit

Permalink
Correctly enable UTF8 on proxied POP3 connections.
Browse files Browse the repository at this point in the history
  • Loading branch information
svarshavchik committed Aug 30, 2024
1 parent ff7b5e1 commit 72315c8
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
7 changes: 7 additions & 0 deletions imap/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
5.2.10

2024-08-29 Sam Varshavchik <[email protected]>

* pop3login.c (login_pop3): Fix a problem when proxying UTF8 POP3
connections.

5.2.9

2024-08-05 Sam Varshavchik <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion imap/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dnl
dnl Copyright 1998 - 2022 Double Precision, Inc. See COPYING for
dnl distribution information.

AC_INIT([courier-imap],[5.2.9],[[email protected]])
AC_INIT([courier-imap],[5.2.10],[[email protected]])

>confdefs.h # Kill PACKAGE_ macros

Expand Down
24 changes: 23 additions & 1 deletion imap/pop3login.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Copyright 1998 - 2021 Double Precision, Inc.
** Copyright 1998 - 2024 Double Precision, Inc.
** See COPYING for distribution information.
*/

Expand Down Expand Up @@ -565,6 +565,28 @@ static int login_pop3(int fd, const char *hostname, void *void_arg)
return -1;
}

if (utf8_enabled)
{
if (proxy_write(fd, hostname, "UTF8\r\n", 6))
{
return -1;
}

if (proxy_readline(fd, &pb, linebuf, sizeof(linebuf), 1) < 0)
{
return -1;
}

DPRINTF("%s: %s", hostname, linebuf);

if (linebuf[0] != '+')
{
fprintf(stderr, "WARN: UTF8 rejected by %s\n",
hostname);
return -1;
}
}

cmd=malloc(strlen(ppi->uid) + strlen(ppi->pwd)+100);
/* Should be enough */

Expand Down

0 comments on commit 72315c8

Please sign in to comment.