A smart email monitoring and reminder system that automatically scans your Gmail inbox for important emails and sends you reminders when action is needed.
- Automated Email Scanning: Monitors your Gmail inbox for specific keywords
- Smart Categorization: Automatically labels emails as "Urgent" or "Offers" based on content
- Reminder System: Sends you email reminders for emails that need attention
- REST API: Simple HTTP endpoints to trigger email processing
- Configuration Management: Easy-to-use API for updating settings
- CORS Support: Ready for frontend integration
- .NET 8.0 SDK
- Gmail account with App Password enabled
- IMAP access enabled in Gmail
-
Clone the repository
git clone <repository-url> cd Rappelon-api
-
Configure your Gmail settings
Copy
config.example.json
toconfig.json
and update with your credentials:{ "imap_server": "imap.gmail.com", "smtp_server": "smtp.gmail.com", "smtp_port": 465, "email_user": "your-email@gmail.com", "email_pass": "your-app-password", "keywords_urgent": ["urgent", "immediate", "important"], "keywords_offre": ["offer", "promotion", "deal"], "check_folder": "INBOX", "max_emails_to_check": 20 }
-
Restore packages and run
dotnet restore dotnet build dotnet run
-
Access the API
- Swagger UI:
https://localhost:7198/swagger
- API Base URL:
https://localhost:7198/api
- Swagger UI:
GET /api/email/check
- Trigger email scanning and processing
GET /api/config
- Get current configurationPUT /api/config
- Update configuration
The system uses a config.json
file with the following parameters:
Parameter | Description | Example |
---|---|---|
imap_server |
Gmail IMAP server | "imap.gmail.com" |
smtp_server |
Gmail SMTP server | "smtp.gmail.com" |
smtp_port |
SMTP port (usually 465) | 465 |
email_user |
Your Gmail address | "user@gmail.com" |
email_pass |
Gmail App Password | "abcdefghijklmnop" |
keywords_urgent |
Keywords for urgent classification | ["urgent", "asap"] |
keywords_offre |
Keywords for offer classification | ["sale", "discount"] |
check_folder |
Gmail folder to monitor | "INBOX" |
max_emails_to_check |
Number of recent emails to scan | 20 |
- Enable 2-Factor Authentication on your Gmail account
- Generate an App Password:
- Go to Google Account settings
- Security β 2-Step Verification β App passwords
- Generate a password for "Mail"
- Use this password in
config.json
- Enable IMAP:
- Gmail Settings β Forwarding and POP/IMAP
- Enable IMAP access
βββ Controllers/
β βββ EmailController.cs # Email processing endpoints
β βββ ConfigController.cs # Configuration management
βββ Services/
β βββ EmailProcessor.cs # Core email processing logic
βββ Models/
β βββ Config.cs # Configuration model
βββ config.json # Application configuration
- EmailProcessor: Core service that handles Gmail connection and email processing
- EmailController: REST API endpoints for triggering email processing
- ConfigController: API for managing application configuration
- Config/ConfigLoader: Configuration management utilities
- Dependency Injection: EmailProcessor is registered as a scoped service
- Error Handling: Comprehensive error handling with detailed logging
- CORS: Configured for frontend integration (React on localhost:3000)
- Swagger: Auto-generated API documentation
dotnet build
dotnet test
dotnet run --environment Development
dotnet publish -c Release
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
-
Authentication Failed
- Verify your Gmail App Password is correct
- Ensure 2FA is enabled on your Google account
-
IMAP Connection Issues
- Check that IMAP is enabled in Gmail settings
- Verify firewall isn't blocking ports 993/465
-
No Emails Processed
- Check that your keywords match email content
- Verify
max_emails_to_check
is sufficient - Ensure emails aren't already replied to
-
Port Already in Use
- Stop any running instances:
taskkill /f /im Rappelon-api.exe
- Or change ports in
launchSettings.json
- Stop any running instances:
- Create an issue for bug reports
- Submit feature requests via GitHub issues
- Check existing issues before creating new ones
- Built with ASP.NET Core 8.0
- Uses MailKit for Gmail integration
- Swagger for API documentation