I am intending to use Symfony as the base framework for this system. This is primarily because of my existing knowledge of Symfony as well as the flexibility it provides whilst still enforcing strict coding standards.
The base bundle for this system will incorporate a variety of components.
Primary email data will be stored through Doctrine entities. Each received email will have a base entity which will be used to store the delivery address of the email. This will be linked to an entity for each of the email headers and to an entity for the body and/or multi-part mime attachments.
The body and any attachments will be stored through the Gaufrette file abstraction bundle.
To enable this system to operate a command will be created to accept an email piped from an MTA and store it in the data storage layer.
A web interface will be created with Twig templates to enable the viewing of email. It will automatically display the primary email with preference given to the HTML body, otherwise falling back to the plain text body. Attachments will be able to be downloaded from this interface.
All items will be fully configurable through the standard Symfony configuration file. This will enable users to set-up their preferred data and file storage methods.
In future releases of this bundle various configurable extensions will be added. Some of these may be added as separate bundles and others may be included in the base bundle.
Automated email expiry will initially hide, and then purge emails based on age, number of stored emails and/or used storage space.
An interface will be added to enable the forwarding of email addresses based on a regular expression or a string to another address. Optionally this will have a time-out for the forwarding so it is discontinued after a set amount of time.
A service will also be created so that if a particular regular expression isn’t matched in the delivery address for a specific period a notification will be sent to a service such as AWS SNS or PagerDuty notifying of a potential outage.