Handle delivery of email messages through OCM-Mediator-Wallet
If the svdx service has stored mapping for user wallet connection and email address, and it receives an email over SMTP for delivery to such email address, it shall implement the following functionalities:
- generate unique message identifier and add it as email header to the email message
- store the message temporarily in new DB table (messages)
- based on message timestamp, fetch all messages that have been stored for more than a given configurable period of time
- relay the messages through the current mechanism (either over didcomm to another svdx, or through SMTP fallback)
- remove the relayed messages from the DB
The idea is to give every message a chance to be sent by the OCM-Mediator-Wallet connection. If the wallet has not notified the service for a given period of time that it has accepted the message, then consider this attempt to be unsuccessful and fallback to the standard delivery over didcomm/smtp between svdx/postfix instances.