We need an Microsoft Windows Server based service, that can constantly
(based on a parameter) check an POP3 or an IMAP based mailbox. If the service find an e-mail, it need to download it, store the content of the e-mail in a MEMO/TEXT field in the MS SQL server, if there are attachemets add to the e-mail, it need to stored them on a predefine repository on disk, and store the data of the location and name of the attachments into the MS SQL as well. The service will need to rename the attachmens name into an ID based name (ticket ID, random 8 digit number) that it got from the SQL server as a new free ID. (Stored procedure) The Mail to MS SQL service will need to parse from the e-mail header the params Reply-To:, From:, TO; Received:, Return-Path:, X-Mailer:, X-Virus-Scanned:,....etc and store them to the SQL server in fiels, define for that..
Optional, the service would need to replay to all e-mails, that it has stored into the SQL server DataBase by sending an auto-generated replay. The Replay would be taken from an template based on program parameters.
The software can be programmed in whichever language the developer(s) and programmer(s) decide is the best for it.