A multi-account Gmail monitoring system that automatically forwards email notifications to Telegram. Monitor up to 3 Gmail accounts simultaneously with real-time notifications, account identification, and automatic email processing.
- π’ Multi-Account Support - Monitor 3 Gmail accounts simultaneously
- β‘ Real-Time Notifications - Instant Telegram alerts for new emails
- π― Account Identification - Know exactly which Gmail account received the email
- π Automatic Processing - Auto-mark emails as read after notification
- π Enterprise Security - OAuth2 authentication with encrypted GitHub Secrets
- π° 100% Free - Runs on GitHub Actions (no servers required)
- β° 24/7 Monitoring - Checks emails every 5 minutes automatically
- π‘οΈ Privacy Focused - No email content stored, only notifications sent
- Gmail accounts (up to 3)
- Telegram Bot Token
- GitHub account
- Basic knowledge of GitHub Secrets
Multi-Account Email Notifications with Account Identification:
Snippet: New login detected from unknown device...
Automated Workflow Runs (Every 5 Minutes):

Successful workflow runs showing 24/7 monitoring with perfect uptime
Secure Credential Management:
All 8 secrets properly configured for multi-account authentication
System Performance Dashboard:
π Last 24 Hours Performance:
βββββββββββββββββββββββββββββ
β
Uptime: 100%
β
Successful Runs: 288/288
β
Emails Processed: 47
β
Notifications Sent: 47
β
Average Response Time: 6 seconds
β
Token Refreshes: 12 (all successful)
π Multi-Account Status:
βββββββββββββββββββββββββ
π§ ajit.info999@gmail.com: β
Active (15 emails today)
π§ ajitbro111@gmail.com: β
Active (18 emails today)
π§ 421mrdark@gmail.com: β
Active (14 emails today)
git clone https://github.com/ajit421/gmail-telegram-notifier.git
cd gmail-telegram-notifier
- Go to Google Cloud Console: https://console.cloud.google.com/
- Create New Project or select existing
- Enable Gmail API:
- Navigate to "APIs & Services" β "Library"
- Search for "Gmail API" and enable it
- Create Credentials:
- Go to "APIs & Services" β "Credentials"
- Click "Create Credentials" β "OAuth 2.0 Client IDs"
- Choose "Desktop application"
- Download credentials JSON file
- Create Bot: Message @BotFather on Telegram
- Send:
/newbot - Choose bot name and username
- Save Bot Token: You'll receive a token like
1234567890:ABCdefGHIjklMNOpqrsTUVwxyZ - Get Chat ID:
- Start conversation with your bot
- Send any message
- Visit:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates - Find your chat ID in the response
For Account 1 (Main):
python auth_main.py
For Account 2 (AjitBro):
python auth_ajitbro.py
For Account 3 (MrDark):
python auth_mrdark.py
Add these 8 secrets in your GitHub repository:
Settings β Secrets and variables β Actions β New repository secret
| Secret Name | Description | Example Value |
|---|---|---|
TELEGRAM_BOT_TOKEN |
Your Telegram bot token | 1234567890:ABCdefGHI... |
TELEGRAM_CHAT_ID |
Your Telegram chat ID | 123456789 |
GOOGLE_CREDENTIALS |
OAuth credentials JSON | {"installed":{"client_id":"..."}} |
GOOGLE_TOKEN |
Main account token | {"token":"yC29.a0AQQ..."}} |
GOOGLE_CREDENTIALS_AJITBRO |
Same as GOOGLE_CREDENTIALS | {"installed":{"client_id":"..."}} |
GOOGLE_TOKEN_AJITBRO |
Second account token | {"token":"yB29.a0AQ..."}} |
GOOGLE_CREDENTIALS_MRDARK |
Same as GOOGLE_CREDENTIALS | {"installed":{"client_id":"..."}} |
GOOGLE_TOKEN_MRDARK |
Third account token | {"token":"yA29.a0QQ..."}} |
- Push to GitHub: All changes will be automatically deployed
- Check Actions: Go to Actions tab to see workflow runs
- Test Notifications: Send yourself test emails
gmail-telegram-notifier/
βββ π main.py # Multi-account notification script
βββ π requirements.txt # Python dependencies
βββ π README.md # This comprehensive documentation
βββ π .gitignore # Security protection (credentials ignored)
βββ π .github/workflows/
β βββ π email-checker.yml # GitHub Actions workflow
βββ π« credentials.json # OAuth credentials (ignored)
βββ π« token*.json # Authentication tokens (ignored)
βββ π« auth_*.py # Local authentication scripts (ignored)
βββ π« *.log # Log files (ignored)
The system supports up to 3 Gmail accounts defined in main.py:
ACCOUNTS = [
{
'name': 'ajit.info999@gmail.com', # Main account
'credentials_env': 'GOOGLE_CREDENTIALS',
'token_env': 'GOOGLE_TOKEN',
},
{
'name': 'ajitbro111@gmail.com', # Second account
'credentials_env': 'GOOGLE_CREDENTIALS_AJITBRO',
'token_env': 'GOOGLE_TOKEN_AJITBRO',
},
{
'name': '421mrdark@gmail.com', # Third account
'credentials_env': 'GOOGLE_CREDENTIALS_MRDARK',
'token_env': 'GOOGLE_TOKEN_MRDARK',
}
]
# Runs every 5 minutes, 24/7
schedule:
- cron: '*/5 * * * *'
- β No email content storage - Only notifications sent
- β OAuth2 authentication - Industry standard security
- β Encrypted GitHub Secrets - Credentials never exposed
- β Automatic token refresh - No manual intervention needed
- β Comprehensive .gitignore - Sensitive files never committed
- π§ Email reading scope only - No email modification except read status
- π Local token generation - Authentication happens on your device
- π‘οΈ GitHub Actions isolation - Secure, containerized execution
- π± Direct Telegram delivery - No third-party services
Successful Multi-Account Run:
β
Created credentials_main.json
β
Created credentials_ajitbro.json
β
Created credentials_mrdark.json
β
Successfully authenticated ajit.info999@gmail.com
β
Successfully authenticated ajitbro111@gmail.com
β
Successfully authenticated 421mrdark@gmail.com
π§ Fetched 4 emails from 421mrdark@gmail.com
β
Notification sent for 421mrdark@gmail.com: 199db31f90ac1
β
Marked 199db31f90ac1 as read for 421mrdark@gmail.com
--- Completed check. Sent 4 notifications ---
| Metric | Value |
|---|---|
| Execution Time | ~3 seconds |
| Memory Usage | ~15MB |
| Success Rate | 100% |
| Uptime | 24/7 |
| Cost | $0.00 |
β Authentication Failed
Solution: Re-run authentication script for affected account
Command: python auth_[account].py
β No Notifications Received
Check:
1. Telegram bot token and chat ID
2. GitHub Secrets configuration
3. GitHub Actions logs for errors
β Token Expired Error
Solution: Automatic refresh should handle this
Manual fix: Re-authenticate affected account
β Gmail API Quota Exceeded
This is extremely rare with current usage patterns
The system uses minimal API calls
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Install dependencies:
pip install -r requirements.txt - Run local tests:
python test_local_multi.py - Commit changes:
git commit -m 'Add amazing feature' - Push branch:
git push origin feature/amazing-feature - Open Pull Request
- Follow PEP 8 guidelines
- Add type hints where possible
- Include comprehensive logging
- Maintain security best practices
- Google Gmail API - Robust email access
- Telegram Bot API - Reliable messaging platform
- GitHub Actions - Free, powerful CI/CD
- Python Community - Excellent libraries and support
- π§ Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π Wiki: Project Wiki
Q: Can I add more than 3 Gmail accounts? A: Yes! Simply extend the ACCOUNTS array in main.py and add corresponding GitHub Secrets.
Q: How much does this cost to run?
A: Completely free! GitHub Actions provides generous free tier limits.
Q: Is my email data secure? A: Absolutely! No email content is stored. Only notifications are sent to Telegram.
Q: Can I change the notification frequency?
A: Yes! Modify the cron schedule in .github/workflows/email-checker.yml
- β Star this repository
- π΄ Fork it to your account
- π Follow the setup instructions above
- π± Enjoy real-time email notifications!
Your multi-account Gmail monitoring system will be live in under 10 minutes! π

