/[webmail]/cgi-bin/inbox.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/inbox.pl

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

revision 1.2 by dpavlin, Wed Apr 19 06:08:53 2000 UTC revision 1.3 by dpavlin, Wed Apr 19 09:06:17 2000 UTC
# Line 178  exit; Line 178  exit;
178    
179  #----------------------------------SUBROUTINES-------------------------  #----------------------------------SUBROUTINES-------------------------
180    
181    # Decode quoted strings (in From: and Subject)
182    
183    sub DecodeQuoted {
184            my $tmp = $_[0];
185            if ($tmp =~ /=?ISO-8859-[1-2]?(.)?/i) {
186                    $tmp =~ s/=([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
187                    $tmp =~ s/=\?ISO-8859-[1-2]\?.\?(.*)\?=/$1/i;
188            }
189            return $tmp;
190    }
191    
192  #-----------------------------Sub ParseHeaders-----------------------------  #-----------------------------Sub ParseHeaders-----------------------------
193  #Subroutine to parse the headers on each message to exctract the TO:, FROM:,  #Subroutine to parse the headers on each message to exctract the TO:, FROM:,
# Line 228  for ($i=$lastMsg; $i >= 1 && $i> $lastMs Line 238  for ($i=$lastMsg; $i >= 1 && $i> $lastMs
238                  #of each line                  #of each line
239          if (/^From:/ ){          if (/^From:/ ){
240                  $from = $';                     #Get string following the succesful match.                  $from = $';                     #Get string following the succesful match.
241                $from = DecodeQuoted($from);
242              $from =~ s/</&lt\;/;                #Strip out angled brackets to prevent browsers              $from =~ s/</&lt\;/;                #Strip out angled brackets to prevent browsers
243              $from =~ s/>/&gt\;/;                #from interpreting them as unknown HTML codes.              $from =~ s/>/&gt\;/;                #from interpreting them as unknown HTML codes.
244              }              }
# Line 236  for ($i=$lastMsg; $i >= 1 && $i> $lastMs Line 247  for ($i=$lastMsg; $i >= 1 && $i> $lastMs
247              }              }
248          elsif (/^Subject:/) {          elsif (/^Subject:/) {
249                  $sub = $';                  $sub = $';
250                    $sub = DecodeQuoted($sub);
251              }              }
252          elsif (/^Date:/) {          elsif (/^Date:/) {
253                  $date = $';                  $date = $';
254                          }                          }
255          }          }
256          $date=~ s/.*\,(.*)\+.*/$1/;          $date=~ s/.*\,(.*)\+.*/$1/;
257            $date="<small>$date</small>";
258          print "<td><a href='.' OnClick='document.lire$i.submit();return false;'>$from&nbsp;</a></td><td><b>$sub&nbsp;</b></td><td>$date&nbsp;</td>";          print "<td><a href='.' OnClick='document.lire$i.submit();return false;'>$from&nbsp;</a></td><td><b>$sub&nbsp;</b></td><td>$date&nbsp;</td>";
259    
260          #for each message header, also provide a FORM button to          #for each message header, also provide a FORM button to

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.26