This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Kmail filter execute command : how to feed message to script

Tags: None
(comma "," separated)
atalon1
Registered Member
Posts
1
Karma
0
Hi,

I try to send the message content to a python script via the execute command in kmail filters.

In the documentation, I have seen that I can provide the message content by appending %0. Whenever I do so, kmail is changing %0 to %250 automatically when I apply changes.

Here is the command:
Code: Select all
python /home/me/argecho.py argOne %250&


I tried anyway with the following python script which basically prints into file the provided parameters:

Code: Select all
import sys

fout  = open('/home/me/test.txt', 'w')
for arg in sys.argv:
    fout.write(arg)
    fout.write("\n")
fout.close()


The content of the file generated by the script is the following:
Code: Select all
/home/me/argecho.py
argOne
/tmp/kde-me/kmailtV1889.tmp


It seems that kmail is providing a temporary file. The problem is that the file cannot be found as if it has been deleted (or never writen).

How can I do to feed the message to my script properly?

Thanks for help


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], q.ignora, watchstar