Results 1 to 2 of 2

Thread: Command-line IM Client

  1. #1
    Join Date
    Sep 2007
    Posts
    30
    Rep Power
    8

    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.

  2. #2
    Join Date
    Sep 2007
    Posts
    30
    Rep Power
    8

    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.

Similar Threads

  1. Zimbra + LDAP + Posix + Samba
    By fruitlounge in forum Administrators
    Replies: 24
    Last Post: 06-30-2008, 09:55 PM
  2. Replies: 3
    Last Post: 03-27-2008, 09:52 AM
  3. can't you help me
    By iwan siahaan in forum Administrators
    Replies: 6
    Last Post: 12-17-2007, 05:53 PM
  4. Web Client Performance and Basic client features
    By fviero in forum Administrators
    Replies: 1
    Last Post: 11-23-2007, 04:34 AM
  5. Deploying Zimbra Client (zimbra.war)
    By zocs in forum Installation
    Replies: 2
    Last Post: 07-25-2007, 05:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •