MailBot looks for config.json in the current working directory by default; pass -c PATH / --config PATH when launching if you want to point at a different location. The CLI menu or headless run will create the file automatically if it is missing.
To use a Gmail account, you must enable 2-Step Verification and generate an App Password.
Using your main Google account password is no longer supported for IMAP access.
- Enable 2-Step Verification: Go to your Google Account > Security settings.
- Create an App Password: Follow the official guide: Sign in with App Passwords (Google Support)
- Use the App Password: When MailBot asks for your password, enter the 16-character generated password.
You need a Telegram Bot Token to send messages and your User ID (Chat ID) to receive them.
- Open Telegram and search for
@BotFather. - Send the command
/newbot. - Follow the instructions to name your bot.
- Copy the HTTP API Token provided by BotFather (e.g.,
123456789:ABCdefGHIjklMNOpqrSTUvwxyz).
- Start a chat with your new bot and send a message (e.g.,
/start). - Search for
@userinfoboton Telegram. - Send any message to it. It will reply with your
Id(e.g.,12345678), or you can simply use the API method:- Visit:
https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates - Find the
"id"field under"chat".
- Visit:
- Enter this ID into MailBot when prompted.
If your IMAP provider or Telegram endpoint must be reached via a SOCKS/HTTP proxy, add a proxy block to your configuration or enable it through the menu's system settings. It supports:
scheme:socks5,socks4, orhttphost/port: address of the proxyusername/password: optional credentials
Configuration Example (add to config.json):
{
"proxy": {
"scheme": "socks5",
"host": "127.0.0.1",
"port": 1080,
"username": "user",
"password": "pass"
}
}With the proxy enabled MailBot automatically sets the http(s)_proxy environment variables and routes IMAP sockets through the proxy so all network traffic (IMAP fetching + Telegram API) obeys it. Use the CLI wizard's system settings if you prefer an interactive form.
For other providers (Outlook, Yahoo, iCloud, etc.), ensure that:
- IMAP Access is enabled in your account settings.
- You use an App Password if 2FA is enabled (highly recommended).