#
# Released under the terms of the GNU General Public License v2
#
-# $Platon: sendxmpp/sendxmpp,v 1.20 2010-01-18 00:54:16 rajo Exp $
+# $Platon: sendxmpp/sendxmpp,v 1.22 2010-10-03 19:36:35 rajo Exp $
# $Id: $
use Authen::SASL qw(Perl); # authentication broken if Authen::SASL::Cyrus module installed
sub main();
my # MakeMaker
-$VERSION = [ q$Revision: 1.20 $ =~ m/(\S+)\s*$/g ]->[0];
+$VERSION = [ q$Revision: 1.22 $ =~ m/(\S+)\s*$/g ]->[0];
my $RESOURCE = 'sendxmpp';
my $VERBOSE = 0;
my $DEBUG = 0;
# account with specific connection host
if ($config{'jserver'} =~ /(.*);([-\.\w]+)/) {
$config{'jserver'} = $2;
- $config{'username'} .= "\@$1";
+ $config{'username'} .= "\@$1" unless $config{'component'};
}
}
my ($cnx, $rcpt, $comp, $subject, $message_type, $msg) = @_;
# for some reason, MessageSend does not return anything
- $cnx->MessageSend('to' => $rcpt . ( $comp ? "\@$comp" : '' ),
+ # 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);