Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Email Anonymization Similar to Craigslist in C#

I am developing a site for which I would like to protect buyers by anonymizing their email addresses.Similar to craigslist's system, when a seller needs to contact a buyer they should be able to send an email to an anonymized address such as [email protected] which will then be routed to the user's email address.

My plan right now is to:

  1. Set up a bucket (catch-all) inbox
  2. Generate a random key for each buyer which will be the user specific ('1425415125' above) section of the email address
  3. Monitor the bucket inbox and parse out this user specific section. Once I know the user, the email can be forwarded to the correct address

My questions are as follows:

  1. Can you see any issues with the above solution
  2. Are there any open source solutions to the existing problem
  3. Are there any gotchas that one should be aware of when developing such a system?

Thanks in advance

JP

like image 510
JP. Avatar asked Jul 05 '11 14:07

JP.


3 Answers

I did something related, though not quite the same. I setup a catch all inbox on my existing pop3 server (you probably have one already I'm guessing). I then used OpenPop.NET to read all new messages on a timer (say every 30 seconds). In my case I stopped at just processing the messagse but it's easy enough to generate a new message to the appropriate address and copy the body over, then send the new message out on your SMTP server.

One problem I see with your setup, and maybe it's just a misunderstanding on my part, is that while you are protecting the users original email address they will continue to be reachable at [email protected] basically forever. If I understand the way craigslist works, each posting has a different email address, and once the posting has been deleted/removed (or shortly after) the email address stops working. This makes it so that people can't just keep bugging you on that email address. The solution to this issue is easy, just make the email address coorespond to a post id or some other id rather then the users id in the database. The lookup will be just as quick but they will have a new email address each time.

like image 111
Peter Avatar answered Nov 07 '22 20:11

Peter


You may wish to look at mail "piping" - the ability for someone to send an email to a mail server, which then gets thrown immediately to an executable, which then forwards your mail onto the recipient (by pulling the real email address from the database based on the incoming address from the piped message).

My personal recommendation would be to check out HMailServer, which has a COM API (the admin side is written in PHP, hence the requirement for legacy interop), is free and open-source, and is very well-documented. It doesn't have mail piping built-in, but is easily extensible given the API and support for scripts which run on server-side message events

HTH,

Benjamin

like image 30
Jamie Howarth Avatar answered Nov 07 '22 19:11

Jamie Howarth


I think this solution will make sense and is in use in a lot of cases. The hardest part is actually receiving the messages. You can actually handle all of this within your web app if you need to. I wrote a blog post highlighting a couple of ways to receive email in your web app. It applies mainly to Rails but the concepts should be transferable.

like image 1
Steve Smith Avatar answered Nov 07 '22 18:11

Steve Smith