diff --git a/.gitignore b/.gitignore index 1ed2864..9d84877 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ /release -/data +data/fakesmtp.db /vendor /bin /node_modules /.env /tools -.mktools/ +.mktools/ \ No newline at end of file diff --git a/README.md b/README.md index a38d848..b0a315d 100644 --- a/README.md +++ b/README.md @@ -58,15 +58,15 @@ data: # 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 + 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 @@ -75,30 +75,38 @@ La configuration de FakeSMTP peut être personnalisée via des variables d'envir 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`| +| 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` | + +### Lancer en mode read-only + +Pour lancer le conteneur en mode read-only, la variable `FAKESMTP_DATA_PATH` doit être définie et un volume doit être créé à cet emplacement. Exemple avec docker : + +```sh +docker run -it --rm -p 8080:8080 -p 2525:2525 --env FAKESMTP_DATA_PATH='/app/data/fakesmtp.db' --read-only -v $(pwd)/data:/app/data bornholm/fake-smtp +``` ## Démarrer avec les sources @@ -128,4 +136,4 @@ make release ## Licence -AGPL-3.0 \ No newline at end of file +AGPL-3.0 diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29