# Mail Processing Stabilization Phase – NEW Camel mail route This patch adds a NEW-runtime Camel route for mail ingestion that is similar in purpose to the legacy `MailRoute`, but implemented only in the NEW code path (`at.procon.dip.*`). ## Scope - runtime mode: `NEW` only - entrypoint: Camel mail consumer route - downstream handling: `DocumentIngestionGateway` with `SourceType.MAIL` - no legacy profile/config/code changes ## Main classes - `at.procon.dip.ingestion.camel.GenericMailIngestionRoute` - `at.procon.dip.ingestion.mail.MailServerEndpointUriFactory` - `at.procon.dip.ingestion.mail.CamelMailServerEndpointUriFactory` - `at.procon.dip.ingestion.mail.MailServerProtocol` ## Configuration Configured under `dip.ingestion.mail-route` in `application-new.yml`. Supported protocols currently exposed through the generic endpoint factory: - `IMAP` - `IMAPS` - `POP3` - `POP3S` This keeps the route provider/protocol-agnostic at the configuration level while still using Apache Camel mail endpoints underneath. ## Behavior When enabled, the route: 1. consumes messages from the configured mail endpoint 2. serializes each provider message to raw MIME bytes 3. extracts basic provider/provenance attributes 4. builds a `SourceDescriptor` with `SourceType.MAIL` 5. delegates the actual parsing/import/attachment handling to the existing NEW `MailDocumentIngestionAdapter` ## Provenance attributes added by the route The route enriches the `SourceDescriptor.attributes` map with: - `providerType` - `providerProtocol` - `providerAccountKey` - `providerFolderKey` - `providerMessageKey` (when available from Camel headers) - `providerThreadKey` (when available) - `messageId` - `subject` - `from` ## Notes - The route intentionally does **not** depend on `TedProcessorProperties`. - The route is designed for the NEW runtime only. - The mail import behavior still relies on the NEW `MailDocumentIngestionAdapter` for MIME parsing and attachment import. - This step does not add replay/reprocessing yet.