Skip to content

Scheduling infrastructure for absolutely everyone.

feat: catch emails sent locally using Mailhog (#8470)

Jon@15993c46c391143a
diff --git a/.env.example b/.env.example
index 0a75c7390a3..d1023ca7c0f 100644
--- a/.env.example
+++ b/.env.example
@@ -138,12 +138,16 @@ API_KEY_PREFIX=cal_
EMAIL_FROM='[email protected]'
# Configure SMTP settings (@see https://nodemailer.com/smtp/).
+# Configuration to receive emails locally (mailhog)
+EMAIL_SERVER_HOST='localhost'
+EMAIL_SERVER_PORT=1025
+
# Note: The below configuration for Office 365 has been verified to work.
-EMAIL_SERVER_HOST='smtp.office365.com'
-EMAIL_SERVER_PORT=587
-EMAIL_SERVER_USER='<office365_emailAddress>'
+# EMAIL_SERVER_HOST='smtp.office365.com'
+# EMAIL_SERVER_PORT=587
+# EMAIL_SERVER_USER='<office365_emailAddress>'
# Keep in mind that if you have 2FA enabled, you will need to provision an App Password.
-EMAIL_SERVER_PASSWORD='<office365_password>'
+# EMAIL_SERVER_PASSWORD='<office365_password>'
# The following configuration for Gmail has been verified to work.
# EMAIL_SERVER_HOST='smtp.gmail.com'
diff --git a/README.md b/README.md
index 6ded34330f1..dd0fd9a1b58 100644
--- a/README.md
+++ b/README.md
@@ -200,6 +200,12 @@ echo 'NEXT_PUBLIC_DEBUG=1' >> .env
```sh
yarn workspace @calcom/prisma db-deploy
```
+1. Run [mailhog](https://github.com/mailhog/MailHog) to view emails sent during development
+
+ ```sh
+ docker pull mailhog/mailhog
+ docker run -d -p 8025:8025 -p 1025:1025 mailhog/mailhog
+ ```
1. Run (in development mode)
diff --git a/packages/emails/docker-compose.yml b/packages/emails/docker-compose.yml
new file mode 100644
index 00000000000..4eaf50158df
--- /dev/null
+++ b/packages/emails/docker-compose.yml
@@ -0,0 +1,8 @@
+# Starts mailhog SMTP server on port 1025, web interface on port 8025
+version: "3.6"
+services:
+ mailhog:
+ image: 'mailhog/mailhog:latest'
+ ports:
+ - "1025:1025"
+ - "8025:8025"
diff --git a/packages/emails/package.json b/packages/emails/package.json
index 9454e7db252..786d6ab25ee 100644
--- a/packages/emails/package.json
+++ b/packages/emails/package.json
@@ -3,6 +3,9 @@
"sideEffects": false,
"version": "0.0.0",
"private": true,
+ "scripts": {
+ "dx": "docker compose up -d"
+ },
"dependencies": {
"@calcom/dayjs": "*",
"@calcom/lib": "*",