You are not logged in.

1

Friday, September 24th 2004, 7:07pm

Execute a program, when receiving a mail.

Hi

This is a question regarding the KMail program.

I know it is possible to execute a program when receiving a mail.
But how do I get the from-address, and the subject as parameters for my program ?

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

2

Friday, September 24th 2004, 8:23pm

There is a filter option for executing a program and an option for piping the mail through a program.

Don't know if the first option can be called with parameter, but if you choose the second, the called program can read any part of the mail :)

Cheers,
_
Qt/KDE Developer
Debian User

3

Friday, September 24th 2004, 10:49pm

ok, thx for the quick reply.

Do you have an example, that would make it way easier for me. :wink:

Scribbler

Beginner

Posts: 36

Location: Aurora CO

  • Send private message

4

Friday, September 24th 2004, 11:14pm

Select the message you would like to create the filter for.

Select Tools -> Create Filter -> Filter on From (or Filter on Subject). You'll then get this window...



The From or Subject information will already be filled out for you (depending on which filter option you chose above). You can then add another Filter Criteria if you like. Change Filter Action to Execute Command, and select the command/program/application to execute.

5

Saturday, September 25th 2004, 1:28am

Well this seems great, but this does not explain how I get the contains of the subject and the from-address as parameters to my program.

what I wan't is like this:
SendMailInfo <from-address> <subject>

SendMailInfo is my program, and it takes the 2 parameters into the program, and displays it on my display somewhere else in my house.

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

6

Saturday, September 25th 2004, 5:03pm

According to the docs http://docs.kde.org/en/3.2/kdepim/kmail/filters.html#filter-action
you could try
%{From}
and
%{Subject}
as parameters to the command.

Cheers,
_
Qt/KDE Developer
Debian User

7

Saturday, September 25th 2004, 5:43pm

Thx, this works.

Just needed to learn somthing about the filters :-)