A safe email testing sandbox for Odoo developers. No emails are ever sent to the real world - GreenMail intercepts everything locally.
- Test outgoing emails (quotations, invoices, notifications) without spamming real addresses
- Simulate customer replies and verify they link to the correct Odoo records
- Full email round-trip testing in an isolated environment
- Pre-configured addon installs mail servers automatically
├── docker-compose.yml # Odoo 19 + PostgreSQL 17 + GreenMail
├── config/
│ └── odoo.conf # Odoo configuration (SMTP pre-configured)
├── addons/
│ └── greenmail_demo/ # Demo addon with partners & mail servers
├── mail_client_example/ # FastAPI app to view/send GreenMail emails
└── docs/ # Screenshots for documentation
- Docker and Docker Compose
docker compose up -d| Service | URL | Purpose |
|---|---|---|
| Odoo | http://localhost:8069 | Main application |
| GreenMail API | http://localhost:8080 | REST API for emails |
| Mail Client | http://localhost:3000 | Web UI for GreenMail (requires setup) |
Note: GreenMail does not include a built-in web interface - it only exposes a REST API at port 8080. The mail client included in this repository is a custom FastAPI application created specifically for this project to provide a convenient web UI for viewing and sending test emails.
Set up the mail client before proceeding to Odoo configuration:
cd mail_client_example
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn server:app --port 3000 --reloadAlternatively, run ./run.sh as a shortcut to uvicorn server:app --port 3000 --reload
- View all mailboxes (auto-discovered from GreenMail)
- Read emails with attachments
- Send new emails
- Reply to existing emails
Navigate to Apps in Odoo and install GreenMail Demo Setup.
The addon automatically creates demo contacts for testing.
Go to Settings → Technical → Incoming Mail Servers. The GreenMail IMAP server is pre-configured.
Click Test & Confirm to verify the connection.
Go to Settings → Technical → Outgoing Mail Servers. The GreenMail SMTP server is pre-configured.
The connection test will fail if the admin user has no email set.
Go to Settings → Users and set the admin email to test@example.com.
Return to the outgoing mail server and test again. It should now succeed.
The mail client is ready to display intercepted emails.
Create a quotation and send it by email.
The email appears in the GreenMail client (no real email sent).
Use the mail client to simulate a customer reply.
Go to Settings → Technical → Scheduled Actions and run the Fetchmail Service action.
The customer's reply is automatically linked to the original Sale Order.
| Feature | Benefit |
|---|---|
| All emails trapped locally | No external delivery, no accidental spam |
| Auto-creates accounts | First email to any address creates that mailbox |
| Authentication disabled | No setup needed for test credentials |
| In-memory storage | All data cleared on container restart |
| Port | Protocol | Purpose |
|---|---|---|
| 3025 | SMTP | Send emails |
| 3110 | POP3 | Fetch emails (alternative) |
| 3143 | IMAP | Fetch emails |
| 3465 | SMTPS | Send emails (SSL) |
| 3993 | IMAPS | Fetch emails (SSL) |
| 3995 | POP3S | Fetch emails (SSL, alternative) |
| 8080 | HTTP | REST API |
| Service | User | Password |
|---|---|---|
| Odoo Admin | admin | (set on first launch) |
| PostgreSQL | odoo | odoo |
| GreenMail | any | any (auth disabled) |
The greenmail_demo addon creates:
- Demo Customer Alice - alice@demo.test
- Demo Customer Bob - bob@demo.test
- Demo Supplier Charlie - charlie@supplier.test
- Pre-configured incoming mail server (IMAP on mailserver:3143)
- Pre-configured outgoing mail server (SMTP on mailserver:3025)
This environment provides a complete email testing sandbox for Odoo development. You can safely test outgoing emails, simulate customer replies, and verify that messages link correctly to Odoo records - all without any risk of sending emails to real addresses. GreenMail traps everything locally, making it ideal for development and QA workflows.
Warning: This setup is intended for development and testing only. Do not use GreenMail in production - emails are stored in memory and lost on restart, authentication is disabled, and there is no delivery to real mail servers.













