diff options
| author | Sam Varshavchik | 2018-07-14 15:49:32 -0400 |
|---|---|---|
| committer | Sam Varshavchik | 2018-07-14 21:09:38 -0400 |
| commit | 3359e8155147662382d2fd982bcf75a1644901a0 (patch) | |
| tree | 48097c0f020fc8019581447266c9c520834e41ff /imap | |
| parent | fdc3f1b75ed5dbded07c69c1000f31bb7c74f0e0 (diff) | |
| download | courier-libs-3359e8155147662382d2fd982bcf75a1644901a0.tar.bz2 | |
courier-imap: Advertise UTF8=ACCEPT IMAP capability.
Diffstat (limited to 'imap')
| -rw-r--r-- | imap/capability.c | 4 | ||||
| -rw-r--r-- | imap/imapd.c | 32 | ||||
| -rw-r--r-- | imap/imapd.h | 1 |
3 files changed, 35 insertions, 2 deletions
diff --git a/imap/capability.c b/imap/capability.c index 25e77a2..2a83bb8 100644 --- a/imap/capability.c +++ b/imap/capability.c @@ -122,7 +122,7 @@ void imapcapability() if (imap_externalauth()) writes(" AUTH=EXTERNAL"); } - + p=getenv("OUTBOX"); @@ -134,4 +134,6 @@ void imapcapability() if (magictrash()) writes(" XMAGICTRASH"); + + writes(" ENABLE UTF8=ACCEPT"); } diff --git a/imap/imapd.c b/imap/imapd.c index fca7149..38e611b 100644 --- a/imap/imapd.c +++ b/imap/imapd.c @@ -1,5 +1,5 @@ /* -** Copyright 1998 - 2011 Double Precision, Inc. +** Copyright 1998 - 2018 Double Precision, Inc. ** See COPYING for distribution information. */ @@ -140,6 +140,8 @@ char *current_mailbox_acl; dev_t homedir_dev; ino_t homedir_ino; +int enabled_utf8=0; + void rfc2045_error(const char *p) { if (write(2, p, strlen(p)) < 0) @@ -4407,6 +4409,34 @@ int uid=0; return(0); } + if (strcmp(curtoken->tokenbuf, "ENABLE") == 0) + { + while (nexttoken()->tokentype != IT_EOL) + { + switch (curtoken->tokentype) { + case IT_NUMBER: + case IT_ATOM: + case IT_QUOTED_STRING: + if (strcmp(curtoken->tokenbuf, "UTF8=ACCEPT") + == 0) + { + enabled_utf8=1; + } + continue; + default: + return -1; + } + } + + writes("* ENABLED"); + if (enabled_utf8) + writes(" UTF8=ACCEPT"); + writes("\r\n"); + writes(tag); + writes(" OK Options enabled\r\n"); + return (0); + } + if (strcmp(curtoken->tokenbuf, "GETQUOTA") == 0) { curtoken=nexttoken_nouc(); diff --git a/imap/imapd.h b/imap/imapd.h index d7966a1..7325ec9 100644 --- a/imap/imapd.h +++ b/imap/imapd.h @@ -12,6 +12,7 @@ #define NEWMSG_FLAG '*' /* Prefixed to mimeinfo to indicate new msg */ +extern int enabled_utf8; #define is_sharedsubdir(dir) \ (strncmp((dir), SHAREDSUBDIR "/", \ |
