tags:

views:

65

answers:

4

I'll let users register their [email protected] ,,, they enter their members area where they can :
1- send emails ( easy to do)
2- receive emails ..

for receiving emails , I'll use a catch all email account , read the email and figure to whom it's sent (username), and then I save it on the database with userid of the username who has registerd !

Do I miss something here ... is it really this simple (if I don't have an email server) ?

EDIT : What I mean is : I'm going to make a portable script , when users register and make their accounts . Want to send their emails, I will use PHP to send emails .. that is easy .. About the receiving part : I will use a catch all email account .. and forward the message (save it on the DB under his userID) to the owner .. so , for example : if I own domain.com ,, If I got someuser@domain.com message, i save it for someuser who registered this email previously to read it later

+1  A: 

What's going to receive the emails? You basically described a SMTP server at a very high level. Why not just use an existing SMTP server that Windows/Linux already come with?

Josh Einstein
I think you didn't get what I mean (it's my mistake) , so , please revise the question again after the edit.
Naughty.Coder
With all due respect, I don't think you understood my answer. A SMTP server is not only for *sending* email but also it's the server that *receives* mail from other networks. You need a SMTP server listening on port 25 in order to receive email sent to your domain. So why not just use an off the shelf SMTP product. They typically drop the message into the file system but I'm sure there's something out there with a database back end.
Josh Einstein
aha , can you suggest one ? or what to search google for !?Thank u
Naughty.Coder
Based on your comment to Bryan's answer, I see you're doing this via a hosted email provider. That's a different situation altogether since you don't control the server. To be honest, I don't really think you're in the best position to be providing email service this way but technically, your original idea could work but it would be a very shaky setup at best.
Josh Einstein
nice ! I also thought it is feasible , but will not be so "reliable" , if you know what I mean ..But to which extent !? I mean , I will not be the second Gmail , but 1000 users may be good for this ?
Naughty.Coder
+1  A: 

One word: Spam.

You're missing the fact that you are entirely re-inventing the wheel. OK, so you've got a mail system written... what happens when you start getting gobs of spam? Are you going to re-invent that wheel to0? What about email attachments? What about when a user unregisters? Is your new service going to send out RFC-compliant SMTP error messages also?

Like Josh said, using an existing (proven) package is the better choice.

Bryan
spam will be filtered out by my email software on my web hosting account .. or i'm missing somehing else? :)so , I'll fully depend on the email application I have and just "read from it"
Naughty.Coder
+1  A: 

The step of "read the email and figure to whom it's sent" may not be as easy as you think, because the "To:" line of the message does not necessarily indicate the actual delivery address. To see why, consider the case of a message sent to a mailing list: the header will just say "To: [email protected]".

The actual address(es) to which the message is sent are conveyed in the "SMTP envelope", which is external to the message header, and is used by the SMTP server to route/deliver the message. It's difficult (well, impossible in the general case) to look at a message that's already been delivered to a catch-all mailbox and reliably determine what user should have received it.

So, that means you need to implement an SMTP server to make this work (or tie in with an existing SMTP server). The other comments about reinventing the wheel are right on the money.

David Gelhar
NO , i just think to offer an easy solution for who "dream" to have their super easy email service
Naughty.Coder
IF i want to make a full blown solution , I should be fully aware of the SMTP protocol !?
Naughty.Coder
Or be closely integrated with an SMTP server so that it can pass along the recipient information to you. For example a linux/sendmail solution might involve configuring [email protected] in a sendmail virtual user table to deliver to a your script, passing a argument saying "recipient=someuser".
David Gelhar
A: 

Sounds like one hell out of a lot of work on the receiving part. What if the email consists of:

To: [email protected]
Subject: Part at Fred's!

BYOB

see you there.

just how are you going to tell which of your users knows a Fred and where also knows where Fred's place is?

If you want to set up email hosting for users, look into setting up virtual accounts, which can be done relatively easily with Postfix, MySQL, and Dovecot. It would save you the hassle of having to read all your user's emails (unless you really wanted to).

Marc B
they ain't going to send to [email protected] , they will send to [email protected] and catchallaccount will catch it , because there is no such email address.. I only who know it's exist because the user already registered with this TO username .... correct me if im wrong please.
Naughty.Coder
Ok, they registered that username, but how are you going to tell the mail server that it's a registered username? Create a sytem account for each user? A massive /etc/alias file with "username:catchallaccount" mappings?
Marc B
Actually many mail systems have the ability to designate an email address as a catch-all, such as [email protected] or sometimes they're used as spam honeypots.
Josh Einstein