summaryrefslogtreecommitdiffstats
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
commit02dc2390ee4a67600318e2f8df9062adaf83b3dc (patch)
treeaee73f2b42457303fc1623c21f3c36d7e408269b
parent58a7cff161d1af1631b67c533d59c39b0adcabda (diff)
downloadUXP-02dc2390ee4a67600318e2f8df9062adaf83b3dc.tar
UXP-02dc2390ee4a67600318e2f8df9062adaf83b3dc.tar.gz
UXP-02dc2390ee4a67600318e2f8df9062adaf83b3dc.tar.lz
UXP-02dc2390ee4a67600318e2f8df9062adaf83b3dc.tar.xz
UXP-02dc2390ee4a67600318e2f8df9062adaf83b3dc.zip
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 #1273
-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;