Serveur SMTP factice pour le développement avec interface web
Go to file
wpetit 888ff2ec47 chore: generate tag before building docker image 2024-03-21 09:20:58 +01:00
cmd/fake-smtp feat: migrate project to cadoles org 2024-03-21 09:11:50 +01:00
internal feat: migrate project to cadoles org 2024-03-21 09:11:50 +01:00
misc feat(docker): use go 1.21 2024-02-27 17:14:25 +01:00
.dockerignore Fix docker build recipe 2022-11-22 15:18:28 -06:00
.env.dist Initial commit 2020-04-18 23:15:21 +02:00
.gitignore chore: docker image release with new tagging scheme 2024-02-27 17:38:04 +01:00
.nvmrc build(deps): update node version 2024-02-27 15:50:00 +01:00
LICENCE Add licence 2020-04-20 09:25:49 +02:00
Makefile chore: generate tag before building docker image 2024-03-21 09:20:58 +01:00
README.md feat: migrate project to cadoles org 2024-03-21 09:11:50 +01:00
go.mod feat: migrate project to cadoles org 2024-03-21 09:11:50 +01:00
go.sum chore: update go dependencies 2024-02-27 17:26:32 +01:00
modd.conf Initial commit 2020-04-18 23:15:21 +02:00
package-lock.json build(deps): bump nodejs to 20.x & update node modules 2024-02-27 14:26:12 +01:00
package.json build(deps): bump nodejs to 20.x & update node modules 2024-02-27 14:26:12 +01:00
webpack.config.js build(deps): bump nodejs to 20.x & update node modules 2024-02-27 14:26:12 +01:00

README.md

📬 FakeSMTP

Serveur SMTP factice pour le développement avec interface web.

Aperçu de l'interface Web

Utilisation

Avec Docker

docker run -it --rm -p 8080:8080 -p 2525:2525 reg.cadoles.com/cadoles/fake-smtp

L'interface Web sera accessible à l'adresse http://localhost:8080/.

Le serveur SMTP sera accessible sur le port 2525. L'authentification est désactivée par défaut.

Voir la section "Variables d'environnement" pour voir comment personnaliser la configuration du service.

Avec les binaires

TODO

Configuration

Fichier de configuration

Le fichier de configuration de FakeSMTP est au format YAML.

Voici la structure du fichier par défaut:

# Configuration HTTP
http:
  address: :8080
  templateDir: template
  publicDir: public

# Configuration SMTP
smtp:
  address: :2525
  username: ""
  password: ""
  domain: localhost
  readTimeout: 30s
  writeTimeout: 30s
  maxMessageBytes: 1048576
  maxRecipients: 50
  allowInsecureAuth: true
  debug: true

# Configuration du stockage
data:
  path: fakesmtp.db

# Configuration du relais SMTP
relay:
  enabled: false # Activer/désactiver le relais SMTP
  address: "" # Adresse du serveur au format "host:port"
  identity: "" # Identité du compte utilisateur, peut être laissé vide
  username: "" # Identifiant du compte SMTP, non utilisé sur anonymous = true
  password: "" # Mot de passe du compte SMTP, non utilisé sur anonymous = true
  anonymous: false # Utiliser le mode d'authentification "anonyme"
  useTLS: false # Utiliser TLS pour se connecter au serveur SMTP
  insecureSkipVerify: true # Ne pas vérifier le certificat du serveur pour les connexions TLS/STARTTLS
  fromOverride: "" # Surcharger l'adresse émetteur des courriels transmis

Variables d'environnement

La configuration de FakeSMTP peut être personnalisée via des variables d'environnement.

Les valeurs des variables d'environnement surchargent les valeurs présentes dans le fichier de configuration.

Variable Correspondance dans le fichier de configuration
FAKESMTP_HTTP_ADDRESS http.address
FAKESMTP_HTTP_TEMPLATEDIR http.templateDir
FAKESMTP_HTTP_PUBLICDIR http.publicDir
FAKESMTP_SMTP_ADDRESS smtp.address
FAKESMTP_SMTP_USERNAME smtp.username
FAKESMTP_SMTP_PASSWORD smtp.password
FAKESMTP_SMTP_DOMAIN smtp.domain
FAKESMTP_SMTP_READTIMEOUT smtp.readTimeout
FAKESMTP_SMTP_WRITETIMEOUT smtp.writeTimeout
FAKESMTP_SMTP_MAXMESSAGEBYTES smtp.maxMessageBytes
FAKESMTP_SMTP_MAXRECIPIENTS smtp.maxRecipients
FAKESMTP_SMTP_ALLOWINSECUREAUTH smtp.allowInsecureAuth
FAKESMTP_SMTP_DEBUG smtp.debug
FAKESMTP_DATA_PATH data.path
FAKESMTP_RELAY_ENABLED relay.enabled
FAKESMTP_RELAY_ADDRESS relay.address
FAKESMTP_RELAY_IDENTITY relay.identity
FAKESMTP_RELAY_USERNAME relay.username
FAKESMTP_RELAY_PASSWORD relay.password
FAKESMTP_RELAY_ANONYMOUS relay.anonymous
FAKESMTP_RELAY_INSECURE_SKIP_VERIFY relay.insecureSkipVerify
FAKESMTP_RELAY_FROM_OVERRIDE relay.fromOverride

Démarrer avec les sources

Dépendances

  • Go 1.21
  • modd
  • make
  • NodeJS/npm

Compiler et démarrer le serveur de développement

Dans un terminal:

npm install
make watch

FAQ

Générer une version de distribution

make release

Licence

AGPL-3.0