This file is indexed.

/usr/bin/sendxmpp is in sendxmpp 1.24-2.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
#!/usr/bin/perl -w

eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
if 0; # not running under some shell

#
# script to send message using xmpp (aka jabber),
# somewhat resembling mail(1)
#
# Author:     Dirk-Jan C. Binnema <djcb AT djcbsoftware.nl>
# Maintainer: Lubomir Host <lubomir.host@gmail.com>
# Copyright (c) 2004 - 2005 Dirk-Jan C. Binnema
# Copyright (c) 2006 - 2014 Lubomir Host
#
# Homepage: http://sendxmpp.hostname.sk
#
# Released under the terms of the GNU General Public License v2
#

use Authen::SASL qw(Perl); # authentication broken if Authen::SASL::Cyrus module installed
use Net::XMPP;
use Net::Domain;
use Getopt::Long;

use strict;

use open ':utf8';
use open ':std';

# subroutines decls
sub xmpp_login($$$$$$$$$$$$);
sub xmpp_send ($$$$);
sub xmpp_send_raw_xml($$);
sub xmpp_send_message($$$$$$);
sub xmpp_send_chatroom_message($$$$$);
sub xmpp_logout($);
sub xmpp_check_result;
sub parse_cmdline();
sub error_exit;
sub debug_print;
sub read_config_file($);
sub push_hash($$);
sub terminate();
sub main();

my # MakeMaker
$VERSION	= 1.24;
my $RESOURCE = 'sendxmpp';
my $VERBOSE  = 0;
my $DEBUG    = 0;
# http://tools.ietf.org/html/rfc3921#section-2  section 2.1.1 - Types of Message
my @suppported_message_types	= qw( chat error groupchat headline normal );
my $message_type				= 'chat'; # default message type

# start!
&main;

#
# main: main routine
#
sub main () { # {{{

    my $cmdline = parse_cmdline();

    $| = 1; # no output buffering

    $DEBUG   = 1 if ($$cmdline{'debug'});
    $VERBOSE = 1 if ($$cmdline{'verbose'});

    my $config = read_config_file ($$cmdline{'file'})
	unless ($$cmdline{'sso'} || ($$cmdline{'username'} && $$cmdline{'password'}));

    # login to xmpp
    my $cnx =  xmpp_login (
		$$cmdline{'jserver'}  || $$config{'jserver'},
		$$cmdline{'port'}     || $$config{'port'} || ($$cmdline{'ssl'} ? 5223 : 5222),
		$$cmdline{'username'} || $$config{'username'},
		$$cmdline{'password'} || $$config{'password'},
		$$cmdline{'component'}|| $$config{'component'},
		$$cmdline{'resource'},
		$$cmdline{'tls'} || $$config{'tls'} || 0,
		$$cmdline{'no-tls-verify'} || $$config{'no-tls-verify'},
		$$cmdline{'tls-ca-path'} || $$config{'tls-ca-path'} || '',
		$$cmdline{'ssl'},
		$$cmdline{'debug'},
		$$cmdline{'sso'}
	) or error_exit("cannot login: $!");


    # read message from STDIN or from -m/--message parameter
    if (!$$cmdline{interactive}) {
		# the non-interactive case
		my $txt;
		my $message = $$cmdline{'message'};
		if ($message) {
			open (MSG, "<$message")
				or error_exit ("cannot open message file '$message': $!");
			while (<MSG>) { $txt .= $_ };
			close(MSG);
		}
		else {
			$txt .= $_ while (<STDIN>);
		}

		xmpp_send ($cnx,$cmdline,$config,$txt);

    }
	else {
		# the interactive case, read stdin line by line

		# deal with TERM
		$main::CNX = $cnx;
		$SIG{INT}=\&terminate;

		# line by line...
		while (<STDIN>) {
			chomp;
			xmpp_send ($cnx,$cmdline,$config,$_);
		}
	}

	xmpp_logout($cnx);
	exit 0;
} # }}}

#
# read_config_file: read the configuration file
# input: filename
# output: hash with 'user', 'jserver' and 'password' keys
#
sub read_config_file ($) { # {{{

    # check permissions
    my $cfg_file = shift;
    error_exit ("cannot read $cfg_file: $!")
	unless (-r $cfg_file);
    my $owner  = (stat _ )[4];
    error_exit ("you must own $cfg_file")
      unless ($owner == $>);
    my $mode = (stat _ )[2] & 07777;
    error_exit ("$cfg_file must not be accessible by others")
      if ($mode & 0077);

    open (CFG,"<$cfg_file")
      or error_exit("cannot open $cfg_file for reading: $!");

    my %config;
    my $line = 0;
	while (<CFG>) {

		++$line;

		next if (/^\s*$/);     # ignore empty lines
		next if (/^\s*\#.*/);  # ignore comment lines

		#s/\#.*$//; # ignore comments in lines

		if (/^([a-z]+):\s*(.*)$/) {
			$config{$1} = $2;
		}
		# Hugo van der Kooij <hvdkooij AT vanderkooij.org> has account with '#' as username
		elsif (/([\.\w_#-]+)@([-\.\w:;]+)\s+(\S+)\s*(\S+)?$/) {
			%config = (
				'username'	=> $1,
				'jserver'	=> $2,
				'port'		=> 0,
				'password'	=> $3,
				'component'	=> $4,
			);

		}
		else {
			close CFG;
			error_exit ("syntax error in line $line of $cfg_file");
		}

		# account with weird port number
		if (defined($config{'jserver'}) and $config{'jserver'}	=~ /(.*):(\d+)/) {
			$config{'jserver'}	= $1;
			$config{'port'}		= $2;
		}

		# account with specific connection host
		if (defined($config{'jserver'}) and $config{'jserver'}	=~ /(.*);([-\.\w]+)/) {
			$config{'jserver'}	= $2;
			$config{'username'}	.= "\@$1" unless $config{'component'};
		}
	}

    close CFG;

    error_exit ("no correct config found in $cfg_file")
      unless (scalar(%config));

	  if ($DEBUG || $VERBOSE) {
		  while (my ($key,$val) = each %config) {
			  debug_print ("config: '$key' => '$val'");
		  }
	  }

    return \%config;
} # }}}

#
# parse_cmdline: parse commandline options
# output: hash with commandline options
#
sub parse_cmdline () { # {{{

    usage() unless (scalar(@ARGV));

	my ($subject, $file, $resource, $jserver, $port, $username, $password, $sso, $component, 
		$message, $chatroom, $headline, $debug, $tls, $ssl,
		$no_tls_verify, $tls_ca_path,
		$interactive, $help, $raw, $verbose
	);
    $debug = 0;
    my $res = GetOptions (
		'subject|s=s'		=> \$subject,
		'file|f=s'			=> \$file,
		'resource|r=s'		=> \$resource,
		'jserver|j=s'		=> \$jserver,
		'component|o=s'		=> \$component,
		'username|u=s'		=> \$username,
		'password|p=s'		=> \$password,
		'sso'				=> \$sso,
		'message|m=s'		=> \$message,
		'headline|l'		=> \$headline,
		'message-type=s'	=> \$message_type,
		'chatroom|c'		=> \$chatroom,
		'tls|t'				=> \$tls,
		'no-tls-verify|n'	=> \$no_tls_verify,
		'tls-ca-path|a=s'	=> \$tls_ca_path,
		'ssl|e'				=> \$ssl,
		'interactive|i'		=> \$interactive,
		'help|usage|h'		=> \$help,
		'debug|d:i'			=> sub { $debug = $_[1] ? $_[1] : $debug + 1 },
		'raw|w'				=> \$raw,
		'verbose|v'			=> \$verbose
	);

	usage () if ($help);

	my @rcpt = @ARGV;

	if (defined($raw) && scalar(@rcpt) > 0) {
		error_exit("You must give a recipient or --raw (but not both)");
	}
	if ($raw && $subject) {
		error_exit("You cannot specify a subject in raw XML mode");
	}
	if ($raw && $chatroom) {
		error_exit("The chatroom option is pointless in raw XML mode");
	}

	if ($message && $interactive) {
		error_exit("Cannot have both -m (--message) and -i (--interactive)");
	}

	if (scalar(grep { $message_type eq $_ } @suppported_message_types) == 0) {
		error_exit("Unsupported message type '$message_type'");
	}
	
	if ($ssl && $tls) {
	    error_exit("Connect securely wether using -e (--ssl) or -t (--tls)");
	}

	if ($sso && $username) {
		error_exit("When using --sso, user should not be specified");
	}

	if ($headline) {
		# --headline withouth --message-type
		if ($message_type eq 'message' or $message_type eq 'chat') {
			$message_type = 'headline'
		}
		else {
			error_exit("Options --headline and --message-type are mutually exclusive");
		}
	}

	if ($jserver && $jserver =~ /(.*):(\d+)/) {
		$jserver = $1;
		$port    = $2;
	}

	my %dict = (
		'subject'		=> ($subject  or ''),
		'message'		=> ($message or ''),
		'resource'		=> ($resource or $RESOURCE),
		'jserver'		=> ($jserver or ''),
		'component'		=> ($component or ''),
		'port'			=> ($port or 0),
		'username'		=> ($username or ''),
		'password'		=> ($password or ''),
		'sso'			=> ($sso or 0),
		'chatroom'		=> ($chatroom or 0),
		'message-type'	=> $message_type,
		'interactive'	=> ($interactive or 0),
		'tls'			=> ($tls or 0),
		'no-tls-verify'	=> ($no_tls_verify or 0),
		'tls-ca-path'	=> ($tls_ca_path or ''),
		'ssl'			=> ($ssl or 0),
		'debug'			=> ($debug or 0),
		'verbose'		=> ($verbose or 0),
		'raw'			=> ($raw or 0),
		'file'			=> ($file or ($ENV{'HOME'}.'/.sendxmpprc')),
		'recipient'		=> \@rcpt
	);

   if ($DEBUG || $VERBOSE) {
       while (my ($key,$val) = each %dict) {
	   debug_print ("cmdline: '$key' => '$val'");
       }
   }

   return \%dict;
} # }}}

#
# xmpp_login: login to the xmpp (jabber) server
# input: hostname,port,username,password,resource,tls,ssl,debug
# output: an XMPP connection object
#
sub xmpp_login ($$$$$$$$$$$$) { # {{{

    my ($host, $port, $user, $pw, $comp, $res, $tls, $no_tls_verify, $tls_ca_path, $ssl, $debug, $sso) = @_;
    my $cnx = new Net::XMPP::Client(debuglevel=>$debug);
    error_exit "could not create XMPP client object: $!"
	unless ($cnx);

	my $ssl_verify = 0x01;
	if ($no_tls_verify) { $ssl_verify = 0x00; }
	debug_print "ssl_verify: $ssl_verify";

	debug_print "tls_ca_path: $tls_ca_path";

    my @res;
	my $arghash = {
		hostname		=> $host,
		port            => $port,
		tls				=> $tls,
		ssl_verify		=> $ssl_verify,
		ssl_ca_path		=> $tls_ca_path,
		ssl             => $ssl,
		connectiontype	=> 'tcpip',
		componentname	=> $comp
	};

    if ($sso) {
	$user = join('@', scalar getpwuid($<), Net::Domain::hostdomain());
	debug_print "using SSO user $user";
    }

    # use the xmpp domain as the host and enable SRV lookups
    if (!$host) {
	if ($user =~ /@(.*)/) {
	    $arghash->{hostname} = $host = $1;
	    $arghash->{srv} = 1;
	    debug_print "enabling SRV lookups";
	    
	} else {
	    error_exit "unable to determine a host to connect to (no cmdline, no config, no SRV possible)";
	}	    

    }

	delete $arghash->{port} unless $port; 
	if ($arghash->{port}) {
		@res = $cnx->Connect(%$arghash);
		error_exit ("Could not connect to '$host' on port $port: ".($cnx->GetErrorCode()||$@)) unless @res;
	} else {
		@res = $cnx->Connect(%$arghash);
		error_exit ("Could not connect to server '$host': ".($cnx->GetErrorCode()||$@)) unless @res;
	}

    xmpp_check_result("Connect",\@res,$cnx);

	if ($comp) {
		my $sid = $cnx->{SESSION}->{id};
		$cnx->{STREAM}->{SIDS}->{$sid}->{hostname} = $comp
	}

    @res = $cnx->AuthSend(#'hostname' => $host,
			  'username' => $user,
			  'password' => $pw,
			  'resource' => $res);
    xmpp_check_result('AuthSend',\@res,$cnx);

    return $cnx;
} # }}}

#
# xmmp_send: send the message, determine from cmdline
# whether it's to individual or chatroom
#
sub xmpp_send ($$$$) { # {{{

	my ($cnx, $cmdline, $config, $txt) = @_;

	unless ($$cmdline{'chatroom'}) {
    	unless ($$cmdline{'raw'}) {
			map {
				xmpp_send_message ($cnx,
					$_, #$$cmdline{'recipient'},
					$$cmdline{'component'} || $$config{'component'},
					$$cmdline{'subject'},
					$$cmdline{'message-type'},
					$txt)
			} @{$$cmdline{'recipient'}};
    	}
		else {
			xmpp_send_raw_xml ($cnx, $txt);
    	}
	}
	else {
		map {
			xmpp_send_chatroom_message ($cnx,
				$$cmdline{'resource'},
				$$cmdline{'subject'},
				$_, # $$cmdline{'recipient'},
				$txt)
		} @{$$cmdline{'recipient'}};
	}
} # }}}

#
# xmpp_send_raw_xml: send a raw XML packet
# input: connection,packet
#
sub xmpp_send_raw_xml ($$) { # {{{

    my ($cnx,$packet) = @_;

    # for some reason, Send does not return anything
    $cnx->Send($packet);
    xmpp_check_result('Send',0,$cnx);
} # }}}

#
# xmpp_send_message: send a message to some xmpp user
# input: connection,recipient,subject,msg
#
sub xmpp_send_message ($$$$$$) { # {{{

    my ($cnx, $rcpt, $comp, $subject, $message_type, $msg) = @_;

    # for some reason, MessageSend does not return anything
	# mimeit01@xmpp.hs-esslingen.de: if $comp IS set, AND the rcpt DOESN'T contain an @, then @comp is added
    $cnx->MessageSend('to'      => $rcpt . ( ($comp && index($rcpt, "@") == -1) ? "\@$comp" : '' ),
		'type'		=> $message_type,
		'subject'	=> $subject,
		'body'		=> $msg);

    xmpp_check_result('MessageSend',0,$cnx);
} # }}}

#
# xmpp_send_chatroom_message: send a message to a chatroom
# input: connection,resource,subject,recipient,message
#
sub xmpp_send_chatroom_message ($$$$$) { # {{{

    my ($cnx,$resource,$subject,$rcpt,$msg) =  @_;

    # set the presence
    my $pres = new Net::XMPP::Presence;
    my $res = $pres->SetTo("$rcpt/$resource");

    $cnx->Send($pres);

    # create/send the message
    my $groupmsg = new Net::XMPP::Message;
    $groupmsg->SetMessage(to      => $rcpt,
			  body    => $msg,
			  type    => 'groupchat');

    $res = $cnx->Send($groupmsg);
    xmpp_check_result ('Send',$res,$cnx);

    # leave the group
    $pres->SetPresence (Type=>'unavailable',To=>$rcpt);
} # }}}

#
# xmpp_logout: log out from the xmpp server
# input: connection
#
sub xmpp_logout($) { # {{{

    # HACK
    # messages may not be received if we log out too quickly...
    sleep 1;

    my $cnx = shift;
    $cnx->Disconnect();
    xmpp_check_result ('Disconnect',0); # well, nothing to check, really
} # }}}

#
# xmpp_check_result: check the return value from some xmpp function execution
# input: text, result, [connection]
#
sub xmpp_check_result { # {{{
    my ($txt, $res, $cnx)=@_;

    error_exit ("Error '$txt': result undefined")
	unless (defined $res);

    # res may be 0
	if ($res == 0) {
		debug_print "$txt";
		# result can be true or 'ok'
	}
	elsif ((@$res == 1 && $$res[0]) || $$res[0] eq 'ok') {
		debug_print "$txt: " .  $$res[0];
		# otherwise, there is some error
	}
	else {
		my $errmsg = $cnx->GetErrorCode() || '?';
		error_exit ("Error '$txt': " . join (': ',@$res) . "[$errmsg]", $cnx);
	}
} # }}}

#
# terminate; exit the program upon TERM sig reception
#
sub terminate () { # {{{
    debug_print "caught TERM";
    xmpp_logout($main::CNX);
    exit 0;
} # }}}

#
# debug_print: print the data if defined and DEBUG || VERBOSE is TRUE
# input: [array of strings]
#
sub debug_print { # {{{
    print STDERR "sendxmpp: " . (join ' ', @_) . "\n"
	if (@_ && ($DEBUG ||$VERBOSE));
} # }}}

#
# error_exit: print error message and exit the program
#             logs out if there is a connection
# input: error, [connection]
#
sub error_exit { # {{{

    my ($err,$cnx) = @_;
    print STDERR "$err\n";
    xmpp_logout ($cnx)
	if ($cnx);

    exit 1;
} # }}}

#
# usage: print short usage message and exit
#
sub usage () { # {{{

    print STDERR
	"sendxmpp version $VERSION\n" .
	"Copyright (c) 2004 - 2005 Dirk-Jan C. Binnema\n" .
   	"Copyright (c) 2006 - 2014 Lubomir Host\n" .
	"usage: sendxmpp [options] <recipient1> [<recipient2> ...]\n" .
	"or refer to the the sendxmpp manpage\n";

    exit 0;
} # }}}

#
# the fine manual
#
=pod

=head1 NAME

sendxmpp - send xmpp messages from the commandline.

=head1 SYNOPSIS

sendxmpp [options] <recipient1> [<recipient2> ...]

sendxmpp --raw [options]

=head1 DESCRIPTION

sendxmpp is a program to send XMPP (Jabber) messages from the commandline, not
unlike L<mail(1)>. Messages can be sent both to individual recipients and chatrooms.

=head1 OPTIONS

=over

=item B<-f>,B<--file> I<file>

Use I<file> configuration file instead of F<~/.sendxmpprc>

=item B<-u>,B<--username> I<user>

Use I<user> instead of the one in the configuration file

=item B<-p>,B<--password> I<password>

Use I<password> instead of the one in the configuration file

=item B<--sso> 

Instead of specifying username or password, attempt to use system level SSO (e.g. kerberos) if supported.

=item B<-j>,B<--jserver> I<server>

Use jabber I<server> instead of the one in the configuration file.

=item B<-o>,B<--component> I<componentname>

Use componentname in connect call. Seems needed for Google talk.

=item B<-r>,B<--resource> I<res>

Use resource I<res> for the sender [default: 'sendxmpp']; when sending to a chatroom, this determines the 'alias'

=item B<-t>,B<--tls>

Connect securely, using TLS

=item B<-e>,B<--ssl>

Connect securely, using SSL

=item B<-n>,B<--no-tls-verify>

Deactivate the verification of SSL certificates. Better way is to use parameter B<--tls-ca-path> with the needed path to CA certificates.

=item B<-a>,B<--tls-ca-path>

Path to your custom CA certificates, so you can verificate SSL certificates during connecting.

=item B<-l>,B<--headline>

Backward compatibility option. You should use B<--message-type=headline> instead. Send a headline type message (not stored in offline messages)

=item B<--messages-type>

Set type of message. Supported types are: B<message chat headline>. Default message type is B<message>. Headline type message can be set also with B<--headline> option, see B<--headline>

=item B<-c>,B<--chatroom>

Send the message to a chatroom

=item B<-s>,B<--subject> I<subject>

Set the subject for the message to I<subject> [default: '']; when sending to a chatroom, this will set the subject for the chatroom

=item B<-m>,B<--message> I<message>

Read the message from I<message> (a file) instead of stdin

=item B<-i>,B<--interactive>

Work in interactive mode, reading lines from stdin and sending the one-at-time

=item B<-w>,B<--raw>

Send raw XML message to jabber server

=item B<-v>,B<--verbose>

Give verbose output about what is happening

=item B<-h>,B<--help>,B<--usage>

Show a 'Usage' message

=item B<-d>,B<--debug>

Show debugging info while running. B<WARNING>: This will include passwords etc. so be careful with the output! Specify multiple times to increase debug level.

=back

=head1 CONFIGURATION FILE

You may define a 'F<~/.sendxmpprc>' file with the necessary data for your
xmpp-account. Since version 1.24 the following format is supported:

    username: I<your_username>
    jserver: I<jabber_server>
    port: I<jabber_port>
    password: I<your_jabber_password>
    component: I<optional_component_name>


Example for Google Talk servers:

    username: I<lubomir.host>
    jserver: I<talk.google.com>
    password: I<my-secure-password>
    component: I<gmail.com>

With version 1.23 and older only one-line format is supported:

=over

I<user>@I<server> I<password> I<componentname>

=back

e.g.:

    # my account
    alice@jabber.org  secret

('#' and newlines are allowed like in shellscripts). You can add a I<host> (or IP address) if it is different from the I<server> part of your JID:

    # account with specific connection host
    alice@myjabberserver.com;foo.com secret

You can also add a I<port> if it is not the standard XMPP port:

    # account with weird port number
    alice@myjabberserver.com:1234 secret

Of course, you may also mix the two:

    # account with a specific host and port
    alice@myjabberserver.com;foo.com:1234 secret

B<NOTE>: for your security, sendxmpp demands that the configuration
file is owned by you and readable only to you (permissions 600).

=head1 EXAMPLE

   $ echo "hello bob!" | sendxmpp -s hello someone@jabber.org

     or to send to a chatroom:

   $ echo "Dinner Time" | sendxmpp -r TheCook --chatroom test2@conference.jabber.org

     or to send your system logs somewhere, as new lines appear:

   $ tail -f /var/log/syslog | sendxmpp -i sysadmin@myjabberserver.com

     NOTE: be careful not the overload public jabber services

=head1 SEE ALSO

Documentation for the L<Net::XMPP> module

The jabber homepage: L<http://www.jabber.org/>

The sendxmpp homepage: L<http://sendxmpp.hostname.sk>

=head1 AUTHOR

sendxmpp has been written by Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>, and uses
the L<Net::XMPP> modules written by Ryan Eatmon. Current maintainer is
Lubomir Host <lubomir.host@gmail.com>, L<http://blog.hostname.sk>

=cut
# vim: fdm=marker fdl=0 fdc=3