Files
mailcow_plugin_project/docs/INSTALL.md
2026-04-08 18:42:05 -04:00

1.1 KiB

Install

Local runtime

cd /opt
unzip /path/to/mailcow-plugin-runtime-v0.2.0.zip
cd mailcow-plugin-runtime-v0.2.0
cp .env.example .env
npm install
npm run build
node dist/server.js

Docker

docker compose up -d --build

Test

curl http://127.0.0.1:4110/health
curl http://127.0.0.1:4110/plugins-runtime/api/runtime/plugins
curl http://127.0.0.1:4110/plugins-runtime/api/runtime/hooks

Mailcow nginx integration

Add a proxy block similar to:

location /plugins-runtime/ {
  proxy_pass http://mailcow-plugin-runtime:4110/plugins-runtime/;
  proxy_http_version 1.1;
  proxy_set_header Host $host;
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Real-IP $remote_addr;
}

Inject the bootstrap script into your Mailcow UI shell:

<script src="/plugins-runtime/runtime/bootstrap.js"></script>

Recommended hook anchors in Mailcow markup:

<div data-mailcow-plugin-hook="mail.compose.toolbar"></div>
<div data-mailcow-plugin-hook="mail.compose.attachments"></div>