[vhffs-dev] [896] Bye bye Vhffs::Listengine:: Listengine which was used for the ugly archives, and bye bye Vhffs:: Listengine::Mail which was never used ( and which contain code that my cat wouldn't want to read)

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 896
Author:   gradator
Date:     2007-09-10 03:38:23 +0000 (Mon, 10 Sep 2007)

Log Message:
-----------
Bye bye Vhffs::Listengine::Listengine which was used for the ugly archives, and bye bye Vhffs::Listengine::Mail which was never used (and which contain code that my cat wouldn't want to read)

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Makefile.am

Removed Paths:
-------------
    trunk/vhffs-api/src/Vhffs/Listengine/Listengine.pm
    trunk/vhffs-api/src/Vhffs/Listengine/Mail.pm


Deleted: trunk/vhffs-api/src/Vhffs/Listengine/Listengine.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Listengine/Listengine.pm	2007-09-10 03:31:23 UTC (rev 895)
+++ trunk/vhffs-api/src/Vhffs/Listengine/Listengine.pm	2007-09-10 03:38:23 UTC (rev 896)
@@ -1,346 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-
-
-package Vhffs::Listengine::Listengine;
-
-#Vhffs::User written by sod` <dieu AT gunnm DOT org>
-
-#blablabla, yeah yeah yeah
-#how to you feel today ? fucking weather today !
-
-use strict;
-use Digest::MD5;
-
-use Mail::Internet;
-
-sub get_moderation_dir
-{
-    my $list = shift;
-    return( $list->get_main->get_config->get_listengine->{'datadir'} . "/moderation/" . $list->get_domain . "/" . $list->get_localpart  );
-}
-
-sub get_archives_dir
-{
-    my $list = shift;
-    return( $list->get_main->get_config->get_listengine->{'datadir'} . "/archives/" . $list->get_domain . "/" . $list->get_localpart  );
-}
-
-
-
-sub search_message
-{
-    my $list = shift;
-    my $messageid = shift;
-    my @temp;
-
-    return undef if( ! defined $list );
-    return undef if( ! defined $messageid );
-
-    my $dir = get_archives_dir( $list );
-
-    if( ! -d $dir )
-    {
-    	return undef;
-    }
-
-    my $file = search_file_message( $dir , $messageid );
-
-
-    return "tata . $messageid" if( ! -f $file );
-
-    
-    open( FILE , $file );
-    
-    while( <FILE> )
-    {
-	push( @temp , $_ );
-    }
-    my $m = Mail::Internet->new( \@temp );
-
-    close( FILE );
-
-    return $m;
-
-}
-
-
-sub search_file_message
-{
-    my $dir = shift;
-    my $filename = shift;
-    my @files;
-    my $temp;
-    my $complete;
-
-    opendir( DIR , $dir );
-    @files = readdir( DIR );
-    
-    foreach $temp ( @files )
-    {
-	next if( ( $temp eq '.' ) || ( $temp eq '..' ) );
-	$complete = $dir .'/'. $temp;
-
-	if( -f $complete )
-	{
-	    if( Digest::MD5::md5_hex( $temp ) eq $filename )
-	    {
-		return $complete;
-	    }
-	}
-	elsif( -d $complete )
-	{
-	    if( defined( $temp = search_file_message( $complete , $filename )))
-	    {
-	    	return( $temp );
-	    }
-	}
-	
-    }
-	return undef;
-    closedir( DIR );
-}
-
-
-sub obscur_addrs
-{
-    my $string = shift;
-    return( $string );
-}
-
-
-sub get_messages_in_a_day
-{
-    my $list = shift;
-    my $year = shift;
-    my $month = shift;
-    my $day = shift;
-    my @msg;
-    my $file;
-    my $result;
-    my $hash;
-    my $mail;
-   	my $header; 
-	my $mid;
-	my $final;
-	my $key;
-
-    return undef if( ! defined ( $year ) );
-    return undef if( ! ( $year =~ /^[0-9]+$/ ) );
-    return undef if( ! defined ( $month ) );
-    return undef if( ! ( $month =~ /^[0-9]+$/ ) );
-    return undef if( ! defined ( $day ) );
-    return undef if( ! ( $day =~ /^[0-9]+$/ ) );
-
-    my $dir = get_archives_dir( $list ) . '/' . $year . '/' . $month . '/' . $day;
-    opendir( DIR , $dir );
-    
-    @msg = readdir( DIR );
-   
-    closedir( DIR );
-
-    foreach $file ( @msg )
-    {
-		next if( ( $file eq '.') || ( $file eq '..' ) );
-	
-		if( -f $dir.'/'.$file )
-		{
-		    $hash = Digest::MD5::md5_hex( $file );
-		    $mail = fetch_mail_from_file( $dir.'/'.$file );
-			$header = $mail->get('In-Reply-to');
-			( $header ) = ( ( $header) =~  /<(.+)>/ ) if( defined $header);
-			( $mid ) = ( $mail->get('Message-Id') =~  /<(.+)>/ );
-			if( defined( $header ) )
-			{
-				$mail->{'first'} = 0;
-				$mail->{''} = 1;
-				$mail->{'reference'} = $header;
-			}
-			else
-			{
-				$mail->{'first'} = 1;
-			}
-			$mail->{'treated'} = 0;
-			$mail->{'mid'} = $mid;
-		    $result->{$hash} = $mail if( defined $mail );
-		}
-
-    }
-
-    return( \$result );
-}
-
-sub sort_hash_msg
-{
-	my $init = shift;
-	my $key;
-	my $msg;
-	foreach $key ( %{$init} )
-	{
-		next if( $init->{$key}->{'treated'} == 1 );
-		
-		if( $init->{$key}->{first} == 1 )
-		{
-			$init->{$key}->{treated} = 1;
-			$msg = sort_msg( $init->{$key} );
-		}
-		
-	}
-}
-
-sub fetch_mail_from_file
-{    
-    my @mail;
-    my $passed;
-    my $line;
-    $passed = 0;
-    
-    my $file = shift;
-   
-    return undef if( ! -f $file );
-    
-    open( FILE , $file ) or return undef;
-
-    while( $line = <FILE> )
-    {
-	if( $passed == 0 )
-	{
-	    if( $line =~ /^[a-zA-Z0-9\-]+:\s.+$/ )
-	    {
-		$passed = 1;
-		push( @mail , $line );
-	    }
-	}
-	else
-	{
-	    push( @mail , $line );
-	}
-    }
-
-    my $m = Mail::Internet->new( \@mail );
-
-    close( FILE ) or return undef;
-    return $m;
-}
-
-
-sub get_years
-{    
-    my $list = shift;
-    my $year;
-    my @years;
-    my @result;
-
-    my $dir = get_archives_dir( $list );
-    opendir( DIR , $dir );
-    
-    @years = readdir( DIR );
-   
-    closedir( DIR );
-
-    foreach $year ( @years )
-    {
-	next if( ( ! ( $year =~ /^[0-9]+$/ ) ) || ( ! -d $dir.'/'.$year ) );
-	push( @result , $year );
-    }
-
-    return( \@result );
-    
-}
-
-
-sub get_days
-{
-    
-    my $list = shift;
-    my $year = shift;
-    my $month = shift;
-    my $day;
-    my @days;
-    my @result;
-    
-    return undef if( ! defined ( $year ) );
-    return undef if( ! ( $year =~ /^[0-9]+$/ ) );
-
-    return undef if( ! defined ( $month ) );
-    return undef if( ! ( $month =~ /^[0-9]+$/ ) );
-    
-    my $dir = get_archives_dir( $list ) . '/' . $year . '/' . $month;
-    opendir( DIR , $dir );
-    
-    @days = readdir( DIR );
-   
-    closedir( DIR );
-
-    foreach $day ( @days )
-    {
-	next if( ( ! ( $day =~ /^[0-9]+$/ ) ) || ( ! -d $dir.'/'.$day ) );
-	#next if( ( ! ( $day =~ /^[0-9]+$/ ) )  );
-	push( @result , $day );
-    }
-
-    return( \@result );
-    
-}
-
-
-sub get_months
-{
-    
-    my $list = shift;
-    my $year = shift;
-    my $month;
-    my @months;
-    my @result;
-    
-    return undef if( ! defined ( $year ) );
-    return undef if( ! ( $year =~ /^[0-9]+$/ ) );
-    
-    my $dir = get_archives_dir( $list ) . '/' . $year;
-    opendir( DIR , $dir );
-    
-    @months = readdir( DIR );
-   
-    closedir( DIR );
-
-    foreach $month ( @months )
-    {
-	next if( ( ! ( $month =~ /^[0-9]+$/ ) ) || ( ! -d $dir.'/'.$month ) );
-	push( @result , $month );
-    }
-
-    return( \@result );
-    
-}
-
-
-1;

Deleted: trunk/vhffs-api/src/Vhffs/Listengine/Mail.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Listengine/Mail.pm	2007-09-10 03:31:23 UTC (rev 895)
+++ trunk/vhffs-api/src/Vhffs/Listengine/Mail.pm	2007-09-10 03:38:23 UTC (rev 896)
@@ -1,243 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-
-
-package Vhffs::Listengine::Mail;
-
-#Vhffs::User written by sod` <dieu AT gunnm DOT org>
-
-#blablabla, yeah yeah yeah
-#how to you feel today ? fucking weather today !
-
-use strict;
-
-sub new
-{
-	my $class;
-	my $this;
-
-	$class = shift;
-	
-	$this = {};
-
-	bless( $this , $class );
-
-}
-
-
-sub read_from_stdin
-{
-	my $self = shift;
-	$self->read_from_file( "stdin" );
-}
-
-sub read_from_file
-{
-	my $self		=	shift;
-	my $file		=	shift;
-	my $line;
-
-	#$what = 0 : has not yet read header 
-	#$what = 1 : is reading the header
-	#$what = 2 : is reading body
-	my $what;
-	my $key;
-	my $value;
-
-	$what		=	0;
-
-	if( $file	== "stdin" )
-	{
-		open( FILE , "-");
-	}
-	else
-	{
-		open( FILE , "$file" );
-	}
-
-	while( $line = <FILE> )
-	{
-		if( $what == 0 )
-		{
-			if( $line =~ /^[a-zA-Z0-9\-]+:\s.+$/ )
-			{
-				#We discover a header line, so we read it now
-				$what = 1;
-			}
-		}
-		elsif( $what == 1 )
-		{
-			if(  $line =~ /^\n$/ )
-			{
-				$what = 2;
-			}
-			else
-			{
-				if( $line =~ /^([a-zA-Z0-9\-]+):\s(.+)$/ )
-				{
-					( $key , $value ) = ( $line =~ /^([a-zA-Z0-9\-]+):\s(.+)$/ );
-					$self->{header}->{$key} = $value;
-				}
-				else
-				{
-					$self->{header}->{$key} .= $line;
-				}
-			}
-		}
-		else
-		{
-			$self->{'body'} .=  $line;
-		}
-
-	}
-}
-
-sub send
-{
-	my	$self;
-	my	$server;
-	my	$port;
-	my	$proto;
-	my	$iaddr;
-	my	$port;
-	my	$sin;
-	my	$err;
-	my	$to;
-	my	$domain;
-	my	$from;
-
-
-	$self	=	shift;
-	$server	=	shift;
-	$to		=	shift;
-	$from	=	shift;
-	$domain	=	shift;
-
-	$err	=	'';
-
-	$proto = getprotobyname('tcp' );
-	socket(SOCK, AF_INET, SOCK_STREAM, $proto);
-	$iaddr = gethostbyname( $server );
-	$port = getservbyname('smtp' , 'tcp' );
-	$sin = sockaddr_in( $port , $iaddr );
-	connect( SOCK, $sin );
-	$err = '';
-
-    recv SOCK, $err, 512, 0;
-    send SOCK, "HELO $domain\r\n", 0;
-    recv SOCK, $err, 512, 0;
-    send SOCK, "MAIL FROM: $from\r\n", 0;
-    recv SOCK, $err, 512, 0;
-
-	if( ref( $to ) == 'ARRAY' )
-	{
-    	foreach (@{$to})
-		{
-	  	  	send SOCK, "RCPT TO: $_\r\n", 0; recv SOCK, $err, 512, 0;
-	    }
-	}
-	else
-	{
-	  	  	send SOCK, "RCPT TO: $to\r\n", 0; recv SOCK, $err, 512, 0;
-	}
-    send SOCK, "DATA\n", 0;
-    recv SOCK, $err, 512, 0;
-	send SOCK, ".\r\n", 0;
-    recv SOCK, $err, 512, 0;
-    send SOCK, "QUIT\r\n", 0;
-    recv SOCK, $err, 512, 0;
-    close SOCK;
-
-
-
-
-}
-
-sub set_header
-{
-	my $self;
-	my $key;
-	my $value;
-
-	$self	=	shift;
-	$key	=	shift;
-	$value	=	shift;
-
-	$self->{header}->{$key}		=	$value;
-}
-
-sub get_header
-{
-	my $self;
-	my $key;
-
-	$self	=	shift;
-	$key	=	shift;
-
-	if( defined $self->{header}->{$key} )
-	{
-		return( $self->{header}->{$key} );
-	}
-	else
-	{
-		return undef;
-	}
-
-}
-
-sub get_body
-{
-	my	$self;
-	$self	=	shift;
-	return( $self->{body} );
-}
-
-
-sub to_str
-{
-	my	$self;
-	my	$str;
-
-	$self	=	shift;
-	$str	=	"";
-
-	foreach ( keys %{$self->{header}} )
-	{
-		$str	.=	$_ .": ". $self->{header}->{$_} . "\n";
-	}
-	$str	.=	"\n";
-	$str	.=	$self->{body};
-	return( $str );
-}
-
-1;
-

Modified: trunk/vhffs-api/src/Vhffs/Makefile.am
===================================================================
--- trunk/vhffs-api/src/Vhffs/Makefile.am	2007-09-10 03:31:23 UTC (rev 895)
+++ trunk/vhffs-api/src/Vhffs/Makefile.am	2007-09-10 03:38:23 UTC (rev 896)
@@ -21,8 +21,6 @@
 	Stats.pm \
 	User.pm \
 	Listengine/Intl.pm \
-	Listengine/Listengine.pm \
-	Listengine/Mail.pm \
 	Panel/Admin.pm \
 	Panel/Avatar.pm \
 	Panel/Commons.pm \


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/