commit c5e967f94d94c151b9f5ed7900bf09a1e4ff396d
Author: Oswald Buddenhagen <o...@users.sf.net>
Date:   Wed Nov 24 16:55:52 2021 +0100

    add support for LITERAL- extension
    
    it's the same as LITERAL+, only with a strongly limited payload size.

 src/drv_imap.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index cfb2bfa4..fd95078d 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -234,6 +234,7 @@ enum CAPABILITY {
 #endif
        UIDPLUS,
        LITERALPLUS,
+       LITERALMINUS,
        MOVE,
        NAMESPACE,
        COMPRESS_DEFLATE
@@ -249,6 +250,7 @@ static const char *cap_list[] = {
 #endif
        "UIDPLUS",
        "LITERAL+",
+       "LITERAL-",
        "MOVE",
        "NAMESPACE",
        "COMPRESS=DEFLATE"
@@ -315,7 +317,8 @@ send_imap_cmd( imap_store_t *ctx, imap_cmd_t *cmd )
        if (cmd->param.data) {
                assert( cmdl > 2 && !memcmp( cmd->cmd + cmdl - 2, "+}", 2 ) );
                if ((!cmd->param.to_trash || ctx->trashnc != TrashUnknown) &&
-                   CAP(LITERALPLUS) && cmd->param.data_len <= 100*1024) {
+                   ((CAP(LITERALPLUS) && cmd->param.data_len <= 100*1024) ||
+                    (CAP(LITERALMINUS) && cmd->param.data_len <= 4*1024))) {
                        litplus = 1;
                } else {
                        cmd->cmd[cmdl - 2] = '}';


_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to