ygggo/README.md

139 lines
6.1 KiB
Markdown

# Ygggo
**Ygggo** is a fork of [Yggmail](https://www.google.com/search?q=https://github.com/yggdrasil-network/yggmail). It is a single-binary, all-in-one Mail Transfer Agent (MTA) that sends and receives email natively over the [Yggdrasil Network](https://yggdrasil-network.github.io/).
## 🛠 CURRENT STATUS: Testing & PoF (Proof of Failure)
**WARNING:** The current version of Ygggo is an experimental implementation. It is susceptible to resource exhaustion attacks and high-load instability. Use only for testing and research purposes.
## TODO / Roadmap
### !!! Performance & Reliability
* **!!! Worker Pool Implementation:** Transitioning from "goroutine-per-request" to a managed Worker Pool to prevent resource exhaustion during high load. **Current state: Vulnerable to OOM/Overload.**
* **!!! Memory Management:** Continuous audit of escape analysis to minimize heap allocations in hot paths.
* **!!! Context Propagation:** Ensuring strict `context.Context` usage across all I/O operations for reliable timeouts and Graceful Shutdown.
* **!!! Enhanced Caching:** Implementing an in-memory decorator for the Storage layer to reduce SQLite contention.
All of this is Legacy from yggmail.
Its mean. Ygggo can overload your server, node and can be attacked! ONLY FOR Test and see on PoC!
### ⚙️ Core & Architecture
* **Code Decomposition:** Extracting `ygggo-core` to allow integration into third-party Go projects without pulling in the entire MTA stack.
* **Multi-network Transport:** Decoupling the transport layer from Yggdrasil-only logic. Transitioning to a composition-based approach where routing is based on ed25519 public keys, regardless of the underlying network (L3/L4/Overlay)
Transitioning from a monolithic MTA to a modular ecosystem based on the principle of Separation of Concerns:
* **ygggo-core:** Extraction of core primitives into a standalone Go module.
* Unified Cryptography API (Ed25519 <-> X25519 conversion).
* Common Protobuf definitions for cross-module compatibility.
* Generic streaming interfaces for data handling.
* **ygggo-node:** Specialized implementation for high-traffic public nodes.
* Focus on scalability: Worker Pool, advanced SQLite/PostgreSQL connection pooling.
* Public-facing bridge functionality with rate limiting and DDoS protection.
**BREAKING CHANGES NOTICE:** Future updates will break compatibility with "old-node" versions. The repository structure is subject to major changes.
You shouldnt make Federation now!
## Key Improvements in Ygggo (Changelog)
This fork introduces several architectural shifts and performance optimizations:
* **New Addressing Scheme:** Migrated from `hex16` to **base32**. Addresses now follow the format: `<userpub>@<nodepub>`.
* **Inter-node Protocol:** Implemented a custom node-to-node communication protocol using **Protobuf** structures.
* **Bridge Architecture:** * Nodes can now act as bridges. You can connect to a remote node from a bridge to fetch or send mail transparently.
* Private keys are only required on the bridge; the end-node can operate with public keys only, simplifying administration.
* **End-to-End Encryption (E2EE):** * Integrated **age** encryption. Emails are encrypted at the source and decrypted only at the destination bridge.
* **Privacy:** Node administrators cannot see the content of the emails passing through or stored on the node.
* **Mathematical Key Adaptation:** Leverages the fact that `ed25519` signing keys can be converted for `x25519` encryption, allowing your existing identity keys to handle E2EE seamlessly.
* **Performance & Refactoring:**
* **Streaming:** Switched from direct memory allocations to data streaming for mail handling.
* **Instant Sync:** Fixed mail retrieval updates; new mail is now detected and pushed almost instantly.
* **Code Quality:** Significant decomposition of the original codebase for better maintainability.
---
## Features
* **Sovereign Hosting:** Your inbox is stored on your own machine or node.
* **Standard Protocols:** Implements **IMAP** and **SMTP**, making it compatible with clients like Thunderbird, Outlook, or DeltaChat.
* **Automatic Discovery:** Discovers peers on the same LAN via multicast or connects to global static peers.
* **Native Privacy:** All traffic between nodes is end-to-end encrypted by Yggdrasil, with an additional layer of `age` encryption for the mail content.
---
## Quickstart
### 1. Installation
Install the binary using Go:
```bash
go install github.com/kaiyga/ygggo/cmd/yggmail@latest
export PATH=$PATH:`go env GOPATH`/bin
```
### 2. Configuration
Create your mailbox and set a password for your mail client:
```bash
yggmail -password
```
### 3. Execution
Start the node with multicast enabled or connect to a [public peer](https://publicpeers.neilalexander.dev/):
```bash
# Using a specific peer
yggmail -peer=tls://...
# Using multicast for local discovery
yggmail -multicast
```
*Your email address will be printed in the logs at startup.*
### 4. Client Setup
Connect your favorite mail client to the following local endpoints:
* **SMTP:** `localhost:1025` (No SSL/TLS, Plain Password)
* **IMAP:** `localhost:1143` (No SSL/TLS, Plain Password)
* **Username:** Your full Ygggo address.
---
## Parameters
| Switch | Description |
| --- | --- |
| `-peer=...` | Connect to a specific Yggdrasil node (e.g., `tls://...`). |
| `-multicast` | Enable multicast discovery for LAN nodes. |
| `-database` | Path to the `yggmail.db` file (default is current directory). |
| `-smtp` | Listening address/port for SMTP (default `127.0.0.1:1025`). |
| `-imap` | Listening address/port for IMAP (default `127.0.0.1:1143`). |
| `-password` | Set your IMAP/SMTP password interactively. |
| `-passwordhash` | Set the IMAP/SMTP password using a pre-generated bcrypt hash. |
---
## Important Notes
* **Uptime:** Ygggo must be running to receive inbound emails.
* **Closed Ecosystem:** You can only email other Ygggo/Yggmail users. It does not route to the public Internet (Gmail, etc.).
* **Client Compatibility:** You may need to enable "Allow insecure authentication" in your mail client since the local listeners do not use SSL/TLS yet.
* **Size Limit:** Emails are currently capped at default **10mb** max **4GB**.