Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there a linux email client that can run on command line and can be configured to fetch and automatically save attachments to the filesystem?

Im currently using Thunderbird and it has a nice add-on called 'Attachment extractor' which automatically downloads attachments to the filesystem once the mail arrives. My problem is I want to run a custom php script the can process the attached file once it arrives.

Thanks!

share|improve this question
add comment

2 Answers

if you are receiving the email locally, metamail can probably do what you're looking for. many linux distros have a package for metamail.

here's a little information about it: http://www.cs.umd.edu/faq/mime.html

Otherwise, you may be able to work something out with fetchmail + procmail.

share|improve this answer
add comment

You can use fetchmail and procmail to do this. Procmail can be configured to execute a script that tests if an email has any mime encoded attachments (this could be as simple as just grepping the file for the MIME header) and then invokes munpack if it has.

Procmail can execute pretty much anything you want, so you should be able to get it to run your php script or a shell wrapper.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.