Changeset 91

Show
Ignore:
Timestamp:
06/21/01 04:58:28
Author:
miyagawa
Message:

update README

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Apache-AntiSpam/trunk/README

    r68 r91  
    33 
    44SYNOPSIS 
     5      # You can't use this class directry 
     6      # see Apache::AntiSpam::*  
     7 
     8      # or ... if you want your own AntiSpam Filter, 
     9      package Your::AntiSpamFilter; 
     10      use base qw(Apache::AntiSpam); 
     11 
     12      sub antispamize { 
     13          my($class, $email, $orig) = @_; 
     14          # do some filtering with $orig, and 
     15          return $orig; 
     16      } 
     17 
    518      # in httpd.conf 
    619      <Location /antispam> 
    720      SetHandler perl-script 
    8       PerlHandler Apache::AntiSpam 
     21      PerlHandler Your::AntiSpamFilter 
    922      </Location> 
    1023 
    11       # off course, filter aware! 
     24      # filter aware 
    1225      PerlModule Apache::Filter 
    1326      SetHandler perl-script 
    1427      PerlSetVar Filter On 
    15       PerlHandler Apache::RegistryFilter Apache::AntiSpam Apache::Compress 
     28      PerlHandler Apache::RegistryFilter Your::AntiSpamFilter Apache::Compress 
    1629 
    1730DESCRIPTION 
    1831    Apache::AntiSpam is a filter module to prevent e-mail addresses exposed 
    19     as is on web pages. This module replaces e-mail addresses in web pages 
    20     with one of the formats listed below. (you can choose one) 
    21  
    22     *   miyagawa-nospam@cpan.org 
    23  
    24     *   miyagawa at cpan dot org 
     32    as is on web pages. The way to hide addresses from spammers are 
     33    implemented in each of Apache::Antispam::* subclasses. 
    2534 
    2635    This module is Filter aware, meaning that it can work within 
    2736    Apache::Filter framework without modification. 
    2837 
    29 CONFIGURATION 
    30       # choose either of two 
    31       PerlSetVar AntiSpamFormat NoSpam 
    32       PerlSetVar AntiSpamFormat Spaces 
     38SUBCLASSING 
     39    Here is how to make your own filter. 
    3340 
    34     "AntiSpamFormat" indicates the way Apache::AntiSpam replaces the e-mail 
    35     addresses. 
     41    Declare your class 
     42    Inherit from Apache::AntiSpam 
     43    define antispamize() method 
     44    That's all. Template of antispamize() method will be like this: 
    3645 
    37     "NoSpam" 
    38         replaces miyagawa@cpan.org with miyagawa-nospam@cpan.org. (default) 
     46      sub antispamize { 
     47          my($class, $email, $orig) = @_; 
     48          # do some stuff.. 
     49          return $orig; 
     50      } 
    3951 
    40     "Spaces" 
    41         replaces miyagawa@cpan.org with miyagawa at cpan dot org. 
     52    where "$class" is your class, "$email" is an instance of Mail::Address, 
     53    and "$orig" is an original e-mail address string. See the Email::Find 
     54    manpage for details. 
    4255 
    4356TODO 
    44     *   -nospam suffix should be configured (easy). 
    45  
    46     *   More logging with Apache::Log. 
    47  
    4857    *   remove mailto: tags using HTML::Parser. 
    49  
    50     *   Make it easy to subclass so that the antispamming method can be 
    51         configured. 
    5258 
    5359ACKNOWLEDGEMENTS 
     
    6571 
    6672SEE ALSO 
    67     the Email::Find manpage, the Apache::Filter manpage 
     73    the Email::Find manpage, the Apache::Filter manpage, the 
     74    Apache::AntiSpam::NoSpam manpage, the Apache::AntiSpam::Heuristic 
     75    manpage, the Apache::AntiSpam::HTMLEncode manpage. 
    6876