Browse Source

protocol documentation, small protocol fix

Kajetan Johannes Hammerle 5 years ago
parent
commit
ea6ec7cfb1
4 changed files with 76 additions and 22 deletions
  1. 1 0
      ServerMain.c
  2. 75 0
      communication
  3. 0 5
      mails/if17b012/if17b012/0
  4. 0 17
      todo

+ 1 - 0
ServerMain.c

@@ -471,6 +471,7 @@ void readMail(char* user, char* number, Stream* out)
                         }
                         streamWriteChar(out, data);
                     }
+                    streamWriteChars(out, ".\n");
                     
                     if(fclose(file) == EOF)
                     {

+ 75 - 0
communication

@@ -0,0 +1,75 @@
+Client -> Server
+‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+Send
+‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+SEND\n
+<receiver, max 8 characters>\n
+<subject, max 80 charaters>\n
+<message lines ...>\n
+.\n
+
+
+List
+‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+LIST\n
+
+
+Read
+‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+READ\n
+<message identifier>\n
+
+
+Del
+‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+DEL\n
+<message identifier>\n
+
+
+
+Server -> Client
+‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+On connection
+‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+<-1 on failure, 1 on success><info message>\n
+
+Send
+‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+- On success
+  OK\n
+- On failure
+  ERR\n 
+
+
+List
+‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+<number of mails>\n
+<mail identifier 1> - <mail subject 1>\n
+<mail identifier 2> - <mail subject 2>\n
+...
+<mail identifier n> - <mail subject n>\n
+
+
+Read
+‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+- On success
+  OK\n
+  <sender, max 8 characters>\n
+  <receiver, max 8 characters>\n
+  <subject, max 80 charaters>\n
+  <message lines ...>\n
+  .\n
+- On failure
+  ERR\n 
+
+
+Del
+‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+- On success
+  OK\n
+- On failure
+  ERR\n 
+
+
+
+

+ 0 - 5
mails/if17b012/if17b012/0

@@ -1,5 +0,0 @@
-if17b012
-if17b012
-Hallo
-Yes ldap works
-yeeess

+ 0 - 17
todo

@@ -1,17 +0,0 @@
-Subjects shouldn't be the exact filename because of names like ".."
-- subjects can be "." or ".." and receivers can no more be "." or ".."
-Lock Mail-ID-File to ensure multi users
-- done
-Port as start parameter
-- done
-
-help command, show commands on connection
-- done
-
-dummy login
-- done
-ldap login
-multiline messages
-- done
-command in protocol
-- protocol completely changed to fit the specification