summaryrefslogblamecommitdiffstats
path: root/util/filtermail.pl
blob: 08d943095e55328d757e7386ad615a167abe9913 (plain) (tree)
1
2
3
4
5
6
7
8
9
               
      

                           
                   
 


              
 
            




                           
 
 




                                                                       
 





                                                     
 
    
#!/usr/bin/perl
# $Id$
use lib qw(/home/bbs/bin/);
use FILTERMAIL;
$bbsuid = $ARGV[0];

undef @ARGV;
undef $header;
undef $body;

while( <> ){
    $header .= $_;
    last if( $_ =~ /^\n/ );
}
while( <> ){
    $body .= $_;
}

if( FILTERMAIL::checkheader($header) && FILTERMAIL::checkbody($body) ){
    open FH, "|/home/bbs/bin/realbbsmail $bbsuid";
    print FH $header;
    print FH $body;
    close FH;
}
=xxx
else {
    $fn = `/usr/bin/mktemp -q /tmp/norelay.XXXXXXXX`;
    open FH, ">$fn";
    print FH $msg;
    close FH;
}
=cut