How greenmail-mail-test/greenmail works
Main Components
a. Core Mail Server Components:
• SMTP Server (com.icegreen.greenmail.smtp)
• IMAP Server (com.icegreen.greenmail.imap)
• POP3 Server (com.icegreen.greenmail.pop3)
• In-Memory Store (com.icegreen.greenmail.store)
• User Management (com.icegreen.greenmail.user)
b. Integration Components:
• JUnit 4 Support (greenmail-junit4)
• JUnit 5 Support (greenmail-junit5)
• Spring Integration (greenmail-spring)
• Standalone Server (greenmail-standalone)
• Web Application (greenmail-webapp)
Component Relationships
a. Core Components:
• Protocol servers (SMTP, IMAP, POP3) connecting to the In-Memory Store
• User Management component connecting to all protocol servers
• Configuration component feeding into all servers
b. Integration Layers:
• How test frameworks (JUnit4, JUnit5, Spring) interact with the core components
• Standalone and webapp containers wrapping the core components
Key Architectural Elements
a. Protocol Layer:
• ┌─────────────────────────────────────────┐
• Protocol Servers │
• ┬──────────┬──────────────────┤
• SMTP │ IMAP │ POP3 │
• Server │ Server │ Server │
• ┴──────────┴──────────────────┘
b. Storage Layer:
• ┌─────────────────────────────────────────┐
• In-Memory Mail Store │
• ┬─────────────────────┤
• Message Store │ User Store │
• ┴─────────────────────┘
c. Integration Layer:
• ┌─────────────────────────────────────────┐
• Integration Frameworks │
• ┬──────────┬──────────────────┤
• JUnit4 │ JUnit5 │ Spring │
• ┴──────────┴──────────────────┘
Additional Elements
• A configuration component showing how ServerSetup and GreenMailConfiguration feed into the system
• External interfaces for SMTP (port 25), IMAP (port 143), and POP3 (port 110)
• SSL/TLS variants of the protocols
• API endpoints for the standalone and webapp versions
• ┌─────────────────────┐
• ┬───────────┤
• ► │ Direct │
• ► │ Event │
• ····► │ Config │
• ┴───────────┘