summaryrefslogtreecommitdiff
path: root/mailnews/imap
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2019-11-10 18:06:51 -0500
committerMatt A. Tobin <email@mattatobin.com>2019-11-10 18:06:51 -0500
commita9ac9091e79b1d59e5f31a6883a83e1885dff699 (patch)
treeaee73f2b42457303fc1623c21f3c36d7e408269b /mailnews/imap
parentdd5e8abec75e2ae5a1119eb60edb41104c2ae603 (diff)
downloadaura-central-a9ac9091e79b1d59e5f31a6883a83e1885dff699.tar.gz
Bug 1404049 - fix that mail.imap.use_literal_plus set to false may have no effect.
This is because it was only used in response to a CAPABILITY imap request. However, often CAPABILITY response occurs without a request so TB sees no need to do a request. Fix by moving the usage of use_literal_plus to where LITERAL+ capability is actually used. Tag mcp-graveyard/UXP%1273
Diffstat (limited to 'mailnews/imap')
-rw-r--r--mailnews/imap/src/nsImapProtocol.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/mailnews/imap/src/nsImapProtocol.cpp b/mailnews/imap/src/nsImapProtocol.cpp
index 9d943f7ec..dee4ff169 100644
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -5418,14 +5418,6 @@ void nsImapProtocol::Capability()
nsresult rv = SendData(command.get());
if (NS_SUCCEEDED(rv))
ParseIMAPandCheckForNewMail();
- if (!gUseLiteralPlus)
- {
- eIMAPCapabilityFlags capabilityFlag = GetServerStateParser().GetCapabilityFlag();
- if (capabilityFlag & kLiteralPlusCapability)
- {
- GetServerStateParser().SetCapabilityFlag(capabilityFlag & ~kLiteralPlusCapability);
- }
- }
}
void nsImapProtocol::ID()
@@ -6091,8 +6083,6 @@ void nsImapProtocol::UploadMessageFromFile (nsIFile* file,
nsresult rv;
bool eof = false;
nsCString flagString;
- bool hasLiteralPlus = (GetServerStateParser().GetCapabilityFlag() &
- kLiteralPlusCapability);
nsCOMPtr <nsIInputStream> fileInputStream;
@@ -6155,7 +6145,13 @@ void nsImapProtocol::UploadMessageFromFile (nsIFile* file,
rv = NS_NewLocalFileInputStream(getter_AddRefs(fileInputStream), file);
if (NS_FAILED(rv) || !fileInputStream) goto done;
command.AppendInt((int32_t)fileSize);
- if (hasLiteralPlus)
+
+ // Set useLiteralPlus to true if server has capability LITERAL+ and
+ // LITERAL+ useage is enabled in the config editor,
+ // i.e., "mail.imap.use_literal_plus" = true.
+ bool useLiteralPlus = (GetServerStateParser().GetCapabilityFlag() &
+ kLiteralPlusCapability) && gUseLiteralPlus;
+ if (useLiteralPlus)
command.Append("+}" CRLF);
else
command.Append("}" CRLF);
@@ -6163,7 +6159,7 @@ void nsImapProtocol::UploadMessageFromFile (nsIFile* file,
rv = SendData(command.get());
if (NS_FAILED(rv)) goto done;
- if (!hasLiteralPlus)
+ if (!useLiteralPlus)
ParseIMAPandCheckForNewMail();
totalSize = fileSize;