How the Email Processing Backend and Processors work
masterThe backend system follows a decorator-like pattern using a producer/consumer structure. The core logic is handled by a chain of Processors configured via the save_process option.
Key Concepts:
- Processors: Modular components that perform specific tasks (e.g., parsing, saving, or validating).
- Chaining: Processors are chained together in a sequence. For example, a configuration like
"HeadersParser|Header|Debugger"means the email is first parsed for headers, then delivery headers are added, and finally, debug information is logged. - Workers: The backend runs multiple workers in parallel using Go's channels and goroutines to handle high volumes of mail efficiently.