[Kde-pim] Re: Questions about KMail D-Bus interface

Thomas McGuire mcguire at kde.org
Wed Jan 26 11:38:34 GMT 2011


Hello,

On Tuesday 25 January 2011 20:56:01 Florian Lindner wrote:
> I don't want to send an email, just deliver it/put it into to a kmail
> folder. I seems to work with dbusAddMessage.

Ok, good.

> > One a side note, most if not all of the dbus interface doesn't exist
> > anymore in KMail 2, because there, you don't need KMail running for these
> > tasks, you can simply use Akonadi. I guess in this case you need to write
> > a small C++ wrapper for adding or sending a mail, and then use that
> > wrapper application in a script.
> 
> Akonadi won't be offering an d-bus interface?

One of the goals of Akonadi actually to get rid of the DBus interfaces, so 
that for example sending invitations from within KOrganizer doesn't need to 
have KMail running, and that tools like the mail import tool can operate 
independently from KMail.
We didn't anticipate third party demands for a DBus API for scripting. It  
would be trivial to add some small helper programs that did what the old DBus 
API did, someone just needs to write those.

> I am having another problem. As I have mentioned my script is called from a
> filter rule and gets the mail piped. It seems that kmail blocks while the
> script is running.

Right, it blocks. The most hated bug in KMail, according to bugzilla.

> My script dispatches the d-bus call that waits for an
> answer, which never comes... Kmail and my script are waiting for each other
> to finish.

Yes, when executing filters, KMail is completely blocked, it doesn't even run 
a local eventloop and therefore can't process any DBus requests during that 
time.

> I tried to work around that by dispatching the d-bus called from another
> script which is executed in a seperate process. It works fine when in debug
> mode (kmail active, but mail is piped from the command line) but when
> called from kmail filter the dispatcher process is not called for some
> reason unexplained.

I don't think this can work for the reasons explained above. A filter that 
uses KMail's DBus interface will probably just not work. Short of modifying 
KMail itself, I can't think of a way to achieve what you want right now.

I didn't actually understand what you mean with the dispatcher process. You 
mean the filter calls your script, which in turn runs another script that 
handles the DBus calls? If it works in debug mode, maybe you just have timing 
problems. Your first script needs to terminate before the second script does 
any DBus calls to KMail, maybe adding a few sleep statements here and there 
will help.

Regards,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20110126/ea610553/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list