diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2024-06-12 17:11:29 +0200 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2024-06-12 17:11:29 +0200 |
commit | 820d861066ab444a7fa14ca16b40352e7fdf43f1 (patch) | |
tree | 54b2314ce75ec77986cac01e4b310162ee57eb35 | |
parent | e1f9d4ea365b73a8b1607d5bf4ce9ca131f066a3 (diff) |
add IPC documentation and bump version
-rw-r--r-- | README_IPC.md | 59 | ||||
-rw-r--r-- | src/jwebmail/__init__.py | 2 |
2 files changed, 60 insertions, 1 deletions
diff --git a/README_IPC.md b/README_IPC.md new file mode 100644 index 0000000..b9d754a --- /dev/null +++ b/README_IPC.md @@ -0,0 +1,59 @@ +About the Inter Process Communication Protocol +============================================== + +JWebmail needs to read a users mail box in maildir format. +JWebmail runs under its own user also called jwebmail. +The mailbox has rights of its own user or there is +a special user for all mailboxes. To gain access there is a setuid program +called qmail-authuser that checks acces rights and starts another program. +This program is called `extractor`. + +Version 1 +--------- + +Previously all arguments where passed by command line arguments and json +was returned. +Binary data was sent after a json header and a newline. + +Version 2 +--------- + +Now protobuf is used for message interchange. + +Currently a process in spawned for every command. +The method is given as a process argument and the arguments are a single +message on stdin which is close afterwards. The response is a single protobuf +message on stdout after which the process exits. + +Version 3 +--------- + +In the future one process is spawned for every jwebmail request. +For this the method name must be dynamic. + +I propose the following protocol: + + request + 32 bit big endian unsigned integer + ascii string (method name) + 32 bit big endian unsigned integer + protobuf message + + response + 32 bit big endian unsigned integer + protobuf message + +On end the request file descriptor is closed. +An error may close stdout early. + +Exit codes +---------- + +- 1 qma +- 2 qma +- 3 err response +- 4 user error +- 5 issue switching to user +- 6 operation not supported +- 110 qma +- 111 qma diff --git a/src/jwebmail/__init__.py b/src/jwebmail/__init__.py index 7a165e0..01b364b 100644 --- a/src/jwebmail/__init__.py +++ b/src/jwebmail/__init__.py @@ -35,7 +35,7 @@ else: toml_read_file = dict(load=toml_load, text=True) -__version__ = "2.2.1.dev5" +__version__ = "2.2.1.dev6" csrf = CSRFProtect() |