[kdepim-users] Copy email to file.

Ingo Klöcker kloecker at kde.org
Sun Nov 30 17:26:23 GMT 2008


On Friday 28 November 2008, John Culleton wrote:
> I want to create a filter such that a particular email is copied to a
> system folder (not a mail folder) and then as a  second action a
> program is executed.
>
> How do I make the filter copy the email to a file in a  regular
> folder, e.g., /usr/local/foo?

One possibility is to use the "Execute Command" filter action (cf. 
http://docs.kde.org/kde3/en/kdepim/kmail/filters.html#filter-action). 
Attached is a very simple Perl script which copies the message (read 
from STDIN) to a file. After writing the message to a file the Perl 
script could execute the second action.

If you do not want KMail to block (while the command is executed) then 
append '&' to the command. Note, that in this case you have to make 
sure that you do not overwrite the copied message with another one. So 
you might want to use mktemp to create the file name of the copied 
message.


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: copyMessageToFile.pl
Type: application/x-perl
Size: 145 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdepim-users/attachments/20081130/bf9cf03d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdepim-users/attachments/20081130/bf9cf03d/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM users mailing list
kdepim-users at kde.org
https://mail.kde.org/mailman/listinfo/kdepim-users


More information about the kdepim-users mailing list