On Monday 09 August 2004 21:32, Stephen Boddy wrote:
On Monday 09 August 2004 21:15, Doug McGarrett wrote:
I like KMail, and have had no problems with it. (I'm not doing complicated filters, etc.) And thank heavens it _doesn't_ look like a Microsoft routine! But I can't find a way to implement a feature that Eudora has: a way to automatically copy an attachment on an incoming message to a folder. It would be even cooler if I could specify the filename extension of the incoming attachment and only copy that file to a specified folder. i.e., if the incoming message was a .doc file, it would automatically copy it to the /home/doug/Documents folder.
Does anybody know of a way to do that? TIA! --doug
There's probably a command line tool you could use the existing filter with. Not done it, but there should be something out there. -- Steve Boddy
To answer myself; from http://docs.kde.org/en/3.2/kdepim/kmail/filters.html: ---8<--- execute command This will execute a program, but will not modify the message. Specify the full path to the program you want to execute. KMail will block until the program returns. You can feed the program with the parts of the mail: %0, %1, etc. will stand for files representing the message parts. For common messages %0 is the text, %1 the first attachment and so on. Additionally, the whole message is fed into the program's stdin. In addition, every occurrence of %{foo} is replaced by the content of the foo header. Warning This currently only works if the message has at least one attachment. No, not even %0 will work in the general case! Tip You can enter arbitrarily complex shell commands here, since KMail uses a sub shell to execute the command line. Therefore, even this command will work (within its limits): uudecode -o $(mktemp kmail-uudecoded.XXXXXX) && echo $'\a' ---8<--- That should be enough to get you going. If not there's a good discussion and references to tools here: http://zgp.org/linux-elitists/20010902130403.S32544@zork.net.html Finally, I recommend taking a look at Python email library. It would be perhaps an few hours work to get something usable, even learning as you go. Add a couple of options for mimetype and destination, and it'll totally meet your requirements. HTH -- Steve Boddy