
|
View Full Version : Anyone know how to create on the fly e-mail addresses like craiglist do?
monkey junkie 06-11-2007, 07:43 AM Hello,
If you look at some craigslist posts like this -
http://sfbay.craigslist.org/sfc/mis/349476796.html
- you will see they use a some-random-number@craigslist.org
Basically when someone posts something, they input their e-mail address, a anonymous craigslist e-mail address is created which is linked to the real e-mail address.
Anyone know how to do this?
Thank you
eukvps 06-11-2007, 08:01 AM Hello,
Actually its controllled via a script , may be developed in PHP or any other Scripting Language , so a random Alphanumeric number is generated which is then linked to main email address
monkey junkie 06-11-2007, 08:03 AM OK. But if I e-mail some-random-number@craigslist.org, the e-mail will reach the person. So an actual temporary e-mail address is created. So I guess my question is - how do I create temporary e-mail addresses like craigslist do?
eukvps 06-11-2007, 08:12 AM OK. But if I e-mail some-random-number@craigslist.org, the e-mail will reach the person. So an actual temporary e-mail address is created. So I guess my question is - how do I create temporary e-mail addresses like craigslist do?
Well you need to create a Custom PHP script that we create some random alpha numeric numbers.
Ks Jeppe 06-11-2007, 08:30 AM eukvps, he doesnt just want the random email address made, he wants it so that when he emails it, the email server will forward the email to the correct original email, if i'm not mistaking?
I don't have much experience in this sadly, so i cant really help you :(
Xenatino 06-11-2007, 08:36 AM 1.) Setup a catch-all for said domain
2.) Pipe that box to PHP script
3.) Identify mail using the pers- prefix
4.) Forward/Record mail
5.) Bounce other mail not matching pattern.
Xeentech 06-11-2007, 09:03 AM Its a whole lot easier than that if you have access to your mail servers config.
I have a MySQL db with a table called "aliases", in that table there are fields "forwardto" and "address". You can guess what they do..
I setup an XML-RPC API so my users can add aliases for thier domains in real time.
mwatkins 06-11-2007, 10:56 AM Agreed -- an aliases table is the clean way to do this. In Postfix with postgres or mysql (or other databases) provided you've built Postfix with db support, adding an additional alias map is dirt simple.
You don't want to be piping and parsing email... that's just too much work and not needed.
monkey junkie 06-12-2007, 12:01 PM Thank you all for your advice. I shall look into using postfix for this.
Thanks.
WebsBests 06-12-2007, 02:04 PM I always thought that they had a database of the real emails from the posters and that those blah@craigslist.com were cloaked e-mails. They would just select the right one and do a mail() function.
mwatkins 06-13-2007, 11:24 AM I always thought that they had a database of the real emails from the posters and that those blah@craigslist.com were cloaked e-mails. They would just select the right one and do a mail() function.
Who knows, they might, but that would be a stupid thing to do.
Why?
Because then they'd be writing a mail transfer agent, with all the issues that surround that (bounces, RBLs, spam, etc), rather than "craigslist", and MTA's like Postfix already excel at that.
Cooking up the integration of a database-backed alias table takes all of a couple minutes for Postfix, no doubt the other MTA's are similar work effort, and then you have a completely robust and highly scalable solution.
Using PHP mail() is neither robust nor scalable.
WebsBests 06-13-2007, 11:32 AM Who knows, they might, but that would be a stupid thing to do.
Why?
Because then they'd be writing a mail transfer agent, with all the issues that surround that (bounces, RBLs, spam, etc), rather than "craigslist", and MTA's like Postfix already excel at that.
Cooking up the integration of a database-backed alias table takes all of a couple minutes for Postfix, no doubt the other MTA's are similar work effort, and then you have a completely robust and highly scalable solution.
Using PHP mail() is neither robust nor scalable.
It was the first thing that came to my mind, thank you for clearing it up. I'm not too familiar with Postfix.
mwatkins 06-13-2007, 11:54 AM I regret using the word "stupid" in my note because I didn't mean you when I wrote that. What I was thinking at the time of dashing it off was that programmers and system architects are frequently guilty of reinventing the wheel. Goodness knows I've been through that "stupid" phase!
After awhile one starts to realize that most wheels have already been invented and always ask the question "what does what I want to do most look like... and is there something that already delivers that".
WebsBests 06-13-2007, 11:58 AM I know it wasn't intended at me, my opinion was just the first reasonable explanation that came to my mind, although it was not the smartest one haha :-). But I see what your saying.
MysticServer 06-13-2007, 12:28 PM it's actually not that hard to do. I have a script I wrote for exim on a cpanel server that does it.. Took me all of an hour. PM me if you want me to dig up the code.
-Jason
mwatkins 06-13-2007, 12:39 PM I can beat an hour - here's an example forwarding "script" - just a configuration file for Postfix:
pg_forward.conf:
user = postfix
password = yourpassword
dbname =isp
table = v_forward
select_field = fwd_to
where_field = email
hosts = localhost
In an "accounts" and other tables I have numerous columns relating to the various accounts; I use views to limit the access to data (security) and grant access to the views, not the raw tables, to the postfix user.
v_forward contains only the information required:
email, fwd_to
Dirt simple.
|