/[webmail]/cgi-bin/getmsg.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /cgi-bin/getmsg.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by dpavlin, Tue Feb 22 13:28:20 2000 UTC revision 1.4 by dpavlin, Fri Apr 28 08:20:44 2000 UTC
# Line 1  Line 1 
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.
# Line 181  if ($ctype =~ m/multipart/) { Line 181  if ($ctype =~ m/multipart/) {
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                  }                  }
# Line 265  sub GetHeader { Line 265  sub GetHeader {
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
# Line 291  sub GetHeader { Line 292  sub GetHeader {
292                          $replyto = $';                          $replyto = $';
293                          $replyto =~ s/\s+//;    #remove intervening white space                          $replyto =~ s/\s+//;    #remove intervening white space
294                          $replyto =~ s/\</&lt\;/;          #make angle brackets browser safe                          $replyto =~ s/\</&lt\;/;          #make angle brackets browser safe
295                                  $replyto =~ s/\>/&gt\;/;                          $replyto =~ s/\>/&gt\;/;
296                  }                  }
297                                    
298                                    
# Line 334  sub GetHeader { Line 335  sub GetHeader {
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/\</&lt\;/;       #make angle brackets browser safe                          #support for multi-line To:
339                                  $to =~ s/\>/&gt\;/;                          while ($headers[0] =~ m/^ +/) {
340                                    my $tmp = shift @headers;
341                                    $tmp =~ s/\s+//;
342                                    $to .= $tmp;
343                            }
344                            $to =~ s/\</&lt\;/g;      #make angle brackets browser safe
345                            $to =~ s/\>/&gt\;/g;
346                                                    
347                  }                  }
348                  #parse out the recipient line.                  #parse out the recipient line.
# Line 346  sub GetHeader { Line 353  sub GetHeader {
353                          $cc = $';                          $cc = $';
354                          $cc =~ s/\s+//;           #remove leading white space                          $cc =~ s/\s+//;           #remove leading white space
355                          $cc =~ s/\</&lt\;/;       #make angle brackets browser safe                          $cc =~ s/\</&lt\;/;       #make angle brackets browser safe
356                                  $to =~ s/\>/&gt\;/;                          $cc =~ s/\>/&gt\;/;
357                                                    
358                  }                  }
359          }          }

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.26