# bcdannyboy/pyphisher architecture

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

- Interactive diagram: https://gitdiagram.com/bcdannyboy/pyphisher
- Repository: https://github.com/bcdannyboy/pyphisher

## Overview

PyPhisher is a command-line bulk email campaign generator. The workflow reads campaign configuration and recipient records, personalizes message bodies, optionally adds tracking pixels and attachments, sends email through SMTP, then monitors a web log and writes campaign results. The README also documents plaintext and HTML messages, multiple campaign domains/paths, and tracking GIFs. The source excerpt is partial, so some implementation details and relationships are shown only where the README or visible calls support them.

Main entry points: [`PyPhisher.py`](https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.py) (Campaign runner), [`ToFile.txt`](https://github.com/bcdannyboy/pyphisher/blob/master/ToFile.txt) (Recipient records), [`PyPhisher.config`](https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.config) (Campaign settings), [`bodyfile.txt`](https://github.com/bcdannyboy/pyphisher/blob/master/bodyfile.txt) (Message body)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Campaign inputs"]
  node_cli["CLI and config<br/>[PyPhisher.py]"]
  node_config["Campaign settings<br/>[PyPhisher.config]"]
  node_recipients["Recipient records<br/>[ToFile.txt]"]
end

subgraph group_campaign["Campaign processing"]
  node_engine["Campaign runner<br/>[PyPhisher.py]"]
  node_personalize["Body personalization<br/>[PyPhisher.py]"]
  node_body["Message body<br/>[bodyfile.txt]"]
  node_htmlbody["HTML message body<br/>[bodyfile.html]"]
  node_attachments["Message attachments<br/>[PyPhisher.py]"]
end

subgraph group_tracking["Tracking and results"]
  node_tracker["Tracking GIF creation<br/>[PyPhisher.py]"]
  node_weblog["Web server log<br/>[PyPhisher.config]"]
  node_trackingrun["Tracking monitor<br/>[PyPhisher.py]"]
  node_results["Campaign results<br/>[PyPhisher.py]"]
  node_logger["Runtime logger<br/>[PyPhisher.py]"]
end

node_operator(("Campaign operator"))
node_smtp{{"SMTP server"}}
node_webhost{{"Web host paths"}}

node_operator -->|"starts"| node_cli
node_cli -->|"reads settings"| node_config
node_cli -->|"selects input"| node_recipients
node_cli -->|"starts campaign"| node_engine
node_engine -->|"reads records"| node_recipients
node_engine -->|"replaces commands"| node_personalize
node_personalize -->|"reads body"| node_body
node_personalize -.->|"supports HTML"| node_htmlbody
node_engine -->|"attaches files"| node_attachments
node_engine -->|"sends messages"| node_smtp
node_engine -->|"creates tracker"| node_tracker
node_tracker -->|"copies GIF"| node_webhost
node_engine -->|"starts tracking"| node_trackingrun
node_trackingrun -->|"reads log"| node_weblog
node_engine -->|"writes report"| node_results
node_trackingrun -->|"returns hits"| node_results
node_engine -->|"records events"| node_logger

click node_cli "https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.py"
click node_config "https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.config"
click node_recipients "https://github.com/bcdannyboy/pyphisher/blob/master/ToFile.txt"
click node_engine "https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.py"
click node_personalize "https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.py"
click node_body "https://github.com/bcdannyboy/pyphisher/blob/master/bodyfile.txt"
click node_htmlbody "https://github.com/bcdannyboy/pyphisher/blob/master/bodyfile.html"
click node_attachments "https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.py"
click node_tracker "https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.py"
click node_weblog "https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.config"
click node_trackingrun "https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.py"
click node_results "https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.py"
click node_logger "https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.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_cli,node_config,node_recipients toneBlue
class node_engine,node_personalize,node_body,node_htmlbody,node_attachments toneAmber
class node_tracker,node_weblog,node_trackingrun,node_results,node_logger,node_smtp toneMint
class node_operator,node_webhost toneIndigo
```

## Components

### Campaign inputs

- [CLI and config](https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.py): `PyPhisher.py`
- [Campaign settings](https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.config): `PyPhisher.config`
- [Recipient records](https://github.com/bcdannyboy/pyphisher/blob/master/ToFile.txt): `ToFile.txt`

### Campaign processing

- [Campaign runner](https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.py): `PyPhisher.py`
- [Body personalization](https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.py): `PyPhisher.py`
- [Message body](https://github.com/bcdannyboy/pyphisher/blob/master/bodyfile.txt): `bodyfile.txt`
- [HTML message body](https://github.com/bcdannyboy/pyphisher/blob/master/bodyfile.html): `bodyfile.html`
- [Message attachments](https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.py): `PyPhisher.py`

### Tracking and results

- [Tracking GIF creation](https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.py): `PyPhisher.py`
- [Web server log](https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.config): `PyPhisher.config`
- [Tracking monitor](https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.py): `PyPhisher.py`
- [Campaign results](https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.py): `PyPhisher.py`
- [Runtime logger](https://github.com/bcdannyboy/pyphisher/blob/master/PyPhisher.py): `PyPhisher.py`

### Other components

- **Campaign operator**
- **SMTP server**
- **Web host paths**

## Connections

- Campaign operator → CLI and config: starts (evidence: `README.md`)
- CLI and config → Campaign settings: reads settings (evidence: `PyPhisher.py`)
- CLI and config → Recipient records: selects input (evidence: `PyPhisher.py`)
- CLI and config → Campaign runner: starts campaign (evidence: `PyPhisher.py`)
- Campaign runner → Recipient records: reads records (evidence: `PyPhisher.py`)
- Campaign runner → Body personalization: replaces commands (evidence: `PyPhisher.py`)
- Body personalization → Message body: reads body (evidence: `PyPhisher.py`)
- Body personalization → HTML message body: supports HTML (evidence: `README.md`)
- Campaign runner → Message attachments: attaches files (evidence: `PyPhisher.py`)
- Campaign runner → SMTP server: sends messages (evidence: `PyPhisher.py`)
- Campaign runner → Tracking GIF creation: creates tracker (evidence: `PyPhisher.py`)
- Tracking GIF creation → Web host paths: copies GIF (evidence: `PyPhisher.py`)
- Campaign runner → Tracking monitor: starts tracking (evidence: `PyPhisher.py`)
- Tracking monitor → Web server log: reads log (evidence: `PyPhisher.py`)
- Campaign runner → Campaign results: writes report (evidence: `PyPhisher.py`)
- Tracking monitor → Campaign results: returns hits (evidence: `PyPhisher.py`)
- Campaign runner → Runtime logger: records events (evidence: `PyPhisher.py`)
