From 761d756577355ad654785e05c52b5526f972e01b Mon Sep 17 00:00:00 2001 From: John Vogel Date: Sun, 12 Nov 2023 02:20:39 -0500 Subject: local/fdm: pull in upstream patches --- ...ommand-to-POP3-server-ignore-the-response.patch | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 fdm/0004-Send-UTF8-command-to-POP3-server-ignore-the-response.patch (limited to 'fdm/0004-Send-UTF8-command-to-POP3-server-ignore-the-response.patch') diff --git a/fdm/0004-Send-UTF8-command-to-POP3-server-ignore-the-response.patch b/fdm/0004-Send-UTF8-command-to-POP3-server-ignore-the-response.patch new file mode 100644 index 0000000..07aaf27 --- /dev/null +++ b/fdm/0004-Send-UTF8-command-to-POP3-server-ignore-the-response.patch @@ -0,0 +1,50 @@ +From 0918b78a82a789d63cebe44b7662f0a8dc603000 Mon Sep 17 00:00:00 2001 +From: Nicholas Marriott +Date: Mon, 4 Sep 2023 09:03:47 +0100 +Subject: [PATCH 4/4] Send UTF8 command to POP3 server (ignore the response), + because some servers don't like UTF-8 without it. + +--- + pop3-common.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/pop3-common.c b/pop3-common.c +index 0724887..e038172 100644 +--- a/pop3-common.c ++++ b/pop3-common.c +@@ -54,6 +54,7 @@ int pop3_invalid(struct account *, const char *); + int pop3_state_connect(struct account *, struct fetch_ctx *); + int pop3_state_starttls(struct account *, struct fetch_ctx *); + int pop3_state_connected(struct account *, struct fetch_ctx *); ++int pop3_state_utf8(struct account *, struct fetch_ctx *); + int pop3_state_user(struct account *, struct fetch_ctx *); + int pop3_state_cache1(struct account *, struct fetch_ctx *); + int pop3_state_cache2(struct account *, struct fetch_ctx *); +@@ -436,6 +437,24 @@ pop3_state_connected(struct account *a, struct fetch_ctx *fctx) + } + } + ++ if (pop3_putln(a, "UTF8") != 0) ++ return (FETCH_ERROR); ++ fctx->state = pop3_state_utf8; ++ return (FETCH_BLOCK); ++} ++ ++/* UTF8 state. */ ++int ++pop3_state_utf8(struct account *a, struct fetch_ctx *fctx) ++{ ++ struct fetch_pop3_data *data = a->data; ++ char *line; ++ ++ if (pop3_getln(a, fctx, &line) != 0) ++ return (FETCH_ERROR); ++ if (line == NULL) ++ return (FETCH_BLOCK); ++ + if (pop3_putln(a, "USER %s", data->user) != 0) + return (FETCH_ERROR); + fctx->state = pop3_state_user; +-- +2.42.0 + -- cgit v1.2.3