1 |
#!/usr/local/bin/perl |
#!/usr/local/bin/perl |
2 |
|
|
3 |
BEGIN { $APP_PATH="foo/bar"; } |
BEGIN { $APP_PATH="/home/httpd/html/webmail/cgi-bin/"; } |
4 |
|
|
5 |
# @ ---------------------------------------------------------------------------------------------------------- |
# @ ---------------------------------------------------------------------------------------------------------- |
6 |
# @ This code is (c) 1999 Alexandre Aufrere and NikoSoft. |
# @ This code is (c) 1999 Alexandre Aufrere and NikoSoft. |
181 |
$body=~ s/$bound(.*)$bound.*/$1/; |
$body=~ s/$bound(.*)$bound.*/$1/; |
182 |
@bodylines=split("\n",$body); |
@bodylines=split("\n",$body); |
183 |
$partone=0; |
$partone=0; |
184 |
$mimeHeader=0; |
$mimeHeader=1; # on header? |
185 |
foreach $bdy (@bodylines) { |
foreach $bdy (@bodylines) { |
186 |
if (($bdy=~ m/$bound/)&&($partone==1)) { |
if (($bdy=~ m/$bound/)&&($partone==1)) { |
187 |
$partone=2; |
$partone=2; |
188 |
} |
} |
189 |
if ($partone==1) { $mimeHeader++; } |
if (($partone==1)&&(!$mimeHeader)) { |
|
if (($partone==1)&&($mimeHeader > 3) ) { |
|
190 |
$bdy=decodeHexChars($bdy); |
$bdy=decodeHexChars($bdy); |
191 |
print $bdy."<br>\n"; |
print $bdy."<br>\n"; |
192 |
} |
} |
193 |
|
if ($partone==1 && $bdy=~m/^$/) { $mimeHeader=0; } |
194 |
if (($bdy=~ m/text\/plain/)&&($partone==0.5)) { |
if (($bdy=~ m/text\/plain/)&&($partone==0.5)) { |
195 |
$partone=1; |
$partone=1; |
196 |
} |
} |
265 |
#the browser will chop it off. |
#the browser will chop it off. |
266 |
#This is unlikely, but we want to cover any |
#This is unlikely, but we want to cover any |
267 |
#eventuality. |
#eventuality. |
268 |
foreach ($pop->Head($i)) { |
my @headers=$pop->Head($i); |
269 |
|
while ($_ = shift @headers) { |
270 |
|
|
271 |
#parse out the From line from the header. |
#parse out the From line from the header. |
272 |
#Also, remove any angle brackets |
#Also, remove any angle brackets |
292 |
$replyto = $'; |
$replyto = $'; |
293 |
$replyto =~ s/\s+//; #remove intervening white space |
$replyto =~ s/\s+//; #remove intervening white space |
294 |
$replyto =~ s/\</<\;/; #make angle brackets browser safe |
$replyto =~ s/\</<\;/; #make angle brackets browser safe |
295 |
$replyto =~ s/\>/>\;/; |
$replyto =~ s/\>/>\;/; |
296 |
} |
} |
297 |
|
|
298 |
|
|
335 |
# $' PERL system function. |
# $' PERL system function. |
336 |
$to = $'; |
$to = $'; |
337 |
$to =~ s/\s+//; #remove leading white space |
$to =~ s/\s+//; #remove leading white space |
338 |
$to =~ s/\</<\;/; #make angle brackets browser safe |
#support for multi-line To: |
339 |
$to =~ s/\>/>\;/; |
while ($headers[0] =~ m/^ +/) { |
340 |
|
my $tmp = shift @headers; |
341 |
|
$tmp =~ s/\s+//; |
342 |
|
$to .= $tmp; |
343 |
|
} |
344 |
|
$to =~ s/\</<\;/g; #make angle brackets browser safe |
345 |
|
$to =~ s/\>/>\;/g; |
346 |
|
|
347 |
} |
} |
348 |
#parse out the recipient line. |
#parse out the recipient line. |
353 |
$cc = $'; |
$cc = $'; |
354 |
$cc =~ s/\s+//; #remove leading white space |
$cc =~ s/\s+//; #remove leading white space |
355 |
$cc =~ s/\</<\;/; #make angle brackets browser safe |
$cc =~ s/\</<\;/; #make angle brackets browser safe |
356 |
$to =~ s/\>/>\;/; |
$cc =~ s/\>/>\;/; |
357 |
|
|
358 |
} |
} |
359 |
} |
} |