# metaltrack/automail architecture

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

- Interactive diagram: https://gitdiagram.com/metaltrack/automail
- Repository: https://github.com/metaltrack/automail

## Overview

AutoMail is a Docker-based automatic mail notification service. Its visible workflow is a user choosing single or multiple recipients in the ServiceInvoker, which posts a message request to the FastAPI service; the service delegates delivery to a persistent SMTP-backed mail worker and returns a status. The worker also logs delivery activity. The README documents the Docker-based product, but the supplied tree and excerpts do not show Docker configuration or other notification capabilities, so those details are not expanded here.

Main entry points: [`DrPost/Worker.py`](https://github.com/metaltrack/automail/blob/main/DrPost/Worker.py) (SMTP mail worker), [`mailrunner/ServiceInvoker/ServiceInvoker.py`](https://github.com/metaltrack/automail/blob/main/mailrunner/ServiceInvoker/ServiceInvoker.py) (Service invoker), [`DrPost/AutoMailAPI.py`](https://github.com/metaltrack/automail/blob/main/DrPost/AutoMailAPI.py) (HTTP API), [`DrPost/logger.py`](https://github.com/metaltrack/automail/blob/main/DrPost/logger.py) (Logger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Request client"]
  node_invoker["Service invoker<br/>[ServiceInvoker.py]"]
end

subgraph group_service["Mail service"]
  node_api["HTTP API<br/>[AutoMailAPI.py]"]
end

subgraph group_delivery["Mail delivery"]
  node_worker["SMTP mail worker<br/>[Worker.py]"]
end

subgraph group_observability["Logging"]
  node_logger["Logger<br/>[logger.py]"]
end

node_user(("User"))
node_smtp{{"SMTP server"}}

node_user -->|"chooses recipients"| node_invoker
node_invoker -->|"posts request"| node_api
node_api -->|"routes mail"| node_worker
node_worker -->|"sends message"| node_smtp
node_worker -->|"logs activity"| node_logger

click node_invoker "https://github.com/metaltrack/automail/blob/main/mailrunner/ServiceInvoker/ServiceInvoker.py"
click node_api "https://github.com/metaltrack/automail/blob/main/DrPost/AutoMailAPI.py"
click node_worker "https://github.com/metaltrack/automail/blob/main/DrPost/Worker.py"
click node_logger "https://github.com/metaltrack/automail/blob/main/DrPost/logger.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_invoker,node_user toneBlue
class node_api toneAmber
class node_worker,node_smtp toneMint
class node_logger toneRose
```

## Components

### Request client

- [Service invoker](https://github.com/metaltrack/automail/blob/main/mailrunner/ServiceInvoker/ServiceInvoker.py): `mailrunner/ServiceInvoker/ServiceInvoker.py`

### Mail service

- [HTTP API](https://github.com/metaltrack/automail/blob/main/DrPost/AutoMailAPI.py): `DrPost/AutoMailAPI.py`

### Mail delivery

- [SMTP mail worker](https://github.com/metaltrack/automail/blob/main/DrPost/Worker.py): `DrPost/Worker.py`

### Logging

- [Logger](https://github.com/metaltrack/automail/blob/main/DrPost/logger.py): `DrPost/logger.py`

### Other components

- **User**
- **SMTP server**

## Connections

- User → Service invoker: chooses recipients (evidence: `mailrunner/ServiceInvoker/ServiceInvoker.py`)
- Service invoker → HTTP API: posts request (evidence: `mailrunner/ServiceInvoker/ServiceInvoker.py`)
- HTTP API → SMTP mail worker: routes mail (evidence: `DrPost/AutoMailAPI.py`)
- SMTP mail worker → SMTP server: sends message (evidence: `DrPost/Worker.py`)
- SMTP mail worker → Logger: logs activity (evidence: `DrPost/Worker.py`)
