A Telegram bot for generating and managing temporary email addresses using the mail.tm API.
Built and maintained by BokuLabs.
- Generate temporary email addresses instantly
- Receive OTP and verification emails directly in Telegram
- Check inbox without leaving Telegram
- Read email content inside Telegram
- Download email attachments
- Automatic session recovery
- Per-user mailbox isolation
- Simple anti-spam rate limiting
- JSON-based local storage
- Node.js 18 or newer
- Telegram Bot Token from @BotFather
Clone repository:
git clone https://github.com/BokuLabs/tempmail-bot.git
cd tempmail-botInstall dependencies:
npm installCreate environment file:
cp .env.example .envEdit .env:
BOT_TOKEN=YOUR_BOT_TOKENStart bot:
npm startRecommended for VPS deployment.
Install PM2:
npm install -g pm2Start bot:
pm2 start index.js --name tempmail-botSave process list:
pm2 saveEnable startup:
pm2 startupUseful commands:
pm2 status
pm2 logs tempmail-bot
pm2 restart tempmail-bot
pm2 stop tempmail-bot| Variable | Required | Description |
|---|---|---|
| BOT_TOKEN | Yes | Telegram bot token |
| RATE_LIMIT_MS | No | User cooldown in milliseconds |
| DB_PATH | No | Path to local JSON database |
Example:
BOT_TOKEN=123456789:ABCDEF
RATE_LIMIT_MS=2000
DB_PATH=./database.json| Command | Description |
|---|---|
| /start | Show welcome message |
| Generate a new temporary email | |
| /inbox | View received emails |
| /otp | Show recent verification emails |
| /delete | Remove current mailbox |
| /help | Display help menu |
tempmail-bot/
├── index.js
├── package.json
├── .env.example
├── database.json
└── src/
├── mailtm.js
├── db.js
├── keyboards.js
├── rateLimit.js
└── utils.js
- User requests a temporary email address.
- The bot creates and manages the mailbox through the mail.tm API.
- Incoming emails are automatically available inside Telegram.
- Verification emails and OTP codes can be viewed directly from the bot.
- Attachments can be downloaded from Telegram without opening a browser.
- Temporary email addresses may expire at any time.
- This bot is intended for temporary and disposable email usage.
- Users only access the inbox through Telegram.
- Mailbox passwords are not exposed to end users.
- Do not use temporary email addresses for important or permanent accounts.
- Powered by mail.tm.
Never upload:
.env
database.json
node_modules/
logs/
Example .gitignore:
node_modules
.env
database.json
logs
*.logMIT License
Copyright (c) BokuLabs
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files to deal in the Software without restriction.
See the LICENSE file for full details.
Website: https://bokushops.com
GitHub: https://github.com/BokuLabs