GoTMail (Go Temporary Mail) is temporary email CLI tool written in Go for mail.tm, providing cross-platform temporary email management functionality.
- Multi-Account Management: Support creating and managing multiple temporary email accounts (up to 10)
- Temporary Email Creation: Quickly create temporary email accounts
- Message Management: Fetch and list received email messages
- Email Viewing: Open specific emails in your browser
- Account Management: View account details and delete accounts
- Data Export: Export all accounts or specific account data to specified paths
- Cross-platform Support: Support for Windows, macOS, and Linux
- Clipboard Integration: Automatically copy email addresses to clipboard
- Command Line Interface: Simple and easy-to-use CLI operations
- Backward Compatibility: Support automatic conversion of old single-account files
- Windows
scoop bucket add scoopforge/main-plus
scoop install gotmail- macOS and Linux
brew tap brewforge/more
brew install gotmailAfter installation, run
xattr -r -d com.apple.quarantine $HOMEBREW_PREFIX/bin/gotmailto allow execution.
- Alternative method (requires Go 1.18 or higher)
go install github.com/ivaquero/gotmailCreate a new temporary email account:
gotmail newList all accounts:
gotmail lsView account details:
gotmail showDelete account:
gotmail delView received emails:
gotmail msgOpen a specific email in your browser:
gotmail open 1Export account data:
gotmail export /backup/folder/For multi-account scenarios, most commands support the --id parameter to specify a particular account:
# View emails for a specific account
gotmail msg --id abc123
# View details for a specific account
gotmail show --id abc123
# Delete a specific account
gotmail del --id abc123
# Open specific email from specific account
gotmail open 1 --id abc123
# Export specific account data
gotmail export ./backup/folder --id abc123| Command | Description | Example |
|---|---|---|
new |
Create a new temporary email account | gotmail new |
ls |
List all accounts | gotmail ls |
msg |
Fetch and list all emails | gotmail msg |
msg --id <id> |
Fetch emails for a specific account | gotmail msg --id abc123 |
open <number> |
Open specified email in browser | gotmail open 1 |
open <number> --id <id> |
Open specified email for specific account | gotmail open 1 --id abc123 |
show |
Display current account details | gotmail show |
show --id <id> |
Display specific account details | gotmail show --id abc123 |
del |
Delete current account | gotmail del |
del --id <id> |
Delete specific account | gotmail del --id abc123 |
export <folder> |
Export all account data to specified folder | gotmail export backup/folder |
export <folder> --id <id> |
Export specific account data to specified folder | gotmail export backup/folder --id abc123 |
help |
Show help information | gotmail help |
help <command> |
Show detailed help for specific command | gotmail help msg |
- Go 1.18 or higher
git clone https://github.com/ivaquero/gotmail
cd gotmail
go buildgo test ./tests/... -v- Follow Go standard code formatting
- Use structured error handling
- Provide detailed error information
- Maintain cross-platform compatibility
- Cryptographic Random Generation: Use
crypto/randto generate secure random strings - Error Fallback Mechanism: Provide fallback solutions when cryptographic random generation fails
- Input Validation: Validate API responses and user inputs
- Secure Data Storage: Store account data securely in JSON format
This project uses the Mail.tm API to provide temporary email services:
- API Endpoint:
https://api.mail.tm - Feature Support: Account creation, email retrieval, account deletion
- Data Format: JSON
- Authentication: Bearer Token
Account data is stored in a local file:
- File Path:
~/.gotmail.json - Data Format: JSON
- Contains: Multiple accounts with ID, email address, password, authentication token
- Backward Compatibility: Automatically converts old single-account file formats
You can export all account data to any specified path using the export command:
gotmail export /path/to/backup/Or export data for a specific account:
gotmail export /path/to/backup/ --id abc123The exported file will be an exact copy of the original account data file, preserving all account information and formatting.
GoTMail now supports creating and managing multiple temporary email accounts (up to 10):
- Create New Account: Use
gotmail newto create a new account - View All Accounts: Use
gotmail lsto list all created accounts - Account-Specific Operations: Most commands support the
--id <account_id>parameter to specify which account to operate on - Backward Compatibility: For single-account scenarios, commands can still be used without the
--idparameter
When performing operations that require an account, if multiple accounts exist, the system will prompt you to select which account to use.
The project implements comprehensive error handling mechanisms:
- Network Errors: Handle API connection failures
- File Operation Errors: Handle data read/write failures
- Clipboard Errors: Handle cross-platform clipboard operation failures
- API Response Errors: Handle API error status returns
Issues and Pull Requests are welcome to improve the project:
- Fork the project repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add some amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Create a Pull Request
This project is licensed under the MIT License.
- mail.tm for providing temporary email services
Note: This is a temporary email tool, please do not use it to receive important or sensitive information.