mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-24 13:22:23 +02:00
* fix: redesign and compact Signed-off-by: Leonid Kaganov <lleo@lleo.me> * fix: comments Signed-off-by: Leonid Kaganov <lleo@lleo.me> * fix: correctly dropping connections in timeout Signed-off-by: Leonid Kaganov <lleo@lleo.me> * feature: loglevel in config Signed-off-by: Leonid Kaganov <lleo@lleo.me> * fix: loglevel in config Signed-off-by: Leonid Kaganov <lleo@lleo.me> * features lopt: direct personal messages between websockets by username Signed-off-by: Leonid Kaganov <lleo@lleo.me> * fix collaborator security query Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com> * Fix svelte warnings Signed-off-by: Artem Savchenko <armisav@gmail.com> * Change log Signed-off-by: Artem Savchenko <armisav@gmail.com> * Add workspace permissions enum Signed-off-by: Artem Savchenko <armisav@gmail.com> * Add changelog Signed-off-by: Artem Savchenko <armisav@gmail.com> * Permission methods Signed-off-by: Artem Savchenko <armisav@gmail.com> * Update core and account versions Signed-off-by: Artem Savchenko <armisav@gmail.com> * Fix predicate Signed-off-by: Artem Savchenko <armisav@gmail.com> * Add changelog Signed-off-by: Artem Savchenko <armisav@gmail.com> * Fix object clone Signed-off-by: Artem Savchenko <armisav@gmail.com> * Bump and add changelog Signed-off-by: Artem Savchenko <armisav@gmail.com> * Fix exception in getTypeOf Signed-off-by: Artem Savchenko <armisav@gmail.com> * Disable changelog check Signed-off-by: Artem Savchenko <armisav@gmail.com> * Fix failed to fetch errors in account client Signed-off-by: Artem Savchenko <armisav@gmail.com> * Clean up Signed-off-by: Artem Savchenko <armisav@gmail.com> * Support in-memory mode for hulypulse Signed-off-by: Artem Savchenko <armisav@gmail.com> * Update platform-rig Signed-off-by: Artem Savchenko <armisav@gmail.com> * Comment change log verification Signed-off-by: Artem Savchenko <armisav@gmail.com> * Update pnpm lock Signed-off-by: Artem Savchenko <armisav@gmail.com> * Sync with foundation Signed-off-by: Artem Savchenko <armisav@gmail.com> * Update platform-rig Signed-off-by: Artem Savchenko <armisav@gmail.com> * Sync with foundation and bump versions Signed-off-by: Artem Savchenko <armisav@gmail.com> * Sync with foundations Signed-off-by: Artem Savchenko <armisav@gmail.com> * Update and increment versions Signed-off-by: Artem Savchenko <armisav@gmail.com> * Skip change log verification Signed-off-by: Artem Savchenko <armisav@gmail.com> * Fix hulypulse connections Signed-off-by: Artem Savchenko <armisav@gmail.com> * Fix formatting and ci Signed-off-by: Artem Savchenko <armisav@gmail.com> * Fix validation warnings Signed-off-by: Artem Savchenko <armisav@gmail.com> * Fix formatting Signed-off-by: Artem Savchenko <armisav@gmail.com> * Fix validation Signed-off-by: Artem Savchenko <armisav@gmail.com> * Fix pnpm lock Signed-off-by: Artem Savchenko <armisav@gmail.com> * Update versions Signed-off-by: Artem Savchenko <armisav@gmail.com> * Update hulypulse version Signed-off-by: Artem Savchenko <armisav@gmail.com> --------- Signed-off-by: Leonid Kaganov <lleo@lleo.me> Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com> Signed-off-by: Artem Savchenko <armisav@gmail.com> Co-authored-by: Leonid Kaganov <lleo@lleo.me> Co-authored-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
Pod Mail Worker
Pod Mail Worker is a service that provides bidirectional synchronization between Huly messages and email servers.
Purpose
This service acts as a bridge between Huly's internal messaging system and external email infrastructure, enabling:
- Incoming Email Processing: Receives emails via MTA hooks and converts them into Huly messages
- Outgoing Email Synchronization: Processes Huly messages and sends them as emails
- Queue Processing: Handles asynchronous message processing via Kafka queues
Key Components
MTA Hook Handler (/mta-hook)
- Receives incoming emails from mail transfer agents
- Parses email content (plain text, HTML, attachments)
- Converts emails to Huly message format
- Handles email threading via In-Reply-To headers
Mail Worker
- Processes queued mail operations
- Manages workspace client connections
- Handles bulk email processing operations
Configuration
Key environment variables:
PORT: Service port (default: 4050)WORKSPACE_URL: Target Huly workspace URLACCOUNTS_URL: Huly accounts service URLKVS_URL: Key-value store URL for thread mappingQUEUE_CONFIG: Kafka queue configurationHOOK_TOKEN: Authentication token for MTA hooksIGNORED_ADDRESSES: Comma-separated list of email addresses to ignoreMAIL_SIZE_LIMIT: Maximum email size (default: 50mb)
API Endpoints
POST /mta-hook
Receives incoming emails from mail transfer agents.
Headers:
x-hook-token: Authentication token (if configured)
Body: MTA message format with envelope and message data
Response: Always returns 200 OK with { action: 'accept' } to prevent email bounces
Dependencies
- Kafka: Message queue for asynchronous processing
- KVS: Key-value store for thread mapping persistence
- Workspace API: Huly workspace integration
- Account Client: User and workspace management
Development
# Install dependencies
rush update
# Build
rushx build
# Run tests
rushx test
# Start development server
rushx run-local
Deployment
The service is designed to run as a containerized application with the following requirements:
- Network access to Huly workspace APIs
- Connection to Kafka message queues
- Access to key-value store for persistence
- Ability to receive HTTP requests from mail servers