Skip to content

BokuLabs/tempmail-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📬 TempMail Bot

A Telegram bot for generating and managing temporary email addresses using the mail.tm API.

Built and maintained by BokuLabs.


Features

  • 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

Requirements

  • Node.js 18 or newer
  • Telegram Bot Token from @BotFather

Installation

Clone repository:

git clone https://github.com/BokuLabs/tempmail-bot.git
cd tempmail-bot

Install dependencies:

npm install

Create environment file:

cp .env.example .env

Edit .env:

BOT_TOKEN=YOUR_BOT_TOKEN

Start bot:

npm start

Running with PM2

Recommended for VPS deployment.

Install PM2:

npm install -g pm2

Start bot:

pm2 start index.js --name tempmail-bot

Save process list:

pm2 save

Enable startup:

pm2 startup

Useful commands:

pm2 status
pm2 logs tempmail-bot
pm2 restart tempmail-bot
pm2 stop tempmail-bot

Environment Variables

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

Commands

Command Description
/start Show welcome message
/email Generate a new temporary email
/inbox View received emails
/otp Show recent verification emails
/delete Remove current mailbox
/help Display help menu

Project Structure

tempmail-bot/
├── index.js
├── package.json
├── .env.example
├── database.json
└── src/
    ├── mailtm.js
    ├── db.js
    ├── keyboards.js
    ├── rateLimit.js
    └── utils.js

How It Works

  1. User requests a temporary email address.
  2. The bot creates and manages the mailbox through the mail.tm API.
  3. Incoming emails are automatically available inside Telegram.
  4. Verification emails and OTP codes can be viewed directly from the bot.
  5. Attachments can be downloaded from Telegram without opening a browser.

Notes

  • 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.

Security

Never upload:

.env
database.json
node_modules/
logs/

Example .gitignore:

node_modules
.env
database.json
logs
*.log

License

MIT 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.


Links

Website: https://bokushops.com

GitHub: https://github.com/BokuLabs

About

Temporary email bot for Telegram powered by Mail.tm. Create disposable inboxes, receive emails instantly, and manage temporary addresses directly from Telegram.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors