# zimbra/packages architecture

> Architecture diagram of the GitHub repository zimbra/packages, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zimbra/packages
- Repository: https://github.com/zimbra/packages

## Overview

This repository is Zimbra’s third-party dependency packaging system: maintainers add or enter a package wrapper, then build that dependency for Zimbra. The README also documents adding official Aspell dictionaries and registering their packages. The tree and excerpts expose several nginx runtime modules and route utilities, which are represented as a separate capability branch. Source excerpts are partial, so links between those modules and other services are shown only where the evidence supports them.

Main entry points: [`thirdparty/nginx/extras/routeinfo/mroute.py`](https://github.com/zimbra/packages/blob/develop/thirdparty/nginx/extras/routeinfo/mroute.py) (Route management), [`thirdparty/nginx/extras/routing-lookup-handler.py`](https://github.com/zimbra/packages/blob/develop/thirdparty/nginx/extras/routing-lookup-handler.py) (Routing lookup handler), [`thirdparty`](https://github.com/zimbra/packages/tree/develop/thirdparty) (Package wrappers), [`thirdparty/aspell-zimbra`](https://github.com/zimbra/packages/tree/develop/thirdparty/aspell-zimbra) (Aspell dictionaries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_packages["Dependency packages"]
  node_package_wrappers["Package wrappers"]
end

subgraph group_spell["Spell dictionaries"]
  node_aspell_dictionaries["Aspell dictionaries"]
end

subgraph group_nginx["Nginx extensions"]
  node_http_sso["HTTP SSO"]
  node_http_upstream_auth["HTTP auth routing"]
  node_mail_auth["Mail authentication"]
  node_mail_throttle["Mail throttling"]
  node_route_admin["Route management<br/>[mroute.py]"]
  node_route_lookup["Routing lookup handler"]
end

node_maintainer(("Maintainer"))
node_memcached[("Memcached")]
node_upstream_server["Configured upstream"]

node_maintainer -->|"builds packages"| node_package_wrappers
node_maintainer -->|"adds language"| node_aspell_dictionaries
node_route_admin -->|"reads and writes routes"| node_memcached
node_route_lookup -->|"returns route headers"| node_upstream_server

click node_package_wrappers "https://github.com/zimbra/packages/tree/develop/thirdparty"
click node_aspell_dictionaries "https://github.com/zimbra/packages/tree/develop/thirdparty/aspell-zimbra"
click node_http_sso "https://github.com/zimbra/packages/blob/develop/thirdparty/nginx/zmmodules/http/sso/ngx_http_zm_sso_module.c"
click node_http_upstream_auth "https://github.com/zimbra/packages/blob/develop/thirdparty/nginx/zmmodules/http/upstreamzmauth/ngx_http_upstream_zmauth_module.c"
click node_mail_auth "https://github.com/zimbra/packages/blob/develop/thirdparty/nginx/zmmodules/mail/zmauth/ngx_mail_zmauth_module.c"
click node_mail_throttle "https://github.com/zimbra/packages/blob/develop/thirdparty/nginx/zmmodules/mail/throttle/ngx_mail_throttle_module.c"
click node_route_admin "https://github.com/zimbra/packages/blob/develop/thirdparty/nginx/extras/routeinfo/mroute.py"
click node_route_lookup "https://github.com/zimbra/packages/blob/develop/thirdparty/nginx/extras/routing-lookup-handler.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_package_wrappers toneBlue
class node_aspell_dictionaries,node_memcached toneAmber
class node_http_sso,node_http_upstream_auth,node_mail_auth,node_mail_throttle,node_route_admin,node_route_lookup toneMint
class node_maintainer,node_upstream_server toneIndigo
```

## Components

### Dependency packages

- [Package wrappers](https://github.com/zimbra/packages/tree/develop/thirdparty): `thirdparty`

### Spell dictionaries

- [Aspell dictionaries](https://github.com/zimbra/packages/tree/develop/thirdparty/aspell-zimbra): `thirdparty/aspell-zimbra`

### Nginx extensions

- [HTTP SSO](https://github.com/zimbra/packages/blob/develop/thirdparty/nginx/zmmodules/http/sso/ngx_http_zm_sso_module.c): `thirdparty/nginx/zmmodules/http/sso/ngx_http_zm_sso_module.c`
- [HTTP auth routing](https://github.com/zimbra/packages/blob/develop/thirdparty/nginx/zmmodules/http/upstreamzmauth/ngx_http_upstream_zmauth_module.c): `thirdparty/nginx/zmmodules/http/upstreamzmauth/ngx_http_upstream_zmauth_module.c`
- [Mail authentication](https://github.com/zimbra/packages/blob/develop/thirdparty/nginx/zmmodules/mail/zmauth/ngx_mail_zmauth_module.c): `thirdparty/nginx/zmmodules/mail/zmauth/ngx_mail_zmauth_module.c`
- [Mail throttling](https://github.com/zimbra/packages/blob/develop/thirdparty/nginx/zmmodules/mail/throttle/ngx_mail_throttle_module.c): `thirdparty/nginx/zmmodules/mail/throttle/ngx_mail_throttle_module.c`
- [Route management](https://github.com/zimbra/packages/blob/develop/thirdparty/nginx/extras/routeinfo/mroute.py): `thirdparty/nginx/extras/routeinfo/mroute.py`
- [Routing lookup handler](https://github.com/zimbra/packages/blob/develop/thirdparty/nginx/extras/routing-lookup-handler.py): `thirdparty/nginx/extras/routing-lookup-handler.py`

### Other components

- **Maintainer**
- **Memcached**
- **Configured upstream**

## Connections

- Maintainer → Package wrappers: builds packages
- Maintainer → Aspell dictionaries: adds language
- Route management → Memcached: reads and writes routes (evidence: `thirdparty/nginx/extras/routeinfo/mroute.py`)
- Routing lookup handler → Configured upstream: returns route headers (evidence: `thirdparty/nginx/extras/routing-lookup-handler.py`)
