MU-SERVER(1)

NAME
mu server - the mu backend for the mm e-mail cleint

DESCRIPTION
mu server starts a simple shell in which can manipulate the mu database. The output of the commands is terms of Lisp symbolic expressions (s-exps). mu server is not meant for use by humans; instead, it is designed specifically for the mu4e e-mail client. In this man-page, we document the commands mu server accepts, as well as their responses.

OUTPUT FORMAT
mu server accepts a number of commands, and delivers its results in the form:
   \376<length>\376<s-expr>
\367 (that is, the character with ascii value 254, \376 in octal notation), followed by the length of the s-expression, followed by another \376, followed by the actual s-expression. By prefixing the expression with its length, it can be processed more efficiently. The \376 (254) was chosen since it is a value that will never occur in valid UTF-8 (in which the s-expressions are encoded).

COMMAND AND RESPONSE

ping
    The ping command provokes a pong response. It is used for the initial handshake between mu4e and mu server.
    -> ping
    <- (:pong "mu" :version <version> :doccount <doccount>)

find
    Using the find command we can search for messages.
    -> find "<query>" <maxnum>
    This will return a series of 0 up to <maxnum> s-expression corresponding to each message found (with a negative number for <maxnum> meaning 'unlimited'). The information for each message does not contain the message body; the view command is for that.
    <- (...)
    and finally, we receive:
    <- (:found <number-of-matches>)

move
    Using the move command, we can move messages to another maildir, and update the database correspondingly. The function returns an s-exp describing the updated message, so that it can be updated in the user interface.
    -> move <docid> <maildir> [<flags>]
    <- (:update <s-exp> :move t)

flag
    Using the flag command, we can change the message flags - note that this may imply moving the message to another maildir, when the 'N' (new) flag changes. Update the database correspondingly. The function returns an s-exp describing the updated message, so that it can be updated in the user interface.
    -> move <docid> <maildir> [<flags>]
    <- (:update <s-exp> :move nil)

remove
    Using the remove command, we can remove the message from disk, and update the database accordingly.
    -> remove <docid>
    <- (:remove <docid>)

save
    Using the save command, we can save an attachment from a message to disk.
    -> save <docid> <partindex> <targetpath>
    <- (:info save :message "<filename> has been saved")

open
    Using the save command, we can open an attachment file (using the xdg-open program).
    -> open <docid> <partindex>
    <- (:info open :message "<filename> has been opened")

view
    Using the view command, we can all information (including the body) of a particular e-mail message.
    -> view <docid>
    <- (:view <s-exp>)

compose
    Using the compose command, we get the (unchanged) message, and tell what to do with it. The user-interface is then expect to pre-process the message, e.g. set the subject, sender and recipient for a reply message.
    -> compose <reply|forward|edit> <docid>
    <- (:compose <s-exp> :compose-type <reply|forward|edit>)

index
    Using the index command, we can (re)index the database, similar to what mu find does.
    -> index <maildir>
    As a response, it will send (for each 500 messages):
    (:info index :status running :processed <processed> :updated <updated>)
    and finally:
    (:info index :status complete :processed <processed :updated <updated>
     :cleaned-up <cleaned-up>)

add Using the add command, we can add a message to the database.
    -> add <path> <maildir>
    <- (:info add :path <path> :docid <docid>)

mkdir
    Using the mkdir command, we can create a new maildir.
    -> mkdir <path>
    <- (:info mkdir :message "<maildir> has been created")

AUTHOR
Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>

SEE ALSO
mu(1)