Can I email a file to my webserver?
October 27, 2009 7:07 AM   Subscribe

I want someone to be able to put files on a webserver. I don't want to give them ftp access. I'd like to tell them: Attach your file to an email and send it to this address. Is there a way they can email an attachment so that it puts the attachment in a specified folder on the server?

I know there are services that go the other way, and I know it's possible to interact with an ftp server via http. Neither of these would suffice, I would like to simply ask them to attach the file to an email.
posted by stupidsexyFlanders to Computers & Internet (9 answers total) 3 users marked this as a favorite
 
You can install an smtp server (ie mail) on a webserver yes. If you want to get complicated, procmail is completely willing to help. Just set up an account, and set rules on the account to save attachments to a specific folder visible to the webserver. With appropriate permissions of course. But think for a moment about what you gain here; you're moving from a weak password system to and even weaker passwordless one.

Perhaps what you're really looking for is WebDAV?
posted by pwnguin at 7:15 AM on October 27, 2009


Some CMSes allow this. You set up a user with "needs approval" access or whatever you like, and use a moblog plugin. I only know how to do it on mine, but it's a fairly common thing, and some of those CMSes are free and open source.
posted by cjorgensen at 7:20 AM on October 27, 2009


Best answer: Would a form-based file uploader work?
posted by krilli at 7:21 AM on October 27, 2009


... oh, and FTP servers can have really limited sub-users that can do almost nothing but write/read a little in a certain directory. PureFTPD can do this pretty well. Just in case this info helps.
posted by krilli at 7:30 AM on October 27, 2009


Best answer: I am not sure why you would go with email over uploading directly to the server via a form, unless the server is not publicly accessible. With email you have to deal with file size limits, virus and spam protection, and the latency of the files getting moved from one mail server to another. There is also no positive feedback that the file was received. With file upload, the above issues do not exist.
posted by SNACKeR at 7:32 AM on October 27, 2009


How big are the files? drop.io offers a service where you can mail something to a specific 'named drop' and you can password protect who can download it.
posted by a womble is an active kind of sloth at 7:50 AM on October 27, 2009


A script / program could be constructed that connects to a mailbox via POP or IMAP.
The program could then open unread email, look for suitable attachments, and deposit those attachments wherever it needs to place them.

You may want to have a manageable whitelist of senders that the program will read mail from, to mitigate the risk of spam / virus entering your system.
posted by csmason at 8:20 AM on October 27, 2009


Best answer: You didn't mention the operating system your web-server uses, but if it's Unix-based (and you have admin access to the command line), munpack can do the decoding for you, at least for traditional single-file mailboxes. Depends on your scripting skills to make that work as you would like it to (I would use Perl myself). You would probably want to copy files to a temp folder, delete any which weren't legal (eg, they have an extension like .exe), run it through ClamScan, then copy it into place. You could make a weak gesture in the direction of security by requiring users to put a particular phrase in the email message, or a particular subject line, etc, but it's no more than a gesture since email is inherently insecure anyway. As with other commenters above, my Spidey-Sense is tingling about the potential ways this can go painfully wrong, but that's your business.

I know you ruled it out, but my users are happy with this web-based thing, if it's of interest.
posted by BrokenEnglish at 8:41 AM on October 27, 2009


Response by poster: Thanks all, I'll put a page up for my user allowing form based upload.
posted by stupidsexyFlanders at 11:39 AM on October 27, 2009


« Older I don't want to smell like an ashtray!   |   I wanna shred you up! Newer »
This thread is closed to new comments.