[kdepim-users] How to forward automatically mail?
Ingo Klöcker
kloecker at kde.org
Thu Oct 23 22:23:39 BST 2008
On Tuesday 21 October 2008, Michael wrote:
> Hello
>
> I like to recieve messages from a remote PC to my personal account.
>
> These messages are status and health reports which are send from
> different apps to a local user on the remote PC. This PC does not
> have a MUA "just" Kmail. And a dial in connection.
I guess you meant MTA (e.g. sendmail, postfix, etc.). KMail is a MUA
(mail user agent).
> My idea is:
> - I like to duplicate these Mails from the system user via a
> Filterrule and put this duplicat in the outbox of Kmail
> - In a second step I'd like to send and receive mail from the command
> line.
>
> Think there is something like kmail --check ...
>
> Is this possible?
If KMail is running all the time it might be possible. You need to
create a filter matching all messages you want to forward and
select "Redirect To" as filter action. "Redirect To" forwards messages
as-is while "Forward To" embeds the forwarded messages into new
messages. KMail puts those redirected messages into the outbox.
To get the messages sent you can use the following DCOP magic (all in
one line; note that this works only with KDE 3.5; with KDE 4 some dbus
magic has to be used):
dcop `dcop kmail KMailIface
openComposer "kloecker at kde.org" "" "" "dummy" "dummy" 0` send 1
This embedded dcop command
dcop kmail KMailIface openComposer "your at address" "" "" "dummy" "dummy"
1
opens a hidden (the 1 at the end) composer window with "your at address" in
the To field, empty CC and BCC field, and with "dummy" as subject and
message text.
The enclosing dcop command
dcop `...` send 1
triggers sending of the dummy message in the composer. All the other
messages in the outbox will be sent together with this dummy message.
I do not know of a way to avoid those dummy messages, but you can simply
filter them out by their subject.
Regards,
Ingo
-------------- 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/20081023/abc48195/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