Im building application with inner message inbox. From there user can send message which will be sent also as regular e-mail. Now I want to achieve functionality that if receiver will reply that email (from his inbox, outside the website) it will be somehow parsed so I can display it in my application inbox. How to do something like this at all?
Sorry, probably my language limitations make difficult to explain the idea.
User A sends a message from the portal, which is saved to the database, but at the same time it is sent to the private email address of the recipient-user B.
User B receives a message and responds from his e-mail program to this message, but not to the recipient's private e-mail, but only to the e-mail address of the service.
The site downloads all messages from its mailbox and parses them to save to the database and assign it as a reply to a specific thread and user.
My question is how to achieve this functionality?
I think that:
In step 1 I should send message with reply address with hash, so I can later by that hash assign it to thread and user, for example: [email protected]
Server should be configured to catch that email even if mailbox [email protected] doesnt exist. That could be the problem for me. I don`t know how to achieve that. Maybe all incoming emails should be redirected to one common portal email address?
I can download message by IMAP and using hash in email address assign it to thread and user.
Is it a good solution or maybe it is better way to do that?
If it is good I need a prompt in second step- how to configure it like that.
You can open a mailbox, grab the messages and delete them from the mailbox in about 10 lines of code.
Regarding the missing mailboxes, most hosts will allow you to setup a catch-all mailbox that all unknown recipients goes into. You will though expect to get a lot of spam in there so you will probably need something in the body of the email to tell you it is definitely one of yours.
Ok, this is a solution, but it depends on whether the user actually does not remove something (even accidentally) from the content of the message. Would not such a virtual reply address with hash be a better (more fool-proof) solution? The problem is how to set it?