Serveur SMTP factice pour le développement avec interface web
Go to file
wpetit 40b2689952 Merge branch 'develop' into dist/ubuntu/bionic/develop 2021-07-30 16:25:21 +02:00
cmd/fake-smtp Add missing base url in clear inbox endpoint url 2021-07-30 16:25:00 +02:00
debian Add Debian packaging files 2020-04-30 10:19:27 +02:00
internal Add BaseURL config parameter 2021-07-26 14:47:58 +02:00
misc Allow email relaying to a real MTA 2020-11-05 19:48:18 +01:00
.dockerignore Fix Docker packaging 2020-06-17 23:49:11 +02:00
.env.dist Initial commit 2020-04-18 23:15:21 +02:00
.gitignore Initial commit 2020-04-18 23:15:21 +02:00
LICENCE Add licence 2020-04-20 09:25:49 +02:00
Makefile Tag Docker image with release date 2020-11-03 12:43:16 +01:00
README.md Update README 2020-11-06 09:44:30 +01:00
go.mod Allow email relaying to a real MTA 2020-11-05 19:48:18 +01:00
go.sum Allow email relaying to a real MTA 2020-11-05 19:48:18 +01:00
modd.conf Initial commit 2020-04-18 23:15:21 +02:00
package-lock.json Upgrade node-sass 2021-07-26 14:48:24 +02:00
package.json Upgrade node-sass 2021-07-26 14:48:24 +02:00
webpack.config.js Initial commit 2020-04-18 23:15:21 +02: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 bornholm/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.13
  • 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