tags:

views:

14

answers:

2

Hi there.

I want someone to be able to email something (image, video, text) and then have that data be saved on my server in a special directory (the one representing the email address) and if possible take the text with the email and put the data into a database (tags, title, etc).

What is the best way to do this?

+1  A: 

The best way to do this is to run a mail server on the server, and have it output email to a particular address to a command. This command will then parse the email and handle saving the attachment and writing to the database.

Try the Postfix mail server and a | foo.sh alias. The script can be written in whatever language you like. Choose something which will make decoding the email easy.

Borealid
A: 

What is the best way to do this?

If you've no idea where to start then I'd recommend posting a question somewhere like Stack Overflow, providing the relevant information needed for people to suggest a solution, including:

  1. the OS where the mail server resides
  2. whether php can be run on this box or if it needs to be located elsewhere
  3. the software in use for the email service - and whether this could be changed easily
  4. the relevance of timing between delivering an email and content being available

Peering into my crystal ball, the best solution would be a php script triggered via procmail

C.

symcbean