Hi all I'd like to set up an email redirection system similar to that on Craigslist. For those who don't know, when you place an advert you can add your email address. However, rather than showing email@example.com, you are given a fowarding address similar to anon-9876521@[craigslist domain name]. People replying to your advert email the anon-9876521 address - emails are automatically forwarded to you.
Does anyone have an opinion on the best way of implementing this?
I've got qmail on my linux server (CL also uses qmail) - I was thinking of having a catchall mailbox for all incoming mail. Every minute or so a script would parse all the messages, get the TO addresses, do some DB lookups and forward the mail accordingly.
Can anyone see any problems with this approach? Any better solutions I don't know about?
Both for wanting to run the service, and for wanting to write the software with insuffcient knowledge.
If you insist, I'd suggest you first review the commercial services that do this (they are typically called "disposible email address" services), read about their features, read their FAQs, so that you can discover the issues you have missed. (For example, providing two-way reply addresses, scanning email text for any references to the real address.)
I wouldn't write this from scratch. There are almost certainly free DEA scripts available.
Assuming Qmail still mimics Sendmail config files when asked to. virtusertable is your friend. As per above you'll need to read some docs to have even half a chance of doing it properly, but virtusertables are simple to set up and maintain.