{"id":18772742,"url":"https://github.com/sctg-development/web-smtp-relay","last_synced_at":"2025-08-31T14:34:29.810Z","repository":{"id":253911044,"uuid":"844904940","full_name":"sctg-development/web-smtp-relay","owner":"sctg-development","description":"Web-SMTP Relay is a simple Go application that receives email details via an HTTP POST request and relays the email through an SMTP server","archived":false,"fork":false,"pushed_at":"2024-09-01T14:16:00.000Z","size":75,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-17T12:49:42.799Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sctg-development.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-20T07:39:22.000Z","updated_at":"2025-03-06T10:25:56.000Z","dependencies_parsed_at":"2024-11-07T19:35:50.361Z","dependency_job_id":"7000cf92-acab-48ce-96e5-1df4a7652d0b","html_url":"https://github.com/sctg-development/web-smtp-relay","commit_stats":null,"previous_names":["sctg-development/web-smtp-relay"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/sctg-development/web-smtp-relay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sctg-development%2Fweb-smtp-relay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sctg-development%2Fweb-smtp-relay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sctg-development%2Fweb-smtp-relay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sctg-development%2Fweb-smtp-relay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sctg-development","download_url":"https://codeload.github.com/sctg-development/web-smtp-relay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sctg-development%2Fweb-smtp-relay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272991817,"owners_count":25027498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T19:30:04.073Z","updated_at":"2025-08-31T14:34:29.769Z","avatar_url":"https://github.com/sctg-development.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web-SMTP Relay\n\nWeb-SMTP Relay is a simple Go application that receives email details via an HTTP POST request and relays the email through an SMTP server. It includes basic authentication and configurable settings.\n\n## Features\n\n- Receive email details (subject, body, and destinations) via HTTP POST\n- Basic authentication for secure access\n- Configurable SMTP relay settings (default and per-user)\n- Flexible configuration through YAML file, environment variables, and command-line flags\n- Docker support with multi-architecture builds\n\n## Table of Contents\n\n- [Web-SMTP Relay](#web-smtp-relay)\n  - [Features](#features)\n  - [Table of Contents](#table-of-contents)\n  - [Installation](#installation)\n  - [Configuration](#configuration)\n    - [config.yaml](#configyaml)\n    - [Environment Variables](#environment-variables)\n    - [Command-line Flags](#command-line-flags)\n  - [Usage](#usage)\n  - [Docker](#docker)\n  - [Helm Chart](#helm-chart)\n    - [Prerequisites](#prerequisites)\n    - [Installing the Chart](#installing-the-chart)\n    - [Customizing the Chart](#customizing-the-chart)\n      - [Customizing values.yaml](#customizing-valuesyaml)\n      - [Using command-line parameters](#using-command-line-parameters)\n    - [Configuration Options](#configuration-options)\n    - [Updating the Chart](#updating-the-chart)\n    - [Uninstalling the Chart](#uninstalling-the-chart)\n    - [Note on Secrets](#note-on-secrets)\n  - [Tests](#tests)\n  - [License](#license)\n    - [Key points of the AGPLv3](#key-points-of-the-agplv3)\n  - [Contributing](#contributing)\n  - [Support](#support)\n\n## Installation\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/sctg-development/web-smtp-relay.git\n   cd web-smtp-relay\n   ```\n\n2. Build the application:\n\n   ```bash\n   go build -o web-smtp\n   ```\n\n## Configuration\n\nThe application can be configured using a YAML file, environment variables, and command-line flags.\n\n### config.yaml\n\n```yaml\nusers:\n  admin: \n    password: $2a$10$XOPbrlUPQdwdJUpSrIF6X.LbE14qsMmKGhM1A8W9iqDuy0Bx8KzWq\n  # can be generated with `htpasswd -nbB -C 12 user realpassword | awk -F: '{print $2}'`\n  newuser: \n    password: $2a$10$XOPbrlUPQdwdJUpSrIF6X.LbE14qsMmKGhM1A8W9iqDuy0Bx8KzWq\n    smtp:\n      # per user smtp settings\n      host: smtp.example.com\n      port: 587\n      username: your_username\n      password: your_password\n\nsmtp:\n  host: smtp.example.com\n  port: 587\n  username: your_username\n  password: your_password\n\nport: 8080\n```\n\n### Environment Variables\n\n- `WEB_SMTP_CONFIG_FILE`: Path to the configuration file\n- `WEB_SMTP_PORT`: Port to listen on\n\n### Command-line Flags\n\n- `-c`: Path to the configuration file\n- `-p`: Port to listen on\n\n## Usage\n\n1. Start the server:\n\n   ```bash\n   ./web-smtp\n   ```\n\n2. Send a POST request to `http://localhost:8080/send` with the following JSON body:\n\n   ```json\n   {\n     \"subject\": \"Test Subject\",\n     \"body\": \"This is a test email\",\n     \"destinations\": [\"recipient@example.com\"]\n   }\n   ```\n\n   Include Basic Authentication headers with your request.\n\n## Docker\n\nThe project includes a Dockerfile and GitHub Actions workflow for building and pushing a multi-architecture Docker image.\n\nTo run the application using Docker:\n\n```bash\ndocker run -p 8080:8080 -v /path/to/your/config.yaml:/app/config.yaml sctg/web-smtp-relay:latest\n```\n\n## Helm Chart\n\nThis project includes a Helm chart for easy deployment to Kubernetes clusters. The chart creates a Deployment, Service, and ConfigMap for the Web-SMTP Relay application.\n\n### Prerequisites\n\n- Kubernetes cluster\n- Helm 3.x installed\n\n### Installing the Chart\n\n1. If you don't want to install the chart you can use our public Helm repository:\n\n```bash\n\nhelm repo add highcanfly \u003chttps://helm-repo.highcanfly.club/\u003e\nhelm repo update highcanfly\n\n```\n\nThen install the chart:\n\n```bash\nhelm upgrade --install --create-namespace --namespace web-smtp-relay web-smtp-relay highcanfly/web-smtp-relay --values values.yaml\n```\n\n2. Clone the repository or download the Helm chart files.\n\n3. Navigate to the chart directory:\n\n```bash\ncd web-smtp-relay\n```\n\n4. Install the chart with the release name `my-web-smtp-relay`:\n\n```bash\nhelm install my-web-smtp-relay .\n   ```\n\n### Customizing the Chart\n\nYou can customize the chart by modifying the `values.yaml` file or by passing values on the command line.\n\n#### Customizing values.yaml\n\nEdit the `values.yaml` file to change default values. For example:\n\n```yaml\nreplicaCount: 2\n\nimage:\n  repository: sctg/web-smtp-relay\n  tag: \"1.2.0\"\n\nconfig:\n  users:\n    admin: \n      password: $2y$12$2Rr0ZTQkfR08gxEDaT0DnukqKcITrjTnnV4cNwE23cEdMv1YSIHSK # admin123\n      # generated with `htpasswd -nbB -C 12 user admin123 | awk -F: '{print $2}'`\n      smtp:\n        # per user smtp configuration\n        host: smtp-for-admin.example.com\n        port: 587\n        username: your_username_specific_for_admin\n        password: your_password_specific_for_admin\n    user1:\n      password: $2y$12$viL9Crn/J7PXuEEHsQOXmuJaVE9jCs1AJqBucL.EN9sAyLE1qkzB6 # user1123\n      # generated with `htpasswd -nbB -C 12 user user1123\n      # no smtp configuration for user1 so it will use the default smtp configuration\n\n  smtp:\n    # default smtp configuration\n    host: smtp.example.com\n    port: 587\n    username: your_username\n    password: your_password\n\n  port: 8080\n  \ningress:\n  enabled: true\n  host: web-smtp-relay.mycompany.com\n  annotations: {}\n  clusterIssuer: \"cert-manager\"\n```\n\n#### Using command-line parameters\n\nYou can override values when installing or upgrading the chart:\n\n```bash\nhelm install my-web-smtp-relay . \\\n  --set replicaCount=3 \\\n  --set config.smtp.host=smtp.newhost.com \\\n  --set config.smtp.username=newuser \\\n  --set config.smtp.password=newpassword\n```\n\n### Configuration Options\n\n| Parameter | Description | Default |\n|-----------|-------------|---------|\n| `replicaCount` | Number of replicas for the deployment | `1` |\n| `image.repository` | Docker image repository | `yourdockerhubusername/web-smtp-relay` |\n| `image.tag` | Docker image tag | `\"latest\"` |\n| `image.pullPolicy` | Image pull policy | `IfNotPresent` |\n| `service.type` | Kubernetes service type | `ClusterIP` |\n| `service.port` | Kubernetes service port | `8080` |\n| `config.users` | Map of username to bcrypt hashed passwords | See `values.yaml` |\n| `config.smtp.host` | SMTP server hostname | `smtp.example.com` |\n| `config.smtp.port` | SMTP server port | `587` |\n| `config.smtp.username` | SMTP username | `your_username` |\n| `config.smtp.password` | SMTP password | `your_password` |\n| `config.port` | Application listening port | `8080` |\n| `resources` | CPU/Memory resource requests/limits | See `values.yaml` |\n\n### Updating the Chart\n\nTo update the chart with new values:\n\n```bash\nhelm upgrade my-web-smtp-relay . --reuse-values --set config.smtp.host=smtp.newhost.com\n```\n\n### Uninstalling the Chart\n\nTo uninstall/delete the `my-web-smtp-relay` deployment:\n\n```bash\nhelm uninstall my-web-smtp-relay\n```\n\n### Note on Secrets\n\nFor production use, it's recommended to use Kubernetes Secrets for sensitive information like SMTP credentials and user passwords. You can create a secret separately and reference it in the Helm chart. This example uses ConfigMap for simplicity, but for real-world scenarios, consider using Secrets for better security.\n\n## Tests\n\nTo run tests, configure the config.yaml file, launch the server and use the following command:\n\n```bash\nDESTINATION=\"youremail@example.com\" tests/external_tests.sh\n```\n\nor for a more realistic test:\n\n```bash\nSCHEME=https HOST=web-smtp-relay.example.com PORT=443 USER=myuser PASSWORD=user_password DESTINATION=myrealaddress@gmail.com tests/external_tests\n```\n\n## License\n\nThis project is licensed under the GNU Affero General Public License v3.0 (AGPLv3).\n\n### Key points of the AGPLv3\n\n1. Source Code: You must make the complete source code available when you distribute the software.\n2. Modifications: If you modify the software, you must release your modifications under the AGPLv3 as well.\n3. Network Use: If you run a modified version of the software on a server and allow users to interact with it over a network, you must make the source code of your modified version available.\n4. No Additional Restrictions: You cannot impose any further restrictions on the recipients' exercise of the rights granted by the license.\n\nFor the full license text, see the [LICENSE](LICENSE.md) file in the project repository or visit [GNU AGPL v3.0](https://www.gnu.org/licenses/agpl-3.0.en.html).\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## Support\n\nIf you encounter any problems or have any questions, please open an issue in the GitHub repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsctg-development%2Fweb-smtp-relay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsctg-development%2Fweb-smtp-relay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsctg-development%2Fweb-smtp-relay/lists"}