[geary/wip/789271-mailfence-contact-office-compat: 1/3] Upper-case some commands that Mailfence's server expects to be like that



commit fc8464b96c5887833d103e0c0547823adc7dbf03
Author: Michael Gratton <mike vee net>
Date:   Fri Feb 8 16:02:24 2019 +1100

    Upper-case some commands that Mailfence's server expects to be like that
    
    Despite both IMAP and SMTP being strictly case-insensitive protocols,
    some servers don't like Geary's use of lower case commands.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=789271

 src/engine/imap/command/imap-list-command.vala     |  6 +++++-
 src/engine/imap/command/imap-status-command.vala   |  6 +++++-
 src/engine/imap/message/imap-status-data-type.vala | 21 ++++++++++-----------
 src/engine/smtp/smtp-command.vala                  |  2 +-
 src/engine/smtp/smtp-plain-authenticator.vala      |  2 +-
 5 files changed, 22 insertions(+), 15 deletions(-)
---
diff --git a/src/engine/imap/command/imap-list-command.vala b/src/engine/imap/command/imap-list-command.vala
index d399f244..48eba332 100644
--- a/src/engine/imap/command/imap-list-command.vala
+++ b/src/engine/imap/command/imap-list-command.vala
@@ -6,6 +6,8 @@
  */
 
 /**
+ * The IMAP LIST and proprietary XLIST commands.
+ *
  * See [[http://tools.ietf.org/html/rfc3501#section-6.3.8]]
  *
  * Some implementations may return the mailbox name itself when using wildcarding.  For example:
@@ -17,9 +19,11 @@
  */
 public class Geary.Imap.ListCommand : Command {
 
-    public const string NAME = "list";
+
+    public const string NAME = "LIST";
     public const string XLIST_NAME = "xlist";
 
+
     /**
      * LIST a particular mailbox by {@link MailboxSpecifier}.
      *
diff --git a/src/engine/imap/command/imap-status-command.vala 
b/src/engine/imap/command/imap-status-command.vala
index fde8fecf..388588b5 100644
--- a/src/engine/imap/command/imap-status-command.vala
+++ b/src/engine/imap/command/imap-status-command.vala
@@ -6,13 +6,17 @@
  */
 
 /**
+ * The IMAP STATUS command.
+ *
  * See [[http://tools.ietf.org/html/rfc3501#section-6.3.10]]
  *
  * @see StatusData
  */
 public class Geary.Imap.StatusCommand : Command {
 
-    public const string NAME = "status";
+
+    public const string NAME = "STATUS";
+
 
     public StatusCommand(MailboxSpecifier mailbox, StatusDataType[] data_items) {
         base (NAME);
diff --git a/src/engine/imap/message/imap-status-data-type.vala 
b/src/engine/imap/message/imap-status-data-type.vala
index bebb37ae..d2f169b5 100644
--- a/src/engine/imap/message/imap-status-data-type.vala
+++ b/src/engine/imap/message/imap-status-data-type.vala
@@ -11,7 +11,6 @@
  *
  * @see StatusData
  */
-
 public enum Geary.Imap.StatusDataType {
     MESSAGES,
     RECENT,
@@ -26,20 +25,20 @@ public enum Geary.Imap.StatusDataType {
     public string to_string() {
         switch (this) {
             case MESSAGES:
-                return "messages";
-            
+                return "MESSAGES";
+
             case RECENT:
-                return "recent";
-            
+                return "RECENT";
+
             case UIDNEXT:
-                return "uidnext";
-            
+                return "UIDNEXT";
+
             case UIDVALIDITY:
-                return "uidvalidity";
-            
+                return "UIDVALIDITY";
+
             case UNSEEN:
-                return "unseen";
-            
+                return "UNSEEN";
+
             default:
                 assert_not_reached();
         }
diff --git a/src/engine/smtp/smtp-command.vala b/src/engine/smtp/smtp-command.vala
index 120eaa4f..9761dacc 100644
--- a/src/engine/smtp/smtp-command.vala
+++ b/src/engine/smtp/smtp-command.vala
@@ -38,7 +38,7 @@ public enum Geary.Smtp.Command {
                 return "rset";
             
             case AUTH:
-                return "auth";
+                return "AUTH";
             
             case MAIL:
                 return "mail";
diff --git a/src/engine/smtp/smtp-plain-authenticator.vala b/src/engine/smtp/smtp-plain-authenticator.vala
index ed46fcee..5435e352 100644
--- a/src/engine/smtp/smtp-plain-authenticator.vala
+++ b/src/engine/smtp/smtp-plain-authenticator.vala
@@ -18,7 +18,7 @@ public class Geary.Smtp.PlainAuthenticator : Geary.Smtp.Authenticator {
     }
     
     public override Request initiate() {
-        return new Request(Command.AUTH, { "plain" });
+        return new Request(Command.AUTH, { "PLAIN" });
     }
     
     public override Memory.Buffer? challenge(int step, Response response) throws SmtpError {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]