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

KMail: Is there a dbusAddMessage replacement?

Tags: None
(comma "," separated)
BSDKaffee
Registered Member
Posts
2
Karma
0
I have been using KMail from kdepim 4.4.11.1 for quite a while and just upgraded to kdepim 4.8.3. I had been using dbusAddMessage provided by Kmail to move already created email messages from send-pr(1) to my outbox from a script. Now it seems dbusAddMessage is gone and I can't seem to find a replacement that works right.

I would set the environment variable MAIL_AGENT=/home/BSDKaffee/src/scripts/sendprbykmail.sh and send-pr would pipe the email through the script.
Where sendprbykmail.sh is:
Code: Select all
#!/bin/sh

# sendprbykmail.sh
# Send PRs from send-pr through KMail for KDE 4.x

# Location/name of temporary file
# DEFAULT: /tmp/kmail-pr-<PID>
TMPDIR="/tmp"
TMPFILE="kmail-pr-$$"

# Name of KMail mail folder used for outgoing mail
# DEFAULT: outbox
OUTBOX="outbox"

# Create a temorary file containing the output of send-pr
cat - > ${TMPDIR}/${TMPFILE}

# Check if KMail 4.x is running, if so place the PR in the outbox
if qdbus org.kde.kmail ; then
   qdbus org.kde.kmail /KMail org.kde.kmail.kmail.dbusAddMessage ${OUTBOX} ${TMPDIR}/${TMPFILE}
   rm ${TMPDIR}/${TMPFILE}
   exit 0
# If KMail is not running, PR is saved
else
   echo "** PR not sent. Copy stored in ${TMPDIR}/${TMPFILE}"
   exit 1
fi

Since dbusAddMessage is gone, is there an equivalent qdbus command I could use? Thanks in advance for any advice.
User avatar
einar
Administrator
Posts
3402
Karma
7
OS
I think that's because KMail is no longer in control of handling messages directly, but instead Akonadi does so. That said, I'm not sure what kind of interface is exposed over D-Bus by Akonadi itself.


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
If my guess is right, the objective of this is to send a email correct?
If so, you may wish to look at the various command line arguments to KMail, which should allow you to send a email that way (you may have to manually confirm it by clicking send however)


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
einar
Administrator
Posts
3402
Karma
7
OS
Code: Select all
 kmail -s <subject>  --body <text> [--attach <URL>] ADDRESS
is what you may be interested in, but indeed it doesn't send the message automatically.


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
BSDKaffee
Registered Member
Posts
2
Karma
0
bcooksley wrote:If my guess is right, the objective of this is to send a email correct?
If so, you may wish to look at the various command line arguments to KMail, which should allow you to send a email that way (you may have to manually confirm it by clicking send however)

I want to send a prepared email with the headers already filled out and feed it to KMail. I have looked at the command line args for kmail and ksendemail and it appears that they can only read the message body from a file. I would still have to supply the subject, address, cc, etc. on the command line. That wouldn't work for me since send-pr creates an actual email that should just be able to be sent as is. The old dbus interface allowed for a whole email message to be queued in the outbox.

For now I am using esmtp to mail my messages. Of course, the whole point of this was to avoid setting up another SMTP client.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
You may wish to file a feature request in regards to this.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot]