Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Way To Receive Email Website

I am developing a website -- in the prototype stage, soon to be alpha. I will provide an email address to each account that allows the user to deposit stuff -- not a real email account, just an endpoint for sending things to the site. Many sites provide this kind of service nowadays. I think the first one I saw was Photobucket, which let's you send photos as email attachments.

My question is, what is the best way to implement this kind of service?

In my prototype, I have written a POP3 client which fetches all newly delivered mail (currently from a test Gmail account). My service processes each new mail and attachments, and immediately removes it from the email server.

I could certainly outsource to an email service with POP3 and be done with it. The problem is cost. Most services I have seen provide much more than I need, and they charge per account. I expect to have many accounts and low traffic volume.

So I'm leaning towards hosting email receipt myself. I am open to Windows or Linux. The code that processes incoming emails runs on Windows, but I have other services running on Linux. I have seen a number of open source and free email servers, such as hMailServer and MailEnable (Windows) and qmail, Postfix and exim (Linux).

I guess I have a slight preference towards Linux because of lower hosting costs, but if a Windows service can provide cleaner integration, that might be worth it. As far as features, I would like to have some spam filtering, but it's is not a huge priority. POP3 is adequate for retrieval, but a more direct API would be nice. I will need some kind of API for programmatically provisioning new accounts.

All suggestions are appreciated. Do you know how others implement this kind of service?

UPDATE: I ended up using hMailServer, which is a free mail server that runs on Windows. It seems to be quite mature and robust. It has a COM interop library which makes accessing emails, accounts, etc. from my .NET server app very easy indeed.

like image 417
Tim Scott Avatar asked Nov 06 '22 00:11

Tim Scott


1 Answers

If you're going the host-your-own-email-server route, I would probably just use POSTFIX and pipe all your email to a PHP script, which processes the email.

Here's a quick'n dirty tutorial on setting up the email pipe if you're using cPanel:

http://kb.siteground.com/article/How_to_pipe_an_email_to_a_PHP_script.html

If not, here's how to do it:

http://answers.google.com/answers/threadview?id=562518

like image 92
Jesse Bunch Avatar answered Nov 09 '22 05:11

Jesse Bunch