# yohan-nedh/itk_phishingmail_detector architecture

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

- Interactive diagram: https://gitdiagram.com/yohan-nedh/itk_phishingmail_detector
- Repository: https://github.com/yohan-nedh/itk_phishingmail_detector

## Overview

This is a command-line phishing-email analyzer. The user supplies an .eml or .txt file; the CLI invokes analysis, which extracts message data, evaluates phishing indicators, and returns a risk score and findings. The CLI can save the results to a file. The sampled code shows parsing, scoring, VirusTotal lookups, and caching; the README documents file analysis and output saving. The graph omits empty modules and limits integrations to relationships visible in the excerpts.

Main entry points: [`analyzer.py`](https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/analyzer.py) (Phishing analysis), [`cli.py`](https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/cli.py) (CLI), [`phish_detector.py`](https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/phish_detector.py) (Program entry), [`mail_parsing.py`](https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/mail_parsing.py) (Message extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Command line"]
  node_launcher["Program entry<br/>[phish_detector.py]"]
  node_cli["CLI<br/>[cli.py]"]
end

subgraph group_analysis["Email analysis"]
  node_parser["Message extraction<br/>[mail_parsing.py]"]
  node_analyzer["Phishing analysis<br/>[analyzer.py]"]
  node_risk["Risk result<br/>[analyzer.py]"]
end

subgraph group_intel["Threat intelligence"]
  node_vt["VirusTotal"]
  node_vtcache[("VT cache<br/>[analyzer.py]")]
  node_whoiscache[("WHOIS cache<br/>[analyzer.py]")]
end

node_user(("User"))
node_input["Email file"]
node_output["Results file"]

node_user -->|"runs"| node_launcher
node_user -->|"selects"| node_input
node_launcher -->|"delegates"| node_cli
node_cli -->|"reads path"| node_input
node_cli -->|"invokes"| node_analyzer
node_analyzer -->|"extracts message"| node_parser
node_analyzer -->|"queries"| node_vt
node_analyzer -->|"reads/writes"| node_vtcache
node_analyzer -->|"uses cache"| node_whoiscache
node_analyzer -->|"produces"| node_risk
node_cli -->|"saves results"| node_output

click node_launcher "https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/phish_detector.py"
click node_cli "https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/cli.py"
click node_parser "https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/mail_parsing.py"
click node_analyzer "https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/analyzer.py"
click node_risk "https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/analyzer.py"
click node_vtcache "https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/analyzer.py"
click node_whoiscache "https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/analyzer.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_launcher,node_cli,node_user toneBlue
class node_parser,node_analyzer,node_risk toneAmber
class node_vt,node_vtcache,node_whoiscache toneMint
class node_input,node_output toneIndigo
```

## Components

### Command line

- [Program entry](https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/phish_detector.py): `phish_detector.py`
- [CLI](https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/cli.py): `cli.py`

### Email analysis

- [Message extraction](https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/mail_parsing.py): `mail_parsing.py`
- [Phishing analysis](https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/analyzer.py): `analyzer.py`
- [Risk result](https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/analyzer.py): `analyzer.py`

### Threat intelligence

- **VirusTotal**
- [VT cache](https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/analyzer.py): `analyzer.py`
- [WHOIS cache](https://github.com/yohan-nedh/itk_phishingmail_detector/blob/main/analyzer.py): `analyzer.py`

### Other components

- **User**
- **Email file**
- **Results file**

## Connections

- User → Program entry: runs (evidence: `README.md`)
- User → Email file: selects (evidence: `README.md`)
- Program entry → CLI: delegates (evidence: `phish_detector.py`)
- CLI → Email file: reads path (evidence: `cli.py`)
- CLI → Phishing analysis: invokes (evidence: `cli.py`)
- Phishing analysis → Message extraction: extracts message (evidence: `analyzer.py`)
- Phishing analysis → VirusTotal: queries (evidence: `analyzer.py`)
- Phishing analysis → VT cache: reads/writes (evidence: `analyzer.py`)
- Phishing analysis → WHOIS cache: uses cache (evidence: `analyzer.py`)
- Phishing analysis → Risk result: produces (evidence: `analyzer.py`)
- CLI → Results file: saves results (evidence: `cli.py`)
