[GH-ISSUE #3197] [bug]: SMTP format is not working in Self host Hoppscotch #1052

Closed
opened 2026-03-16 18:17:26 +03:00 by kerem · 10 comments
Owner

Originally created by @venkatayedidasv on GitHub (Jul 18, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3197

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

while executing pnpm install , with below .env.example getting error. Have tried multiple ways with Mailcatcher as well. but it does not work

error:

/Users/userapi-testing/hoppscotch/hoppscotch/packages/hoppscotch-backend/src/utils.ts:21
│   throw new Error(errMessage);
│         ^
│ Error: mailer/smtp_url_undefined
│     at throwErr (/Users/user/api-testing/hoppscotch/hoppscotch/packages/hoppscotch-backend/src/utils.ts:21:9)
│     at Object.<anonymous> (/Users/user/api-testing/hoppscotch/hoppscotch/packages/hoppscotch-backend/src/mailer/mailer.module.ts:15:48)
│     at Module._compile (node:internal/modules/cjs/loader:1275:14)
│     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
│     at Module.load (node:internal/modules/cjs/loader:1133:32)
│     at Function.Module._load (node:internal/modules/cjs/loader:972:12)
│     at Module.require (node:internal/modules/cjs/loader:1157:19)
│     at require (node:internal/modules/helpers:119:18)
│     at Object.<anonymous> (/Users/user/api-testing/hoppscotch/hoppscotch/packages/hoppscotch-backend/src/auth/auth.module.ts:5:1)
│     at Module._compile (node:internal/modules/cjs/loader:1275:14)

.env.example:

# Prisma Config
DATABASE_URL=postgresql://postgres:password@localhost:5432/postgres

# Auth Tokens Config
JWT_SECRET="secret1233"
TOKEN_SALT_COMPLEXITY=10
MAGIC_LINK_TOKEN_VALIDITY= 3
REFRESH_TOKEN_VALIDITY="604800000" # Default validity is 7 days (604800000 ms) in ms
ACCESS_TOKEN_VALIDITY="86400000" # Default validity is 1 day (86400000 ms) in ms
SESSION_SECRET='mysecretpassword'

# Hoppscotch App Domain Config
REDIRECT_URL="http://localhost:3000"
WHITELISTED_ORIGINS = "http://localhost:3170,http://localhost:3000,http://localhost:3100"

# Github Auth Config
GITHUB_CLIENT_ID=""
GITHUB_CLIENT_SECRET=""
GITHUB_CALLBACK_URL="http://localhost:3170/v1/auth/github/callback"
GITHUB_SCOPE="user:email"

# Mailer config
MAILER_SMTP_URL="smtps://user@gmail.com:pass@smtp.gmail.com"
MAILER_ADDRESS_FROM='"Venkata Yedida" <user@gmail.com>'

# Rate Limit Config
RATE_LIMIT_TTL=60 # In seconds
RATE_LIMIT_MAX=100 # Max requests per IP

Steps to reproduce

  1. pnpm install
  2. error

Environment

Production

Version

Self-hosted

Originally created by @venkatayedidasv on GitHub (Jul 18, 2023). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3197 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior while executing `pnpm install `, with below .env.example getting error. Have tried multiple ways with Mailcatcher as well. but it does not work error: ``` /Users/userapi-testing/hoppscotch/hoppscotch/packages/hoppscotch-backend/src/utils.ts:21 │ throw new Error(errMessage); │ ^ │ Error: mailer/smtp_url_undefined │ at throwErr (/Users/user/api-testing/hoppscotch/hoppscotch/packages/hoppscotch-backend/src/utils.ts:21:9) │ at Object.<anonymous> (/Users/user/api-testing/hoppscotch/hoppscotch/packages/hoppscotch-backend/src/mailer/mailer.module.ts:15:48) │ at Module._compile (node:internal/modules/cjs/loader:1275:14) │ at Object.Module._extensions..js (node:internal/modules/cjs/loader:1329:10) │ at Module.load (node:internal/modules/cjs/loader:1133:32) │ at Function.Module._load (node:internal/modules/cjs/loader:972:12) │ at Module.require (node:internal/modules/cjs/loader:1157:19) │ at require (node:internal/modules/helpers:119:18) │ at Object.<anonymous> (/Users/user/api-testing/hoppscotch/hoppscotch/packages/hoppscotch-backend/src/auth/auth.module.ts:5:1) │ at Module._compile (node:internal/modules/cjs/loader:1275:14) ``` .env.example: ``` # Prisma Config DATABASE_URL=postgresql://postgres:password@localhost:5432/postgres # Auth Tokens Config JWT_SECRET="secret1233" TOKEN_SALT_COMPLEXITY=10 MAGIC_LINK_TOKEN_VALIDITY= 3 REFRESH_TOKEN_VALIDITY="604800000" # Default validity is 7 days (604800000 ms) in ms ACCESS_TOKEN_VALIDITY="86400000" # Default validity is 1 day (86400000 ms) in ms SESSION_SECRET='mysecretpassword' # Hoppscotch App Domain Config REDIRECT_URL="http://localhost:3000" WHITELISTED_ORIGINS = "http://localhost:3170,http://localhost:3000,http://localhost:3100" # Github Auth Config GITHUB_CLIENT_ID="" GITHUB_CLIENT_SECRET="" GITHUB_CALLBACK_URL="http://localhost:3170/v1/auth/github/callback" GITHUB_SCOPE="user:email" # Mailer config MAILER_SMTP_URL="smtps://user@gmail.com:pass@smtp.gmail.com" MAILER_ADDRESS_FROM='"Venkata Yedida" <user@gmail.com>' # Rate Limit Config RATE_LIMIT_TTL=60 # In seconds RATE_LIMIT_MAX=100 # Max requests per IP ``` ### Steps to reproduce 1. pnpm install 2. error ### Environment Production ### Version Self-hosted
kerem 2026-03-16 18:17:26 +03:00
Author
Owner

@venkatayedidasv commented on GitHub (Jul 19, 2023):

it is resolved

<!-- gh-comment-id:1641952991 --> @venkatayedidasv commented on GitHub (Jul 19, 2023): it is resolved
Author
Owner

@venkatayedidasv commented on GitHub (Jul 19, 2023):

i was able to fix it, there is different error as i have am using M1 mac will raise a new one for this

<!-- gh-comment-id:1641954104 --> @venkatayedidasv commented on GitHub (Jul 19, 2023): i was able to fix it, there is different error as i have am using M1 mac will raise a new one for this
Author
Owner

@NassaDevops commented on GitHub (Jul 27, 2023):

How did you resolved it?

<!-- gh-comment-id:1654661312 --> @NassaDevops commented on GitHub (Jul 27, 2023): > How did you resolved it?
Author
Owner

@venkatayedidasv commented on GitHub (Jul 28, 2023):

First things i have changed the host of the SMTP server to "smtp://host.docker.internal:1025" as i am running the mailcatcher locally
and check if you have renamed example.env to .env

<!-- gh-comment-id:1655485154 --> @venkatayedidasv commented on GitHub (Jul 28, 2023): > First things i have changed the host of the SMTP server to "smtp://host.docker.internal:1025" as i am running the mailcatcher locally and check if you have renamed example.env to .env
Author
Owner

@NassaDevops commented on GitHub (Jul 28, 2023):

First things i have changed the host of the SMTP server to "smtp://host.docker.internal:1025" as i am running the mailcatcher locally and check if you have renamed example.env to .env

It worked for me changing smtps:// for smtp:// and at the end specifying the port 587.
I was using the smtp.outlook365.com

Thank you

<!-- gh-comment-id:1655968448 --> @NassaDevops commented on GitHub (Jul 28, 2023): > > > > First things i have changed the host of the SMTP server to "smtp://host.docker.internal:1025" as i am running the mailcatcher locally and check if you have renamed example.env to .env It worked for me changing smtps:// for smtp:// and at the end specifying the port 587. I was using the smtp.outlook365.com Thank you
Author
Owner

@ifnotnithya commented on GitHub (Aug 19, 2023):

Hi, I am running into the same error. And do not want to use mailcatcher. What is the resolution to use gmail?

<!-- gh-comment-id:1685080656 --> @ifnotnithya commented on GitHub (Aug 19, 2023): Hi, I am running into the same error. And do not want to use mailcatcher. What is the resolution to use gmail?
Author
Owner

@philippos86 commented on GitHub (Sep 14, 2023):

Hi, I am running into the same error. And do not want to use mailcatcher. What is the resolution to use gmail?

Same question here ...
Although mailcatcher worked for me, it's actually not sending invitaion mails to my team members.

<!-- gh-comment-id:1719015174 --> @philippos86 commented on GitHub (Sep 14, 2023): > Hi, I am running into the same error. And do not want to use mailcatcher. What is the resolution to use gmail? Same question here ... Although mailcatcher worked for me, it's actually not sending invitaion mails to my team members.
Author
Owner

@suiluj commented on GitHub (Sep 22, 2023):

i just want to disable the whoe mail feature and only want to try hoppscotch locally. How to disable unnecessary extra feature for small local tests?

<!-- gh-comment-id:1731255626 --> @suiluj commented on GitHub (Sep 22, 2023): i just want to disable the whoe mail feature and only want to try hoppscotch locally. How to disable unnecessary extra feature for small local tests?
Author
Owner

@NassaDevops commented on GitHub (Sep 22, 2023):

This is my configuration for the mailer setup using Outlook.. I guess it should work with the equivalents of gmail SMTP configuration

Mailer config

MAILER_SMTP_URL="smtp://EMAILADDRESS:PASSWORD@smtp.office365.com:587"
MAILER_ADDRESS_FROM='"NAME" '

<!-- gh-comment-id:1731681508 --> @NassaDevops commented on GitHub (Sep 22, 2023): This is my configuration for the mailer setup using Outlook.. I guess it should work with the equivalents of gmail SMTP configuration # Mailer config MAILER_SMTP_URL="smtp://EMAILADDRESS:PASSWORD@smtp.office365.com:587" MAILER_ADDRESS_FROM='"NAME" <EMAILADDRESS>'
Author
Owner

@ChuTungLinh commented on GitHub (Sep 25, 2023):

This is my configuration for the mailer setup using Outlook.. I guess it should work with the equivalents of gmail SMTP configuration

Mailer config

MAILER_SMTP_URL="smtp://EMAILADDRESS:PASSWORD@smtp.office365.com:587" MAILER_ADDRESS_FROM='"NAME" '

by "PASSWORD" do u mean the account password or the account's app password ? sorry im new to this stuff

<!-- gh-comment-id:1732762581 --> @ChuTungLinh commented on GitHub (Sep 25, 2023): > This is my configuration for the mailer setup using Outlook.. I guess it should work with the equivalents of gmail SMTP configuration > > # Mailer config > MAILER_SMTP_URL="smtp://EMAILADDRESS:[PASSWORD@smtp.office365.com](mailto:PASSWORD@smtp.office365.com):587" MAILER_ADDRESS_FROM='"NAME" ' by "PASSWORD" do u mean the account password or the account's app password ? sorry im new to this stuff
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1052
No description provided.