version 1.13, 2007/09/10 19:08:35 |
version 1.14, 2008/08/25 09:54:12 |
Line 16 if 0; # not running under some shell |
|
Line 16 if 0; # not running under some shell |
|
# |
# |
# Released under the terms of the GNU General Public License v2 |
# Released under the terms of the GNU General Public License v2 |
# |
# |
# $Platon: $ |
# $Platon: sendxmpp/sendxmpp,v 1.13 2007-09-10 19:08:35 rajo Exp $ |
# $Id$ |
# $Id$ |
|
|
use Authen::SASL qw(Perl); # authentication broken if Authen::SASL::Cyrus module installed |
use Authen::SASL qw(Perl); # authentication broken if Authen::SASL::Cyrus module installed |
Line 148 sub read_config_file ($) { |
|
Line 148 sub read_config_file ($) { |
|
|
|
#s/\#.*$//; # ignore comments in lines |
#s/\#.*$//; # ignore comments in lines |
|
|
# Hugo van der Kooij <hvdkooij AT vanderkooij.org> has ccount with '#' as username |
# Hugo van der Kooij <hvdkooij AT vanderkooij.org> has account with '#' as username |
if (/([\.\w_#-]+)@([-\.\w:]+)\s+(\S+)\s*(\S+)?$/) { |
if (/([\.\w_#-]+)@([-\.\w:;]+)\s+(\S+)\s*(\S+)?$/) { |
%config = ( |
%config = ( |
'username' => $1, |
'username' => $1, |
'jserver' => $2, |
'jserver' => $2, |
Line 158 sub read_config_file ($) { |
|
Line 158 sub read_config_file ($) { |
|
'component' => $4, |
'component' => $4, |
); |
); |
|
|
if ($config{'jserver'} =~ /(.*):(\d+)/) { |
|
$config{'jserver'} = $1; |
|
$config{'port'} = $2; |
|
} |
|
} |
} |
else { |
else { |
close CFG; |
close CFG; |
error_exit ("syntax error in line $line of $cfg_file"); |
error_exit ("syntax error in line $line of $cfg_file"); |
} |
} |
|
|
|
# account with weird port number |
|
if ($config{'jserver'} =~ /(.*):(\d+)/) { |
|
$config{'jserver'} = $1; |
|
$config{'port'} = $2; |
|
} |
|
|
|
# account with specific connection host |
|
if ($config{'jserver'} =~ /(.*);([-\.\w]+)/) { |
|
$config{'jserver'} = $2; |
|
$config{'username'} .= "\@$1"; |
|
} |
} |
} |
|
|
close CFG; |
close CFG; |