Files
lasuite-messages/src/socks-proxy
03a8dc743d ✨(mta) add Direct mode for MTA out (#285)
This PR adds support for 2 MTA out modes : Direct-to-MX and SMTP-relay outbound delivery. Direct mode supports SOCKS5 proxies, and we bundle a new `src/socks-proxy` component to support it.

We also add an end-to-end self-check command plus scheduled health-check task with optional Prometheus metrics.

---------

Co-authored-by: Bastien Ogier <bastien.ogier@ext.anct.gouv.fr>
Co-authored-by: Stanislas Bruhiere <stanislas@bruhiere.fr>
2025-09-04 15:48:46 +02:00
..
2025-09-04 15:48:46 +02:00

SOCKS Proxy Service

A high-performance SOCKS5 proxy server built with Dante, designed for secure network tunneling and testing environments.

Overview

This service provides a SOCKS5 proxy server that can be used for routing SMTP traffic through a specific IP address.

Architecture

Components

  • Dante SOCKS Server — Built from source (v1.4.4)
  • Authentication — Username/password (RFC 1929) over SOCKS5 (RFC 1928)
  • Dockerized — Multi-stage build for a minimal runtime image
  • Tests — Full suite with a mock SMTP server

Configuration

Environment Variables

Variable Description Required Default
PROXY_USERS Comma‑separated username:password pairs allowed to connect (e.g., "user1:pass1,user2:pass2"). true
PROXY_EXTERNAL Outbound interface name or IP address. false "eth0"
PROXY_INTERNAL Inbound bind interface name or IP address. false "0.0.0.0"
PROXY_INTERNAL_PORT Inbound TCP port to listen on. false "1080"
PROXY_DEBUG_LEVEL The debug level. false "0"
PROXY_SOURCE_IP_WHITELIST The source IPs allowed to connect to the proxy. Be aware you have to use network_mode: host for this feature to work. false "0.0.0.0/0"

Testing

Test Suite Features

  • Authentication Testing - Valid/invalid credentials, missing auth
  • Connection Testing - Establishment, timeouts, connection refused
  • SMTP via Proxy - Email delivery through SOCKS proxy
  • Connection Info Capture - IP address logging for proxy verification

Running Tests

# Run this at the root of Messages:
make socks-proxy-test