### Custom Go Integration Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Example of initializing storage and starting the Mailpit server programmatically in Go. ```go package main import ( "log" "github.com/axllent/mailpit/server" "github.com/axllent/mailpit/internal/storage" ) func main() { // Initialize storage if err := storage.InitDB(); err != nil { log.Fatal("Database error:", err) } defer storage.Close() // Start server if err := server.Listen(); err != nil { log.Fatal("Server error:", err) } // Keep running select {} } ``` -------------------------------- ### Start the HTTP Server Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Initializes and starts the HTTP server in a background goroutine. ```go go server.Listen() // Server now running in background ``` -------------------------------- ### CORS Configuration Examples Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Examples of configuring allowed CORS origins via command-line flags or environment variables. ```bash mailpit --api-cors "example.com,app.example.com" export MP_API_CORS="https://web.example.com,https://api.example.com" ``` -------------------------------- ### Verify Configuration Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/config.md Function signature and usage example for validating all configuration settings. ```go func VerifyConfig() error ``` ```go if err := config.VerifyConfig(); err != nil { log.Fatal("Configuration error:", err) } ``` -------------------------------- ### Start SMTP Server Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Initializes and starts the SMTP server, blocking until an error occurs. Ensure configuration variables like SMTPListen are set before calling. ```go func Listen() error ``` ```go // Start SMTP server (blocks) if err := smtpd.Listen(); err != nil { log.Fatal("SMTP error:", err) } ``` -------------------------------- ### API Request Example Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Example of a GET request with pagination and timestamp filtering parameters. ```http GET /api/v1/messages?start=50&limit=25&before=2024-01-15T10:30:00Z ``` -------------------------------- ### Get Message Source Example Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Example response for the GET /api/v1/message/{ID}/raw endpoint. ```text From: sender@example.com To: recipient@example.com Subject: Test Email Content-Type: text/plain; charset=utf-8 This is the full email source... ``` -------------------------------- ### Server Logging Output Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Examples of startup information and verbose access logs. ```text [info] Mailpit listening on http://0.0.0.0:8025 [info] SMTP listening on 0.0.0.0:1025 ``` ```text [debug] GET /api/v1/messages 200 45ms [debug] POST /api/v1/send 200 120ms ``` -------------------------------- ### Get Application Info Response Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Example JSON response for the GET /api/v1/info endpoint. ```json { "version": "1.11.0", "label": "Mailpit Instance", "tenant": "default" } ``` -------------------------------- ### Start Mailpit with TLS Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Command-line execution to start the Mailpit server with specific TLS certificates and a custom address. ```bash mailpit \ --ui-tls-cert /etc/ssl/mailpit.crt \ --ui-tls-key /etc/ssl/mailpit.key \ --listen 0.0.0.0:8443 ``` -------------------------------- ### Get Web UI Configuration Response Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Example JSON response for the GET /api/v1/webui endpoint. ```json { "chaos": true, "can_release": true, "tags": ["welcome"], "label": "Mailpit Instance" } ``` -------------------------------- ### Run Mailpit Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md The primary method for starting the Mailpit binary. ```bash mailpit [flags] ``` -------------------------------- ### SMTP AUTH Mechanism Example Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Example of a LOGIN authentication flow using base64 encoded credentials. ```text CLIENT: AUTH LOGIN SERVER: 334 VXNlcm5hbWU6 CLIENT: dXNlcm5hbWU= (base64 "username") SERVER: 334 UGFzc3dvcmQ6 CLIENT: cGFzc3dvcmQ= (base64 "password") SERVER: 235 Authenticated ``` -------------------------------- ### Chaos Trigger Examples Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Examples of probability-based error injection configurations. ```text 0.1:550 User blocked # 10% of commands 0.05:451 Temporary error # 5% of commands 0.02:552 Message too large # 2% of commands ``` -------------------------------- ### Initialize TLS Server in Go Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Setup of a TLS configuration and HTTP server instance using Mailpit configuration. ```go tlsConfig := &tls.Config{ Certificates: []tls.Certificate{cert}, MinVersion: tls.VersionTLS12, } server := &http.Server{ TLSConfig: tlsConfig, Addr: config.HTTPListen, } ``` -------------------------------- ### Install Mailpit via Script (Linux & Mac) Source: https://github.com/axllent/mailpit/blob/develop/README.md Installs Mailpit to /usr/local/bin/mailpit. Ensure you have curl and sh installed. ```shell sudo sh < <(curl -sL https://raw.githubusercontent.com/axllent/mailpit/develop/install.sh) ``` -------------------------------- ### Get All Tags Response Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Example JSON response for the GET /api/v1/tags endpoint. ```json { "tags": ["welcome", "important", "test"] } ``` -------------------------------- ### Configure Mailpit with Authentication Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/README.md Start Mailpit with specific listen addresses and authentication files for the UI and SMTP server. ```bash # With authentication mailpit \ --listen 0.0.0.0:8025 \ --smtp 0.0.0.0:1025 \ --ui-auth-file users.txt \ --smtp-auth-file smtp-users.txt ``` -------------------------------- ### Run Mailpit via CLI Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/README.md Download and execute the Mailpit binary to start the web UI and SMTP server. ```bash # Download latest release wget https://github.com/axllent/mailpit/releases/latest/download/mailpit-linux-amd64 chmod +x mailpit-linux-amd64 ./mailpit-linux-amd64 # Access web UI at http://localhost:8025 # SMTP server on localhost:1025 ``` -------------------------------- ### Install Mailpit with Custom Path via Script (Linux & Mac) Source: https://github.com/axllent/mailpit/blob/develop/README.md Installs Mailpit to a custom path specified by the INSTALL_PATH environment variable. Ensure you have curl and sh installed. ```shell sudo INSTALL_PATH=/usr/bin sh < <(curl -sL https://raw.githubusercontent.com/axllent/mailpit/develop/install.sh) ``` -------------------------------- ### Get Message Response Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Example JSON response containing full details of a single message, including inline parts and attachments. ```json { "id": "abc123", "message_id": "", "from": { "name": "Sender Name", "address": "sender@example.com" }, "to": [ {"name": "Recipient", "address": "recipient@example.com"} ], "cc": [], "bcc": [], "reply_to": [], "subject": "Test Email Subject", "date": "2024-01-15T10:30:00Z", "text": "Plain text version of the email...", "html": "HTML version...", "size": 2048, "username": "authenticated_user", "tags": ["tag1"], "inline": [ { "part_id": "2", "file_name": "logo.png", "content_type": "image/png", "content_id": "logo@example.com", "size": 1024, "checksums": { "md5": "abc123", "sha1": "def456", "sha256": "ghi789" } } ], "attachments": [ { "part_id": "3", "file_name": "document.pdf", "content_type": "application/pdf", "content_id": "", "size": 5120, "checksums": { "md5": "jkl012", "sha1": "mno345", "sha256": "pqr678" } } ] } ``` -------------------------------- ### WebSocket Client Implementation Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Example of a JavaScript client connecting to the WebSocket server and handling incoming messages. ```javascript const ws = new WebSocket('ws://localhost:8025/ws'); ws.onmessage = (event) => { const msg = JSON.parse(event.data); if (msg.type === 'new') { console.log('New message:', msg.data); } else if (msg.type === 'stats') { console.log('Mailbox stats:', msg.data); } }; ``` -------------------------------- ### UI Authentication Request Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Example of authenticating against the UI API using curl. ```bash curl -u username:password http://localhost:8025/api/v1/info ``` -------------------------------- ### Configure Mailpit via CLI Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/00-START-HERE.md Start the Mailpit server with custom host, port, and message limit configurations. ```bash mailpit --listen 0.0.0.0:8025 --smtp 0.0.0.0:1025 --max 5000 ``` -------------------------------- ### Integrate Mailpit SMTP server in Go Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Initializes storage and starts the Mailpit SMTP server within a Go application. ```go package main import ( "log" "github.com/axllent/mailpit/internal/smtpd" "github.com/axllent/mailpit/internal/storage" ) func main() { // Initialize storage if err := storage.InitDB(); err != nil { log.Fatal("Database error:", err) } defer storage.Close() // Start SMTP server (blocks) if err := smtpd.Listen(); err != nil { log.Fatal("SMTP error:", err) } } ``` -------------------------------- ### GET /api/v1/info Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Retrieves general application information. ```APIDOC ## GET /api/v1/info ### Description Retrieves general application information. ### Method GET ### Endpoint /api/v1/info ``` -------------------------------- ### Example log output Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Sample log entries generated by Mailpit during an SMTP session. ```text [info] SMTP listening on 0.0.0.0:1025 [debug] Client connected from 127.0.0.1:54321 [debug] EHLO from client.example.com [debug] Message accepted: abc123 [debug] Client disconnected ``` -------------------------------- ### Get Message Headers Response Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Example JSON response showing email headers as key-value pairs with sorted keys. ```json { "Content-Type": ["text/plain; charset=utf-8"], "From": ["sender@example.com"], "Subject": ["Test Email"], "To": ["recipient@example.com"], "X-Custom-Header": ["custom-value"] } ``` -------------------------------- ### EHLO/HELO Response Example Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Example response from the server when initiating an SMTP session. ```text 250-mailpit.example.com 250-STARTTLS 250-AUTH LOGIN PLAIN CRAM-MD5 250-SIZE 52428800 250-8BITMIME 250 HELP ``` -------------------------------- ### Send API Authentication Request Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Example of sending a request to the Send API with authentication credentials. ```bash curl -u apiuser:apikey -X POST http://localhost:8025/api/v1/send \ -H "Content-Type: application/json" \ -d '{"from":{"email":"test@example.com"},...}' ``` -------------------------------- ### GET /api/v1/info Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Retrieve server information. ```APIDOC ## GET /api/v1/info ### Description Retrieve general information about the Mailpit server. ### Method GET ### Endpoint /api/v1/info ``` -------------------------------- ### Load SMTP Forward Configuration Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Command to start Mailpit with a specific SMTP forward configuration file. ```bash mailpit --smtp-forward-config /path/to/forward.yaml ``` -------------------------------- ### GET /api/v1/webui Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Retrieve web UI configuration and feature flags. ```APIDOC ## GET /api/v1/webui ### Description Retrieve web UI configuration and feature flags. ### Method GET ### Endpoint /api/v1/webui ### Response #### Success Response (200) - **chaos** (boolean) - Chaos mode enabled - **can_release** (boolean) - Release enabled - **tags** (array) - Available tags - **label** (string) - Instance label #### Response Example { "chaos": true, "can_release": true, "tags": ["welcome"], "label": "Mailpit Instance" } ``` -------------------------------- ### Configure Implicit TLS Mode Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Require all connections to be encrypted with TLS from the start. ```bash mailpit --smtp-require-tls --smtp-tls-cert cert.pem --smtp-tls-key key.pem # All connections must be TLS from start ``` -------------------------------- ### GET /api/v1/chaos Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Retrieve the current chaos testing configuration. ```APIDOC ## GET /api/v1/chaos ### Description Retrieve current chaos testing configuration. ### Method GET ### Endpoint /api/v1/chaos ### Response #### Success Response (200) - **body** (JSON) - Chaos trigger rules and settings. ``` -------------------------------- ### GET /api/v1/info Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Retrieves server information using HTTP Basic Authentication. ```APIDOC ## GET /api/v1/info ### Description Retrieves server information. This endpoint is protected by HTTP Basic Authentication. ### Method GET ### Endpoint /api/v1/info ### Request Example curl -u username:password http://localhost:8025/api/v1/info ``` -------------------------------- ### Reference Source Code Locations Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/INDEX.md Example format for identifying specific file paths and line numbers within the Mailpit implementation. ```text Source: internal/storage/messages.go:33 Source: server/apiv1/messages.go:GetMessages() Source: internal/smtpd/main.go:Listen() ``` -------------------------------- ### GET /view/{ID}.txt Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Download the plain text version of a message. ```APIDOC ## GET /view/{ID}.txt ### Description Download plain text version of a message. ### Method GET ### Endpoint /view/{ID}.txt ### Parameters #### Path Parameters - **ID** (string) - Required - Message database ID ### Response #### Success Response (200) - **Content** (text/plain) - Text content ``` -------------------------------- ### Valid Chaos Trigger Formats Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/errors.md Examples of correctly formatted chaos trigger strings. ```text 0.1:550 Relay denied 0.05:451 Temporary error ``` -------------------------------- ### Configure STARTTLS Mode Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Enable STARTTLS for upgrading unencrypted connections. ```bash mailpit --smtp-tls-cert cert.pem --smtp-tls-key key.pem # Client connects unencrypted, upgrades with STARTTLS ``` -------------------------------- ### Retrieve Chaos Configuration Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Fetches the current chaos testing rules and settings via a GET request. ```http GET /api/v1/chaos ``` -------------------------------- ### Run Mailpit with Verbose Logging Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/errors.md Command to start Mailpit with verbose output directed to a specific log file. ```bash mailpit --verbose --log-file /var/log/mailpit/mailpit.log ``` -------------------------------- ### Serving UI from Subdirectory Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Command to configure the server to serve the UI from a specific subpath. ```bash mailpit --webroot /mailpit # UI available at http://localhost:8025/mailpit # API at http://localhost:8025/mailpit/api/v1/ ``` -------------------------------- ### Resolve Address Already in Use Error Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Identifies processes occupying the default port and demonstrates how to start the server on an alternative port. ```bash # Check what's using the port lsof -i :8025 # Use different port mailpit --listen 127.0.0.1:8026 ``` -------------------------------- ### InitDB() Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/storage.md Initializes the database connection and creates the necessary schema if it does not exist. ```APIDOC ## InitDB() ### Description Initialize database connection and create schema if needed. ### Signature `func InitDB() error` ### Returns - **error** - Error if connection fails or schema creation fails ``` -------------------------------- ### Enable verbose SMTP logging Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Command to start Mailpit with verbose logging enabled and a specified log file path. ```bash mailpit --verbose --log-file /var/log/mailpit/smtp.log ``` -------------------------------- ### Configure Database Settings Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/config.md Sets storage and performance parameters for the SQLite database. ```go var ( Database string DisableWAL bool DisableAutoVACUUM bool Compression int = 1 TenantID string ) ``` -------------------------------- ### HTTP 400 Bad Request Examples Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/errors.md Common error messages returned when parameters or queries are invalid. ```text Missing or invalid parameter: start Invalid search query: malformed filter No such file or directory ``` -------------------------------- ### Enable Relay STARTTLS Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Enable STARTTLS for the relay connection using an environment variable. ```bash export MP_SMTP_RELAY_STARTTLS=1 ``` -------------------------------- ### WebSocket Broadcast Payload Example Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/storage.md Example JSON structure for messages broadcast to WebSocket clients. ```json { "type": "new", "data": { "id": "abc123", "from": {"name": "Sender", "address": "sender@example.com"}, "subject": "Test Email", "created": "2024-01-15T10:30:00Z" } } ``` -------------------------------- ### Configure UI Authentication File Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Set the path to a file containing username:password credentials for HTTP Basic Auth. ```bash mailpit --ui-auth-file /etc/mailpit/users.txt export MP_UI_AUTH_FILE=~/.mailpit/auth ``` -------------------------------- ### Resolve Port Conflicts Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/README.md Commands to identify processes using the default port and start Mailpit on a different port. ```bash lsof -i :8025 # Check what's using the port mailpit --listen 127.0.0.1:8026 # Use different port ``` -------------------------------- ### Enable Accept Any Authentication Mode Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Allow any username/password combination for development environments. ```bash mailpit --smtp-auth-accept-any export MP_SMTP_AUTH_ACCEPT_ANY=1 ``` -------------------------------- ### Configure Multi-Tenancy via CLI Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/storage.md Shows how to isolate data across multiple instances sharing the same database file using the tenant-id flag. ```bash mailpit --tenant-id tenant1 --database shared.db mailpit --tenant-id tenant2 --database shared.db ``` -------------------------------- ### Build Mailpit from source Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/README.md Use these commands to clone the repository and compile the binary. Version information can be injected during the build process using ldflags. ```bash # Clone repository git clone https://github.com/axllent/mailpit.git cd mailpit # Build binary go build -o mailpit # Or with version info go build -ldflags "-X github.com/axllent/mailpit/config.Version=1.11.0" ``` -------------------------------- ### GET /api/v1/tags Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Retrieve all tags used in the mailbox. ```APIDOC ## GET /api/v1/tags ### Description Retrieve all tags used in the mailbox. ### Method GET ### Endpoint /api/v1/tags ### Response #### Success Response (200) - **tags** (array) - List of tag names #### Response Example { "tags": ["welcome", "important", "test"] } ``` -------------------------------- ### GET /api/v1/messages Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/README.md Retrieves a list of captured messages. ```APIDOC ## GET /api/v1/messages ### Description Lists captured messages with optional pagination. ### Method GET ### Endpoint /api/v1/messages ### Parameters #### Query Parameters - **start** (integer) - Optional - Starting index for pagination - **limit** (integer) - Optional - Maximum number of messages to return ``` -------------------------------- ### Configure Mailpit for Development Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Use these flags to set up a local development instance with basic persistence and debugging enabled. ```bash mailpit \ --database /tmp/mailpit.db \ --listen 0.0.0.0:8025 \ --smtp 0.0.0.0:1025 \ --max 1000 \ --verbose \ --enable-chaos ``` -------------------------------- ### Configure WAL Settings Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Controls Write-Ahead Logging for SQLite, useful for NFS-mounted storage. ```bash mailpit --disable-wal export MP_DISABLE_WAL=1 ``` -------------------------------- ### GET /api/v1/search Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/README.md Searches for messages based on a query string. ```APIDOC ## GET /api/v1/search ### Description Performs a search across captured messages. ### Method GET ### Endpoint /api/v1/search ### Parameters #### Query Parameters - **q** (string) - Required - The search query string ``` -------------------------------- ### Configure HTTP Server Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/config.md Sets the bind address and base path for the Web UI and API. ```go var ( HTTPListen string = "[::]:8025" Webroot string = "/" ) ``` -------------------------------- ### GET /api/v1/message/{message-id} Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/README.md Retrieves details for a specific message. ```APIDOC ## GET /api/v1/message/{message-id} ### Description Fetches the full details of a specific message by its ID. ### Method GET ### Endpoint /api/v1/message/{message-id} ### Parameters #### Path Parameters - **message-id** (string) - Required - The unique identifier of the message ``` -------------------------------- ### Define Application Metadata Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/config.md Variables for application versioning and instance labeling. ```go var ( Version string = "dev" Label string ) ``` -------------------------------- ### Configure SMTP TLS Key Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Specify the TLS key file for STARTTLS. Requires a corresponding certificate file. ```bash mailpit --smtp-tls-key /etc/ssl/smtp.key ``` -------------------------------- ### Configure UI Authentication Directly Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Set authentication credentials directly via an environment variable. ```bash export MP_UI_AUTH="admin:secretpassword" ``` -------------------------------- ### Configure Mailpit for Development Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/config.md Basic command-line configuration for a local development environment using a temporary database file. ```bash mailpit \ --database /tmp/mailpit.db \ --listen 0.0.0.0:8025 \ --smtp 0.0.0.0:1025 \ --verbose \ --max 1000 ``` -------------------------------- ### Enable Multi-Tenancy via CLI Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/config.md Run multiple Mailpit instances sharing the same database file by specifying unique tenant IDs. ```bash # Instance 1 mailpit --tenant-id tenant1 --database shared.db # Instance 2 (separate tenant, same database) mailpit --tenant-id tenant2 --database shared.db ``` -------------------------------- ### GET /api/v1/message/{ID}/raw Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Retrieve the raw content of a specific message. ```APIDOC ## GET /api/v1/message/{ID}/raw ### Description Retrieve the raw source of a message. ### Method GET ### Endpoint /api/v1/message/{ID}/raw ### Parameters #### Path Parameters - **ID** (string) - Required - The unique identifier of the message ``` -------------------------------- ### Verify Authentication Configuration Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/README.md Commands to check the format and permissions of the authentication file. ```bash # Check auth file format and permissions cat users.txt # Should be: username:password chmod 600 users.txt ``` -------------------------------- ### Configure SMTP TLS Certificate Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Specify the TLS certificate file for STARTTLS. Requires a corresponding key file. ```bash mailpit --smtp-tls-cert /etc/ssl/smtp.crt --smtp-tls-key /etc/ssl/smtp.key ``` -------------------------------- ### Configure UI and API Authentication Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/README.md Protect web UI and API endpoints using an HTTP Basic Auth file. ```bash # Create auth file (username:password) echo "admin:securepassword" > users.txt chmod 600 users.txt # Run with auth mailpit --ui-auth-file users.txt ``` -------------------------------- ### GET /api/v1/message/{ID}/sa-check Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Check message spam score using SpamAssassin. ```APIDOC ## GET /api/v1/message/{ID}/sa-check ### Description Check message spam score using SpamAssassin (if enabled). ### Method GET ### Endpoint /api/v1/message/{ID}/sa-check ### Parameters #### Path Parameters - **ID** (string) - Required - Message database ID ### Response #### Success Response (200) - **Result** (application/json) - SpamAssassin score and rule matches. ``` -------------------------------- ### GET /view/{ID}.html Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Download the HTML version of a message for browser viewing. ```APIDOC ## GET /view/{ID}.html ### Description Download HTML version of a message (for browser viewing). ### Method GET ### Endpoint /view/{ID}.html ### Parameters #### Path Parameters - **ID** (string) - Required - Message database ID ### Response #### Success Response (200) - **Content** (text/html) - HTML content ``` -------------------------------- ### GET /health Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Performs a health check, typically used for Kubernetes readiness probes. ```APIDOC ## GET /health ### Description Performs a health check, typically used for Kubernetes readiness probes. ### Method GET ### Endpoint /health ``` -------------------------------- ### Connect and send message via telnet Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Demonstrates a manual SMTP session using telnet to connect to Mailpit and send an email. ```bash # Connect and send message telnet localhost 1025 # Server responds: # 220 mailpit ESMTP # Client command: EHLO client.example.com # Server responds capabilities # 250-mailpit.example.com # 250 HELP MAIL FROM: # 250 OK RCPT TO: # 250 OK DATA # 354 Start mail input From: sender@example.com To: recipient@example.com Subject: Test This is a test message. . # 250 Message accepted QUIT # 221 Bye ``` -------------------------------- ### GET /api/v1/message/{ID} Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Retrieves the full details of a single message and marks it as read. ```APIDOC ## GET /api/v1/message/{ID} ### Description Returns the full details of a single message, marking it as read. ### Method GET ### Endpoint /api/v1/message/{ID} ### Parameters #### Path Parameters - **ID** (string) - Required - Message database ID, or `latest` for the most recent message ### Response #### Success Response (200) - **id** (string) - Message ID - **subject** (string) - Email subject - **text** (string) - Plain text content - **html** (string) - HTML content #### Response Example { "id": "abc123", "subject": "Test Email Subject", "text": "Plain text version of the email..." } ``` -------------------------------- ### GET /api/v1/messages Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Retrieves a paginated list of messages from the mailbox, ordered from newest to oldest. ```APIDOC ## GET /api/v1/messages ### Description Returns a paginated list of messages from the mailbox, ordered from newest to oldest. ### Method GET ### Endpoint /api/v1/messages ### Parameters #### Query Parameters - **start** (integer) - Optional - Pagination offset - **limit** (integer) - Optional - Maximum number of messages to return - **before** (string) - Optional - Return messages before this timestamp (RFC3339 format) ### Response #### Success Response (200) - **total** (integer) - Total number of messages - **unread** (integer) - Total number of unread messages - **messages** (array) - List of message objects #### Response Example { "total": 100, "unread": 5, "messages": [ { "id": "abc123", "subject": "Test Email", "created": "2024-01-15T10:30:00Z" } ] } ``` -------------------------------- ### Configure SMTP Authentication File Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Define a file containing username:password pairs for authentication. ```bash mailpit --smtp-auth-file /etc/mailpit/smtp-auth.txt ``` -------------------------------- ### GET /api/v1/message/{ID}/link-check Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/types.md Retrieves the link verification results for a specific message. ```APIDOC ## GET /api/v1/message/{ID}/link-check ### Description Verifies links and images within a message and returns the status. ### Method GET ### Endpoint /api/v1/message/{ID}/link-check ### Response #### Success Response (200) - **Links** (array) - Checked links with status codes - **Images** (array) - Checked images with status - **Errors** (array) - Unreachable or invalid links ``` -------------------------------- ### Invalid Search Query Error Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/errors.md Example of an error message returned for malformed search syntax. ```text Invalid search query: error message ``` ```text Invalid search query: unterminated quoted string ``` -------------------------------- ### MIME Parsing Error Message Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/errors.md Example of the error message returned when MIME parts cannot be parsed. ```text [message] error parsing MIME parts: unexpected content type ``` -------------------------------- ### Implement Transactional Storage in Go Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/storage.md Demonstrates the use of database transactions to ensure consistency during write operations. ```go func Store(body *[]byte, username *string) (string, error) { tx, err := db.BeginTx(ctx, nil) // ... operations ... if err != nil { return "", err // Rolls back automatically } return tx.Commit() } ``` -------------------------------- ### Configure Mailpit for Production Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Use these flags to secure the UI and SMTP interfaces with TLS, enable authentication, and configure retention policies. ```bash mailpit \ --database /var/lib/mailpit/messages.db \ --listen 127.0.0.1:8025 \ --ui-tls-cert /etc/ssl/mailpit.crt \ --ui-tls-key /etc/ssl/mailpit.key \ --smtp 127.0.0.1:1025 \ --smtp-require-starttls \ --smtp-tls-cert /etc/ssl/smtp.crt \ --smtp-tls-key /etc/ssl/smtp.key \ --smtp-auth-file /etc/mailpit/smtp.auth \ --max 5000 \ --max-age 30d \ --ui-auth-file /etc/mailpit/ui.auth \ --quiet \ --enable-prometheus 127.0.0.1:9090 ``` -------------------------------- ### SMTP Protocol Sequence Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Example of the SMTP protocol handshake, authentication, and message transmission flow. ```text CLIENT: CONNECT SERVER: 220 mailpit.example.com Mailpit SMTP CLIENT: EHLO client.example.com SERVER: 250-mailpit.example.com 250-STARTTLS 250-AUTH LOGIN PLAIN 250 HELP CLIENT: STARTTLS SERVER: 220 Go ahead [TLS upgrade] CLIENT: AUTH LOGIN CLIENT: base64(username) CLIENT: base64(password) SERVER: 235 Authenticated CLIENT: MAIL FROM: SERVER: 250 OK CLIENT: RCPT TO: SERVER: 250 OK CLIENT: DATA SERVER: 354 Send message CLIENT: [message content] CLIENT: . SERVER: 250 Message accepted CLIENT: QUIT SERVER: 221 Bye ``` -------------------------------- ### List Messages Response Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Example JSON response for a paginated list of messages retrieved from the mailbox. ```json { "total": 100, "unread": 5, "messages_count": 50, "messages_unread": 2, "start": 0, "tags": ["welcome", "test"], "messages": [ { "id": "abc123", "message_id": "", "read": false, "from": { "name": "Sender", "address": "sender@example.com" }, "to": [{"name": "", "address": "recipient@example.com"}], "cc": [], "bcc": [], "reply_to": [], "subject": "Test Email", "created": "2024-01-15T10:30:00Z", "username": "test_user", "tags": ["welcome"], "size": 2048, "attachments": 1, "snippet": "This is a test email message..." } ] } ``` -------------------------------- ### GET /api/v1/message/{ID}/part/{PartID} Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Retrieves the binary content of a specific message attachment. ```APIDOC ## GET /api/v1/message/{ID}/part/{PartID} ### Description Returns the attachment content with appropriate Content-Type header. ### Method GET ### Endpoint /api/v1/message/{ID}/part/{PartID} ### Parameters #### Path Parameters - **ID** (string) - Required - Message database ID, or `latest` - **PartID** (string) - Required - Attachment part ID ### Response #### Success Response (200) - **Binary** (blob) - Attachment content ``` -------------------------------- ### Configure POP3 Server Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/config.md Sets server address and security settings for the POP3 interface. ```go var ( POP3Listen string POP3AuthFile string POP3TLSCert string POP3TLSKey string ) ``` -------------------------------- ### GET /api/v1/message/{ID}/headers Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Retrieves the message headers as an array with keys sorted alphabetically. ```APIDOC ## GET /api/v1/message/{ID}/headers ### Description Returns the message headers as an array, with keys sorted alphabetically. ### Method GET ### Endpoint /api/v1/message/{ID}/headers ### Parameters #### Path Parameters - **ID** (string) - Required - Message database ID, or `latest` ### Response #### Success Response (200) - **headers** (object) - Email headers as key-value pairs #### Response Example { "Content-Type": ["text/plain; charset=utf-8"], "Subject": ["Test Email"] } ``` -------------------------------- ### Configure Web UI Security Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/config.md Sets authentication and HTTPS configuration for the Web UI. ```go var ( UIAuthFile string UITLSCert string UITLSKey string ) ``` -------------------------------- ### Get Message Details via API Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/README.md Fetch the full details of a specific message by its ID. ```bash curl http://localhost:8025/api/v1/message/{message-id} ``` -------------------------------- ### Run Mailpit in Docker Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/README.md Launch Mailpit using the official Docker image with mapped ports. ```bash docker run -p 8025:8025 -p 1025:1025 axllent/mailpit ``` -------------------------------- ### GET /api/v1/message/{ID}/html-check Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/types.md Retrieves the HTML compatibility analysis results for a specific message. ```APIDOC ## GET /api/v1/message/{ID}/html-check ### Description Performs and returns an HTML compatibility analysis for a given message ID. ### Method GET ### Endpoint /api/v1/message/{ID}/html-check ### Response #### Success Response (200) - **Score** (int) - Compatibility score (0-100) - **Issues** (array) - Compatibility issues found - **Warnings** (array) - Non-critical warnings ``` -------------------------------- ### Configure Compression Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/README.md Adjust disk usage compression levels from 0 to 3. ```bash mailpit --compression 2 # Level 0-3, default 1 ``` -------------------------------- ### Error Response Formats Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Examples of error responses returned by the API in plain text and JSON formats. ```text Error message text ``` ```json { "error": "Error message text" } ``` ```text 404 page not found ``` -------------------------------- ### Configure SMTP Authentication File Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Set the path to the authentication file via command-line argument or environment variable. ```bash --smtp-auth-file /path/to/auth.txt export MP_SMTP_AUTH_FILE=/path/to/auth.txt ``` -------------------------------- ### Rename Tag Request Body Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Example JSON request body for the PUT /api/v1/tags/{Tag} endpoint. ```json { "tag": "new_tag_name" } ``` -------------------------------- ### STARTTLS Error Responses Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Error codes returned when a STARTTLS upgrade fails or is unavailable. ```text 500 5.5.1 STARTTLS not available (cert not configured) 550 5.5.2 STARTTLS failed (TLS error) ``` -------------------------------- ### Configure Web Root Path Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Set a base path for the web UI and API, useful for reverse proxy configurations. ```bash mailpit --webroot /mailpit export MP_WEBROOT=/api/v1/emails ``` -------------------------------- ### Set Message Tags Request Body Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Example JSON request body for the PUT /api/v1/tags endpoint. ```json { "ids": ["msg_id_1"], "tags": ["important", "follow-up"] } ``` -------------------------------- ### Configure Prometheus Metrics Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Enable Prometheus metrics either via the main HTTP server or a separate dedicated server. ```bash mailpit --enable-prometheus true mailpit --enable-prometheus 0.0.0.0:9090 export MP_ENABLE_PROMETHEUS="1" export MP_ENABLE_PROMETHEUS="127.0.0.1:9090" ``` -------------------------------- ### Log File Access Error Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/errors.md Example of an error message displayed when the application cannot write to the specified log file. ```text Failed to open log file: /var/log/mailpit/mailpit.log: permission denied ``` -------------------------------- ### Load SMTP Relay Configuration Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Apply relay settings using command-line flags or environment variables. ```bash mailpit --smtp-relay-config /path/to/relay.yaml ``` ```bash export MP_SMTP_RELAY_HOST=smtp.sendgrid.net export MP_SMTP_RELAY_PORT=587 export MP_SMTP_RELAY_STARTTLS=1 export MP_SMTP_RELAY_USERNAME=apiuser export MP_SMTP_RELAY_PASSWORD=apikey ``` -------------------------------- ### HTML Parsing Error Response Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/errors.md Example JSON response returned when the HTML parser encounters malformed content. ```json { "score": 75, "issues": [ {"element": "table", "issue": "missing tbody"} ] } ``` -------------------------------- ### Configure POP3 Authentication File Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Specify the path to a password file for POP3 authentication. ```bash mailpit --pop3-auth-file /etc/mailpit/pop3-auth.txt ``` -------------------------------- ### Configure SpamAssassin Integration Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Enable SpamAssassin by specifying the host and port or setting to true for localhost. ```bash mailpit --enable-spamassassin localhost:783 export MP_ENABLE_SPAMASSASSIN="spamd:783" ``` -------------------------------- ### STARTTLS Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Upgrades the SMTP connection to a secure TLS connection. ```APIDOC ## STARTTLS ### Description Upgrades the current connection to TLS. Requires a configured certificate. ### Error Responses - 500 5.5.1 STARTTLS not available (cert not configured) - 550 5.5.2 STARTTLS failed (TLS error) ``` -------------------------------- ### Configure Send API Authentication via Environment Variable Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Sets authentication credentials directly using an environment variable. ```bash export MP_SEND_API_AUTH="api:secret123" ``` -------------------------------- ### Configure HTTP Listen Address Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Set the interface and port for the web UI and API. ```bash mailpit --listen 127.0.0.1:8080 export MP_UI_BIND_ADDR=0.0.0.0:3000 ``` -------------------------------- ### Set Environment Variables Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/config.md Configure Mailpit settings using environment variables prefixed with MP_. ```bash export MP_DATABASE=/var/lib/mailpit.db export MP_SMTP_LISTEN=0.0.0.0:1025 export MP_UI_BIND_ADDR=0.0.0.0:8025 export MP_MAX_MESSAGES=1000 export MP_VERBOSE=1 ``` -------------------------------- ### GET /api/v1/message/{ID}/raw Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/endpoints.md Retrieves the full email source in RFC 822 format as plain text. ```APIDOC ## GET /api/v1/message/{ID}/raw ### Description Returns the full email source (RFC 822 format) as plain text. ### Method GET ### Endpoint /api/v1/message/{ID}/raw ### Parameters #### Path Parameters - **ID** (string) - Required - Message database ID, or `latest` #### Query Parameters - **dl** (string) - Optional - If set to `1`, download as attachment ### Response #### Success Response (200) - **text/plain** - The full email source content ### Status Codes - 200 OK - Source retrieved successfully - 404 Not Found - Message not found ``` -------------------------------- ### Integrate with Mailpit API using JavaScript Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/README.md Shows how to send messages via fetch and listen for real-time updates using WebSockets. ```javascript // Send message const response = await fetch('http://localhost:8025/api/v1/send', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ from: {email: 'test@example.com'}, to: [{email: 'recipient@example.com'}], subject: 'Test', text: 'Hello' }) }); const {id} = await response.json(); console.log('Message ID:', id); // WebSocket for real-time updates const ws = new WebSocket('ws://localhost:8025/ws'); ws.onmessage = (event) => { const msg = JSON.parse(event.data); if (msg.type === 'new') { console.log('New message:', msg.data); } }; ``` -------------------------------- ### Integrate with Mailpit API using Python Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/README.md Demonstrates sending, retrieving, and searching for messages via the Mailpit HTTP API. ```python import requests # Send message via HTTP API response = requests.post('http://localhost:8025/api/v1/send', json={ 'from': {'email': 'test@example.com'}, 'to': [{'email': 'recipient@example.com'}], 'subject': 'Test', 'text': 'Hello' }) message_id = response.json()['id'] # Get message msg = requests.get(f'http://localhost:8025/api/v1/message/{message_id}') print(msg.json()['subject']) # Search results = requests.get('http://localhost:8025/api/v1/search', params={'q': 'from:test@example.com'}) ``` -------------------------------- ### Configure Mailpit for Production with Relay Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/config.md Production configuration including TLS certificates, authentication files, and SMTP relay settings. ```bash mailpit \ --database /var/lib/mailpit/messages.db \ --listen 127.0.0.1:8025 \ --ui-tls-cert /etc/ssl/cert.pem \ --ui-tls-key /etc/ssl/key.pem \ --ui-auth-file /etc/mailpit/ui.auth \ --smtp 127.0.0.1:1025 \ --smtp-require-starttls \ --smtp-tls-cert /etc/ssl/smtp.crt \ --smtp-tls-key /etc/ssl/smtp.key \ --smtp-auth-file /etc/mailpit/smtp.auth \ --smtp-relay-config /etc/mailpit/relay.yaml \ --max 5000 \ --max-age 30d \ --quiet ``` -------------------------------- ### Configure Web UI Features Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/config.md Toggles various Web UI security and functional features. ```go var ( DisableHTTPCompression bool BlockRemoteCSSAndFonts bool AllowInternalHTTPRequests bool AllowUntrustedTLS bool DisableLinkCheckRateLimit bool HideDeleteAllButton bool ) ``` -------------------------------- ### SMTP Forward Configuration Options Reference Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/smtpd.md Comprehensive list of available configuration keys for the SMTP forwarder. ```yaml host: smtp.server.com # Forward server hostname port: 587 # Forward server port starttls: true # Use STARTTLS tls: false # Use implicit TLS allow_insecure: false # Allow untrusted certs auth: LOGIN # Auth method username: forwarder@example.com # Server username password: secret # Server password secret: apikey # API key alternative to: "admin@example.com,ops@example.com" # Forward recipients return_path: bounce@example.com # Override Return-Path override_from: noreply@example.com # Override From address forward_smtp_errors: true # Include errors in response ``` -------------------------------- ### Retrieve latest message ID in Go Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/storage.md Gets the ID of the most recent message, requiring an HTTP request for tenant isolation context. ```go id, err := storage.LatestID(httpRequest) if err != nil { http.Error(w, "No messages", http.StatusNotFound) return } msg, _ := storage.GetMessage(id) fmt.Printf("Latest message: %s\n", msg.Subject) ``` -------------------------------- ### TLS Certificate Configuration Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Command-line flags and environment variables for specifying TLS certificate and key paths. ```text // --ui-tls-cert // --ui-tls-key // MP_UI_TLS_CERT // MP_UI_TLS_KEY ``` -------------------------------- ### func Search(search string, start int, limit int, tz string, req *http.Request) Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/storage.md Performs a full-text search on messages using advanced filters and returns a summary list. ```APIDOC ## func Search ### Description Performs full-text search with advanced filters. Supports syntax like from:, to:, subject:, has:, tag:, and text:. ### Parameters - **search** (string) - Required - Search query string - **start** (int) - Required - Pagination offset - **limit** (int) - Required - Results per page - **tz** (string) - Optional - Timezone identifier - **req** (*http.Request) - Required - HTTP request (for tenant info) ### Returns - **[]MessageSummary** - Matching messages - **error** - Error if search syntax invalid ``` -------------------------------- ### Configure SMTP TLS/SSL Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/config.md Sets certificate paths and security requirements for encrypted SMTP connections. ```go var ( SMTPTLSCert string SMTPTLSKey string SMTPRequireSTARTTLS bool SMTPRequireTLS bool ) ``` -------------------------------- ### Configure Database Optimization Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/README.md Disable Write-Ahead Logging (WAL) for better performance on NFS-mounted databases. ```bash mailpit --disable-wal # For NFS-mounted databases ``` -------------------------------- ### UI Authentication Configuration Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Configuration options for enabling HTTP Basic Auth on the web UI and core API endpoints. ```go // Configured via: // - --ui-auth-file // - MP_UI_AUTH environment variable // - MP_UI_AUTH_FILE file path ``` -------------------------------- ### Configure Verbose Logging Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Enable debug-level logging output. ```bash mailpit --verbose export MP_VERBOSE=1 ``` -------------------------------- ### Configure Auto-Update Settings Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/config.md Define the GitHub release configuration for automatic update checks. ```go var ( GHRUConfig = ghru.Config{ Repo: "axllent/mailpit", ArchiveName: "mailpit-{{.OS}}-{{.Arch}}", BinaryName: "mailpit", CurrentVersion: Version, } ) ``` -------------------------------- ### Configure Send API Authentication File Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/configuration.md Specifies a file containing username:password pairs for authentication. ```bash mailpit --send-api-auth-file /etc/mailpit/send-auth.txt ``` -------------------------------- ### Configure Send API Authentication Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/README.md Set up separate authentication for the HTTP Send API. ```bash echo "apiuser:apikey" > send-auth.txt mailpit --send-api-auth-file send-auth.txt ``` -------------------------------- ### Embedded UI File Serving Source: https://github.com/axllent/mailpit/blob/develop/_autodocs/api-reference/server.md Indicates that UI files are embedded in the binary and served from the root path. ```go // Files embedded from server/ui-src/ // Served at / and /assets/* ```