Forum Moderators: phranque

Message Too Old, No Replies

Dynamically creating email aliases and checking incoming mail against

A mediated mail system

         

formasfunction

2:59 pm on Sep 19, 2007 (gmt 0)

10+ Year Member



I'm not sure if this is the right forum for this so please redirect me if it's not.

I have a working php/mysql registration system running on a dedicated-virtual box over at mediatemple with Qmail. When a user registers for an account on my system I'd like an email alias to be set up for them that, when it receives mail, checks to make sure the sender is a registered user and if they are, forwards that mail to the receiver's real email address (gmail, hotmail, etc) with the header changed so that it shows the sender's alias rather than their real address. No mail will be stored. Here's an example flow:

My site is example.com
1. User1 with Alias1 wants to send a message to User2 with Alias2
2. User1 writes a message from User1@hotmail.com to Alias2@example.com
3. The example server checks the DB for User1@hotmail.com as belonging to a registered user. If it isn't, User1@hotmail.com is sent an error message. If it is, the example server proceeds to step 4.
4. The example server changes the header on the message so that the message now appears to come from Alias1@example.com.
5. The modified message is now forwarded to User2@yahoo.com. If User2 wants to respond to User1 he does so to Alias1@example.com and the whole process starts over.

My real question is where to get started. I realize this isn't a small question by any means but I just need to identify the pieces so that I can start assembling them and educating myself. I'm guessing I won't have to create a real alias for each user, just a system to read the headers and act as a traffic controller.

jtara

5:09 pm on Sep 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is not as easy as it sounds.

You also need to scan the email content for references to the user's real email address - such as in signatures, etc.

That can get dicey if there is HTML content!

It does no good to make a substitution in the header if a reference within the text body slips through.

This almost certainly isn't something you have to write yourself, though. Do some searching, I am sure you will find multiple free and commercial solutions.

formasfunction

7:34 pm on Sep 19, 2007 (gmt 0)

10+ Year Member



Thanks for the advice. I'm actually not too concerned with a reference slipping through the body as my purpose for it is an extra layer of security for the user, should they want it, rather than a way to lock people into the system. Kind of like a more robust version of what craigslist does with email addresses.

What would I search for to find some of the preexisting solutions out there? I'm not exactly sure how to formulate my request specifically enough for google at the moment.

jtara

7:39 pm on Sep 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would look at some DEA (Disposable Email Address) solutions, and get some ideas from them. These do a bit more than you want, as they allow a single user to create multiple disposable addresses. But you can see how they handle rewriting headers and body text, as well as replies. (Which also aren't quite so simple.)

There's one very popular service that is cheap - I think $10/year for the cheapest option. You just might find the service useful anyway. I use it for all of my website registrations, etc. Each website gets a unique email address.

formasfunction

5:30 am on Sep 20, 2007 (gmt 0)

10+ Year Member



So, I've done quite a bit of googling in the last few hours and I haven't really found anything all that useful. I did find one php script that created email addresses on the fly but it relied on sending GET commands through cpanel which I don't have. I'm more interested in actually interfacing with qmail or whatever component that I'd need to get at to make this work than using a slower work around. Any help at identifying the components would be greatly appreciated.

formasfunction

2:38 pm on Sep 20, 2007 (gmt 0)

10+ Year Member



I finally found what I was looking for - it's called Email Piping and there's a pretty good looking tutorial here:
[evolt.org...]

Thanks for the help.