The combination of Mailhandler and MIME Router allows you to set up your site to take posts via email, and to route attachments into filefields.
MIME Router integrates cleanly with Filefield, Imagefield and SWF Tools. File paths can be set via the Token module. To use MIME Router, just upload it into your modules directory and enable it; the module uses the allowed filetypes in Filefield's user interface. Aside from adding fields to your content types, no additional config is needed to use MIME Router.
Using this setup, images, video, and audio can be sent to your site via email. This also supports posting to the site from handheld devices that support emailing files. So, if you have ever been in a situation where you used a handheld device to take a picture, video, or audio recording, and wanted to post it to your own (or your organization's) web presence, this functionality is for you. This functionality can also be used to support eyewitness information on local news sites, real-time reporting for school newspapers, and other situations where you want to get fresh information live quickly.
The MIME Router module was written and released as part of our work for the Knight Drupal Initiative.
Notes
Mailhandler settings
- Defaults: admin/settings/mailhandler
- Adding mailboxes: admin/content/mailhandler
MIME Router config
- Nothing!: it uses CCK/Filefield admin settings. Nothing to see here.
Other modules used in the screencast
- CCK
- Filefield
- Lightbox2
- Imagefield
- Imagecache and Image API
- Token (used to create dynamic paths for uploaded files)
- SWF Tools
- Mimedetect


Comments
Great work
I browsed through the code and it looks pretty good. Supporting attaching files from emails is a task that's been on the back burner for quite awhile for OG Mailinglist and I think the algorithm you've developed would work perfectly.
Have you looked at supporting the core upload module as well?
Not core upload at this point
We don't have any plans at this moment to support core upload - but, we'd probably be open to patches that added that in.
Our use case is filefield specific, and we haven't used core upload for anything in a while.
Although, I could imagine a use case that leveraged comment_upload where it could be useful...
want OGM to support all three
I'm planning on supporting all three in OGM, Filefield, comment_upload, and the core upload module, but defaulting to FileField if available.
Media file not making ito the node
Hi,
When I retreive the mail, the node is created but no video file is present.
File uploads is on and I've created the Media Field w/ File type.
Are there any extra mods or steps necessary? Thanks!!
Could be one of several things
1. Can you upload and share a file via the web UI?
2. Is the filetype you are mailing allowed within the field?
3. Is the file being stripped by your email provider?
4. Is the file to big for the limits set within your field?
These are the first things I'd check.
Inline Images..
Is there any plan to support inline images in content.
Shyam
Google Apps versus GMail
Hello - In the screencast reference is made to gmail.
I tried to use Mailhandler with Google Apps but although the mailbox tested correctly, when I actually tried to download via Mailhandler it did not download.
I am wondering if you have tried Google Apps. Google Apps seems nicer than gmail because you can use your own domain name.
MIME Router the module works great and I am grateful. Thank you.
Can't think of a reason why Google Apps would work differently..
This older thread gives some useful info on using MailHandler with Gmail/Google apps: http://drupal.org/node/64362
And I was also going to suggest that you put an issue in the mailhandler queue, but you beat me to it: http://drupal.org/node/971172 :)
We'll see if we can test this on Google Apps and sort out the details. My initial inclination is that it's related to one of two things:
1. How the php imap extension is compiled; and/or
2. How Google Apps handles usernames in individual domains set up via google apps.
We're coming up on Thanksgiving here, so any digging we can do on this would be in December at the earliest.
Photos not showing up... filepath problem
I have my path set up (in content type) as u[user-id]. However, this is resolving to
http://domain.com/files/sites/domain.com/files/pictures/picture-1.jpg"picture-1.jpg
Certainly the stray quote mark is a problem, but where can I solve the double entry for the domain information?
Thanks for the great screencast! It really helped in getting this set up.
Post new comment