Documents (webmail)
Documents is the collaborative office suite built into the HiTechCloud webmail. It lets the
mailboxes of one hosting account create and edit documents, spreadsheets and presentations
together in real time, review each other's changes, discuss inside the document, share with
guests by link, and exchange files with Microsoft Office in .docx, .xlsx and .pptx.
Everything runs on your own server: the webmail's Node backend and PostgreSQL. No third-party service is contacted at any point.
Turning it on​
Documents is a webmail plugin that is on by default: a Documents entry appears in
the webmail sidebar and at /docs. A user who does not want it can switch it off under
Settings → Plugins → Documents.
Working with documents​
The Documents home shows three lists — Recent, My documents and Shared with me — and lets you create a new Document, Spreadsheet or Presentation, or Upload a file to import (drag and drop works too).
| Kind | Editor | What you get |
|---|---|---|
| Document | Rich-text editor (TipTap) | Headings, lists, task lists, tables, images, links, highlight, colours, alignment, code, quotes |
| Spreadsheet | Grid with formulas | Multiple sheets, Excel-style formulas (=SUM(A1:A9), =IF(...), =VLOOKUP(...), several hundred functions), copy/paste of ranges, resizable columns |
| Presentation | Slide editor | Slide list, layouts (title, title + content, two columns, blank), movable/resizable text and image boxes, speaker notes, full-screen Present mode |
Real-time collaboration​
Every document is a CRDT (Yjs). Each collaborator edits a local copy that is merged with everyone else's automatically — there is no locking and no "save" button. Edits are pushed to the server as they happen and stored in PostgreSQL immediately, so a crash or a dropped connection never loses accepted work; an offline editor re-syncs when the connection is back.
Collaborators see each other as coloured avatars in the header, as named carets in a document, as a coloured cell outline in a spreadsheet and as a dot on the slide they are looking at.
Track changes (review mode)​
Open Review in a document to:
- switch on Suggesting mode — your typing and deletions are recorded as suggestions (green insertions, red strikethrough deletions) attributed to you instead of changing the text directly;
- accept or reject each suggestion, or all at once;
- switch the view between Markup, With changes (as if everything were accepted) and Original (as if everything were rejected). Exports use the "With changes" view.
Suggesting mode tracks text insertions and deletions inside paragraphs. Structural edits (splitting or joining paragraphs, turning text into a list, formatting) are applied directly.
Versions and sign-off​
Versions saves a named snapshot of the whole document at any time, previews any saved version, and restores it (the current state is saved as a version first, so nothing is lost). A reviewer can sign off a version to mark it as the approved, final state; the sign-off shows who approved it and when.
Comments and discussion​
- Comments anchor a thread to a text selection (select text, press 💬). Threads can be replied to, resolved and reopened; clicking a thread jumps to the text.
- Chat is a discussion panel for the whole document. Messages are stored with the document and appear live for everyone who has it open.
Sharing​
The owner opens Share to:
- share with teammates — other mailboxes on the same hosting account — as Can view or Can edit. A share only works while both mailboxes belong to the same hosting account; this is re-checked on every request, so a domain that changes hands stops sharing immediately;
- create guest links (
/docs/s/<token>) with view or edit rights, an optional password and an optional expiry. Guests need no account: they enter a display name (and the password) and take part like any other collaborator. Revoking or expiring a link cuts off guests who already joined.
Import and export​
Conversion happens on the server, in Node. Nothing is uploaded anywhere else.
| Format | Import | Export |
|---|---|---|
Word .docx | Yes (mammoth) — headings, paragraphs, bold/italic/underline/strike, lists, tables, links, embedded images | Yes (docx) — headings, formatting, lists, task lists, tables, images, links, alignment, highlight, colours |
Excel .xlsx (also .xlsm, .xls, .csv, .ods) | Yes (SheetJS) — values and formula text of every sheet, column widths | Yes (SheetJS) — values, formulas and column widths; formulas are written with cached values from the editor and fullCalcOnLoad, so Excel/LibreOffice recalculate on open |
PowerPoint .pptx | Best effort — text boxes (text, size, bold, alignment, position) and pictures of each slide | Yes (pptxgenjs) — one slide per slide, text boxes with font size/style/colour/alignment, images, background colour, speaker notes |
| HTML / text | Yes | JSON |
Fidelity limitations (please read)​
Documents is an editor with its own document model, not a copy of Microsoft Office. Files round-trip content, not every detail of presentation:
- Word: page layout (margins, columns, sections, headers/footers, page numbers), styles beyond headings, fonts embedded in the file, footnotes, fields, drawings/SmartArt/charts and Word's own tracked changes and comments are not imported (Word's tracked insertions are kept as normal text, deletions are dropped). Exported files use a clean default style.
- Excel: cell styles, number formats, merged cells, conditional formatting, data
validation, charts, images, pivot tables and macros are not carried through — SheetJS
community edition reads the values and formulas only, and a workbook exported from Documents
never contains them. Formulas are evaluated by the browser grid; a function the grid does not
know shows
#ERROR!in Documents but is still exported as written. - PowerPoint: themes, master layouts, animations, transitions, charts, tables, SmartArt and grouped shapes are not reproduced on import; text and pictures are placed at their original positions. Exported decks contain plain text boxes and images.
For workflows that need pixel-exact Office fidelity, an OnlyOffice or Collabora document
server can be plugged in later: Documents keeps the file-level import/export surface
(/api/docs/:id/export, /api/docs/import) that such a server would replace.
For administrators​
- Storage:
docs_*tables in the webmail database (migration9130_docs.sql). Live content is a Yjs update log (docs_updates) compacted into a snapshot (docs_documents.state) every 100 updates and when the last collaborator leaves; versions are full snapshots. - Realtime: WebSocket at
/ws/docs/<docId>(same origin and session cookie as the mail socket; guest sessions carry their link grant). Nginx already proxies/ws. - Limits: imports up to 30 MB; embedded images up to 4 MB each; spreadsheet imports up to 200,000 cells.
- Integration: other webmail plugins can open or create documents through
window.hitechcloudDocs.open(id),.create(kind, title),.startShared({ title })(which also mints a guest edit link, for meetings) or the plugin eventsdocs:open,docs:create,docs:start-shared. The editor toolbars expose adocs-editor-toolbarslot for the AI assistant.