Fix sending on Exchange 2007

b/13367907
It turns out that some of the logic to reformat the command
was EasServerConnection, rather than EasOutboxSync.

Change-Id: Ic300ab5a56c0cc77fa28ddfe2c5b83b25587d555
diff --git a/src/com/android/exchange/eas/EasOutboxSync.java b/src/com/android/exchange/eas/EasOutboxSync.java
index 66e0912..96c704a 100644
--- a/src/com/android/exchange/eas/EasOutboxSync.java
+++ b/src/com/android/exchange/eas/EasOutboxSync.java
@@ -6,6 +6,7 @@
 import android.text.format.DateUtils;
 import android.util.Log;
 
+import com.android.emailcommon.internet.MimeUtility;
 import com.android.emailcommon.internet.Rfc822Output;
 import com.android.emailcommon.provider.Account;
 import com.android.emailcommon.provider.Mailbox;
@@ -386,6 +387,16 @@
         }
     }
 
+    @Override
+    public String getRequestContentType() {
+        // When using older protocols, we need to use a different MIME type for sending messages.
+        if (getProtocolVersion() < Eas.SUPPORTED_PROTOCOL_EX2010_DOUBLE) {
+            return MimeUtility.MIME_TYPE_RFC822;
+        } else {
+            return super.getRequestContentType();
+        }
+    }
+
     /**
      * Our own HttpEntity subclass that is able to insert opaque data (in this case the MIME
      * representation of the message body as stored in a temporary file) into the serializer stream
diff --git a/src/com/android/exchange/service/EasServerConnection.java b/src/com/android/exchange/service/EasServerConnection.java
index bf39b15..2a91c41 100644
--- a/src/com/android/exchange/service/EasServerConnection.java
+++ b/src/com/android/exchange/service/EasServerConnection.java
@@ -341,6 +341,8 @@
         final boolean isPingCommand = cmd.equals("Ping");
 
         // Split the mail sending commands
+        // TODO: This logic should not be here, the command should be generated correctly
+        // in a subclass of EasOperation.
         String extra = null;
         boolean msg = false;
         if (cmd.startsWith("SmartForward&") || cmd.startsWith("SmartReply&")) {