Import Upstream version 1.14
Thadeu Lima de Souza Cascardo
6 years ago
15 | 15 | # |
16 | 16 | # Released under the terms of the GNU General Public License v2 |
17 | 17 | # |
18 | # $Platon: sendxmpp/sendxmpp,v 1.13 2007-09-10 19:08:35 rajo Exp $ | |
18 | # $Platon: sendxmpp/sendxmpp,v 1.14 2008-08-25 09:54:12 rajo Exp $ | |
19 | 19 | # $Id: $ |
20 | 20 | |
21 | 21 | use Authen::SASL qw(Perl); # authentication broken if Authen::SASL::Cyrus module installed |
43 | 43 | sub main(); |
44 | 44 | |
45 | 45 | my # MakeMaker |
46 | $VERSION = [ q$Revision: 1.13 $ =~ m/(\S+)\s*$/g ]->[0]; | |
46 | $VERSION = [ q$Revision: 1.14 $ =~ m/(\S+)\s*$/g ]->[0]; | |
47 | 47 | my $RESOURCE = 'sendxmpp'; |
48 | 48 | my $VERBOSE = 0; |
49 | 49 | my $DEBUG = 0; |
147 | 147 | |
148 | 148 | #s/\#.*$//; # ignore comments in lines |
149 | 149 | |
150 | # Hugo van der Kooij <hvdkooij AT vanderkooij.org> has ccount with '#' as username | |
151 | if (/([\.\w_#-]+)@([-\.\w:]+)\s+(\S+)\s*(\S+)?$/) { | |
150 | # Hugo van der Kooij <hvdkooij AT vanderkooij.org> has account with '#' as username | |
151 | if (/([\.\w_#-]+)@([-\.\w:;]+)\s+(\S+)\s*(\S+)?$/) { | |
152 | 152 | %config = ( |
153 | 153 | 'username' => $1, |
154 | 154 | 'jserver' => $2, |
157 | 157 | 'component' => $4, |
158 | 158 | ); |
159 | 159 | |
160 | if ($config{'jserver'} =~ /(.*):(\d+)/) { | |
161 | $config{'jserver'} = $1; | |
162 | $config{'port'} = $2; | |
163 | } | |
164 | 160 | } |
165 | 161 | else { |
166 | 162 | close CFG; |
167 | 163 | error_exit ("syntax error in line $line of $cfg_file"); |
164 | } | |
165 | ||
166 | # account with weird port number | |
167 | if ($config{'jserver'} =~ /(.*):(\d+)/) { | |
168 | $config{'jserver'} = $1; | |
169 | $config{'port'} = $2; | |
170 | } | |
171 | ||
172 | # account with specific connection host | |
173 | if ($config{'jserver'} =~ /(.*);([-\.\w]+)/) { | |
174 | $config{'jserver'} = $2; | |
175 | $config{'username'} .= "\@$1"; | |
168 | 176 | } |
169 | 177 | } |
170 | 178 |