Bug 85674 - Calling DCOP method sendMessage() in MailTransportServiceIFace object has unexpected results
Summary: Calling DCOP method sendMessage() in MailTransportServiceIFace object has une...
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: 1.6.2
Platform: Mandrake RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-22 08:20 UTC by gambas
Modified: 2018-09-04 18:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gambas 2004-07-22 08:20:57 UTC
Version:           1.6.2 (using KDE KDE 3.2.3)
Installed from:    Mandrake RPMs
OS:                Linux

I tried to use the following DCOP function in the KMail DCOP interface to send a message:

MailTransportServiceIFace.sendMessage(QString to, QStrinc cc, QString bcc, QString subject, QString body, KURL::List attachments)

KMail crashes while executing the DCOP call. If I put some URLs in the attachments, a KIO "in progress" window appears just before the crash.

When I relaunch KMail, I can find the mail in the outbox.
Comment 1 Till Adam 2004-12-28 18:50:32 UTC
Please try with KMail >= 1.7 and if it still crashes send the code snippet which causes the crash and the backtrace you get. Closing meanwhile, I can't reproduce it.
Comment 2 gambas 2004-12-29 14:50:03 UTC
Things now work (I do DCOP calls with Gambas). Just Kmail warns that some characters (I think it is the 'î' in my first name) can't be encoded. Which character encoding is used when calling sendMessage() ? How can I change it ?
Comment 3 gambas 2004-12-29 14:59:05 UTC
This is worse that I thought :-) The warning box gives me two choices: change the encoding, or ignoring the 'bad' characters. If I choose the first one, nothing happens. If I choose the second one, the mail is sent, but without the joined picture. The attachment path is correct, as KMail briefly displays the KIO copy window with the picture path in it.

The Gambas code that does the DCOP call is just:

PUBLIC SUB Main()
  DIM hApp AS KDEApplication
  hApp = Application["kmail"]
  hApp.MailTransportServiceIface.sendMessage("<my e-mail is hidden>", "<the destination is hidden too>", "", "", "test " & Now, "The body", [ "/home/benoit/Documents/photo.jpg" ])
END

kmail is running before I run this program.

If you want to know how I do DCOP calls, you can look in the ./src/lib/qt/kde/CApplication.cpp file in the gambas sources.

In a few words, I cache the DCOP method definitions for each application. When I do the call, I convert any Gambas datatype to the corresponding Qt/KDE datatype, and if there is no errors, I do the DCOP call.

I wrote the DCOP calling code by reading the kdcop sources.
Comment 4 gambas 2005-01-01 13:44:50 UTC
After having closed Kopete, and reopen it, the e-mail where I chose 'changing the encoding' and that were not sent open in a window, with the attachment, and everything I passed to sendMessage. If I click on send, then the mail is sent.
Comment 5 Till Adam 2005-01-01 13:52:29 UTC
I'm sorry, but I'm completely confused now. Can you please clearly state 1) the expected behavior and 2) the behavior that you think is a bug. Thanks.
Comment 6 gambas 2005-01-01 14:00:54 UTC
I expected one of the two followings correct behaviours:

1) The not very useful one: open the composition window as if I wanted to send the mail directly in KMail.

2) The more useful one: silently send the mail with the attachment.

What happens:

KMail opens a message box to warn me that there is an encoding problem.
-> First question: what is that problem ?
-> I would prefer that the DCOP call returns an error code instead of displaying a message box.

If I select 'change the encoding' in the message box, nothing happens.
-> Actually, if I close Kopete and reopen it, a composition window appears, with my attachment, and every parameter I passed to sendMessage().

If I choose to ignore the bad characters, then the mail is sent, but without the attachment.
-> Why ? The attachment is just a JPEG. It seems that there is a relation between this attachment and the meesage box displayed.

I hope things are clearer now :-)
Comment 7 Till Adam 2005-01-01 18:03:10 UTC
Ok, thanks for clarifying. I'll downgrade the bug for now.
Comment 8 Martin Koller 2009-08-26 22:39:28 UTC
As KDE4 no longer uses DCOP, do you still see the problem with KDE 4.3 ?
Comment 9 gambas 2009-08-26 22:49:59 UTC
I don't know. I can try now that Gambas has a DBus component. Has KMail kept the same interface?
Comment 10 Martin Koller 2009-08-26 23:06:10 UTC
I don't know but you can check with either qdbus or qdbusviewer ... (I don't know the details though...)
Comment 11 Andrew Crouthamel 2018-09-04 18:21:29 UTC
Hello! Sorry to be the bearer of bad news, but this version of Kmail has been unmaintained for many years so I am closing this bug. Please try using the latest version of Kmail to see if your issue persists. If it does, please submit a new bug in "kmail2". Thank you!