Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-21-2008, 04:51 AM
Active Member
 
Posts: 30
Default Command-line IM Client

Hi there. We're trying to use the great Instant Messaging feature, using pidgin, so we can move from jabberd server to zimbra server.
Some of our internal applications use a perl script (which uses the Net::Jabber class) to IM us in case of a failure or notification.

I'm trying to connect that perl script to the zimbra server, but it's not working properly and don't know why. I can see noting in the logs.

Any idea what colud be wrong? External client (Pidgin) is working ok

This is the script we are using with the jabberd server

Code:
#!/usr/bin/perl -w

use strict;
use Net::Jabber "Client";

die if not defined $ARGV[0];

my $hostname = 'zimbra.example.com';
my $username = 'callerid';
my $password = 'password';
my $resource = 'home';
my @to = ('foo.bar@example.com');

my $con = new Net::Jabber::Client;
my $msg = new Net::Jabber::Message;

for (@to)
{
        $con->Connect (hostname=>$hostname) or die;
        my @result = $con->AuthSend (username=>$username, password=>$password, resource=>$resource);
        next if $result[0] ne "ok";
        $msg->SetMessage (to=>$_, body=>$ARGV[0]);
        $con->Send ($msg);
        $con->Disconnect;
}
Thanks.
Reply With Quote
  #2 (permalink)  
Old 08-21-2008, 04:59 AM
Active Member
 
Posts: 30
Default

Have made a litte output:

Code:
for (@to)
{
        $con->Connect (hostname=>$hostname) or die;
        my @result = $con->AuthSend (username=>$username, password=>$password, resource=>$resource);
        foreach (@result) {
                print "$_\n";
        }
        next if $result[0] ne "ok";
        $msg->SetMessage (to=>$_, body=>$ARGV[0]);
        $con->Send ($msg);
        $con->Disconnect;
}
I see the conection is ok, but when I run ./send-jabber.pl hello I get:
Code:
error
not-authorized
And at mailbox.log:
Code:
2008-08-21 14:02:23,607 INFO  [SocketAcceptorIoProcessor-1.0] [] im - XMPP Session created: (SOCKET, R: /10.x.x.x:42280, L: /10.x.x.x:5222, S: 0.0.0.0/0.0.0.0:5222)
2008-08-21 14:02:23,637 INFO  [AnonymousIoService-3] [] im - Handshaking complete for client
2008-08-21 14:02:23,698 INFO  [AnonymousIoService-7] [] im - XMPP Session closed: (SOCKET, R: /10.x.x.x:42280, L: /10.x.x.x:5222, S: 0.0.0.0/0.0.0.0:5222)
That's nice, it's an answer from Zimbra, but don't know what is wrong, I can log into zimbra webmail with that user and password.

Still trying...

Last edited by egrueda; 08-21-2008 at 05:04 AM..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.