[mICQ] How to use the micq-script?

Vladimír Marek vlmarek at volny.cz
Mon Apr 16 09:37:10 CEST 2007


Hi,

> I think I've read that it is possible to forward incoming messages to a 
> php or bash-script. How does this exactly work? And is it even possible 
> to use the script to send a message?

Yes & yes

> What I think about is to send something like encrypted messages. If I 
> receive a (encrypted) message, my bash/php-script decryts it that I can 
> read it. And if I answer, I type my message in the script, the scripts 
> encryts the message and uses micq to send it.

I'm afraid that micq always displays the incomming message, and then
calls your script. So the best you could have is to see encrypted
message and then output of your script.

> Is this possible or are encrypted messages (like the gaim encryption 
> plugin) already integrated or planned in micq?

I'm not avare of this.

My micqrc contains:

----------------------------------------------------------------------
[...]
[Connection]
type remote auto
version 0
server remote-control

event icq_event.pl
[...]
----------------------------------------------------------------------

The Connection bit creates fifo queue

$ ls -l  ~/.micq/remote-control
prw------- 1 neuron neuron 0 2007-04-16 09:25 /home/neuron/.micq/remote-control

The "event" clausule specifies script which is to be called for each
event hapeening.


My icq_event.pl is simple:

----------------------------------------------------------------------
#!/usr/bin/perl

open F, '>/home/neuron/log/icq.txt';
for (@ARGV) {
   print F "->$_\n";
}
close F;

if ($ARGV[4] eq 'msg') {
   system 'aplay /home/neuron/.micq/sound.wav &> /dev/null &';
}
----------------------------------------------------------------------

First part just dupms all arguments to a file, so that I can see what
was passed in. Basically debug code.
Second part sounds a 'ding' if someone sends me message.

Now part of my .procmailrc:

:0 ch
| ~/bin/oznam_mail.pl &> /dev/null

Calls script for every mail I get.

The script basically does:

----------------------------------------------------------------------
$PIPE="$ENV{'HOME'}/.micq/remote-control";

open F, ">$PIPE" or die "Can't open '$PIPE': $!\n";
print F "!echo -ne 'Incomming Mail:\\n";
print F "$subj\\n";
print F "$from\\n'";
print F "\n";
----------------------------------------------------------------------

I'm attaching the whole scritp, it decodes encoded mail headers so it's
a bit too long for pasting here.

Combining this two things you could get encrypted messages IMO.


Hope this helps

-- 
	Vlad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oznam_mail.pl
Type: application/x-perl
Size: 1493 bytes
Desc: not available
Url : http://micq.org/pipermail/micq-list/attachments/20070416/96f8fdf9/attachment.bin 


More information about the mICQ-List mailing list