Mail-SpamCannibal

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

	Changes are to these files ONLY

	deleted public/html/whois.cgi
	Makefile.PL
	public_html/spam_report.cgi.example
		(needs LaBrea::Tarpit::Report v 1.08)
		(found in LaBrea::Tarpit 1.18)

    Makefile.PL
	fixed install for $(SPAMCANNIBAL_HOME)/public_html/tmp
	to remove directory contents after chowning so that
	web daemon does not hang after a re-installation

    spam_report.cgi.example
	corrected variable name 'usr' should be 'url' in 
	public_html/spam_report.cgi

	correct the name of the 'dbtarpit' daemon displayed
	by 'spam_report.cgi'

	eliminate 'whois.cgi' as it does not work with MSIE in

Changes  view on Meta::CPAN


	add report scripts for site statistics

	correct verbose Exceptions reporting for
	mailcheck in ScriptSupport.pm

0.07  Sun Sep  7 19:38:28 PDT 2003
	ScriptSupport 0.05 -- correct flaw in BLpreen check which did not
	remove IP from tarpit when the blacklist host no longer has record.

	sc_initdb.pl	chown environment directory to 
	spamcannibal user,group

	add UtilPid.pm for checking and managing PID files, etc...
	add pid checking to sc_BLcheck.pl and sc_BLpreen.pl
	add LaBreaDaemon.pm to support data collection and display

	add sc_cleanup.pl to remove spurious records
	add pods/recover.pod

	updated cannibal.cgi to unmask html in the evidence record

INSTALL  view on Meta::CPAN

            chmod 640 *
            chmod 644 sc_web.conf

   permission settings for the database environment

    These permissions should be correctly set by the sc_initdb.pl script.
    Should they happen to become altered you can reset them as shown below
    as the root user:

            cd /var/run
            chown -R spam dbtarpit
            chgrp -R spam dbtarpit
            chmod 755 dbtarpit
            cd dbtarpit
            chmod 660 *

  Installing optional LaBrea::Tarpit report statistics pages

    The optional LaBrea::Tarpit statistics pages show the number and IP
    addresses of spam/virus hosts that are currently visiting or have
    recently visited your site.

Makefile.PL  view on Meta::CPAN

	@ln -s $(SPMCNBL_SCRIPT_DIR)/sc_sesswrap $(SPMCNBL_SCRIPT_DIR)/sc_remotewrap
	$(CP) -p config/*.sample $(SPMCNBL_CONFIG_DIR)
	$(CP) -rp public_html $(SPAMCANNIBAL_HOME)
	$(RM_F) $(SPAMCANNIBAL_HOME)/public_html/admin.cgi
	@ln -s $(SPAMCANNIBAL_HOME)/public_html/cannibal.cgi $(SPAMCANNIBAL_HOME)/public_html/admin.cgi
	@$(MKPATH) $(SPAMCANNIBAL_HOME)/sess
	@$(MKPATH) $(SPAMCANNIBAL_HOME)/private
	$(CP) -p private/* $(SPAMCANNIBAL_HOME)/private

install_sc_permissions	:
	chown -R $(SPAMUID) $(SPAMCANNIBAL_HOME)
	chgrp -R $(SPAMGID) $(SPAMCANNIBAL_HOME)
	chmod 0700 $(SPAMCANNIBAL_HOME)/sess
	chmod 0700 $(SPAMCANNIBAL_HOME)/private
	chmod 0600 $(SPAMCANNIBAL_HOME)/private/*
	chmod 0640 $(SPAMCANNIBAL_HOME)/config/*
	chmod 0644 $(SPAMCANNIBAL_HOME)/config/sc_web*
	chmod 0644 $(SPAMCANNIBAL_HOME)/config/sc_Black*
	chmod 04755 $(SPMCNBL_SCRIPT_DIR)/sc_sesswrap
	chmod 01700 $(SPMCNBL_SCRIPT_DIR)/sc_session.pl
	chmod 0700 $(SPMCNBL_SCRIPT_DIR)/sc_remote.pl
	if [ -d $(SPAMCANNIBAL_HOME)/public_html/tmp ]; then \
	    $(RM_F) $(SPAMCANNIBAL_HOME)/public_html/tmp/*; \
	else \
	    $(MKPATH) $(SPAMCANNIBAL_HOME)/public_html/tmp; \
	    chown -R $(SPAMUID) $(SPAMCANNIBAL_HOME)/public_html/tmp; \
	    chgrp -R $(SPAMGID) $(SPAMCANNIBAL_HOME)/public_html/tmp; \
	    chmod 0777 $(SPAMCANNIBAL_HOME)/public_html/tmp; \
	fi
	if [ -d $(SPAMCANNIBAL_HOME)/public_html/flags ]; then \
	    echo "$(SPAMCANNIBAL_HOME)/public_html/flags exists, skipping..."; \
	else \
	    $(MKPATH) $(SPAMCANNIBAL_HOME)/public_html/flags; \
	    chown -R $(SPAMUID) $(SPAMCANNIBAL_HOME)/public_html/flags; \
	    chgrp -R $(SPAMGID) $(SPAMCANNIBAL_HOME)/public_html/flags; \
	    chmod 0777 $(SPAMCANNIBAL_HOME)/public_html/flags; \
	fi

install_daemon	:
	@cd BDBaccess && $(MAKE) install_daemon $(PASTHRU)
	@cd DNSBLserver && $(MAKE) install_daemon $(PASTHRU)

clean_CTest	:
	@cd BDBaccess && $(MAKE) clean_CTest $(PASTHRU)

lib/Mail/SpamCannibal/ScriptSupport.pm  view on Meta::CPAN

# recover the environment
  my $tool = new IPTables::IPv4::DBTarpit::Tools(%local_default);
  $tool->closedb;

# restore permissions
  opendir(ENVF,$default->{dbhome}) || die "could not open DB $default->{dbhome} directory\n";
  my @env = grep(/^__/,readdir(ENVF));
  closedir ENVF;
  foreach(@env) {
    chmod $mode, $default->{dbhome} .'/'. $_;
    chown $uid, $gid, $default->{dbhome} .'/'. $_;
  }

# it's now ok to restart jobs
  unlink $default->{dbhome} .'/blockedBYwatcher';	# remove the job block
}

=item * ($respip,$err,$blrsp,$exp,$zon)=unpack_contrib($record);

Unpack a 'blcontrib' record.

pods/INSTALL.pod  view on Meta::CPAN

	chmod 640 *
	chmod 644 sc_web.conf

=head3 permission settings for the database environment

These permissions should be correctly set by the B<sc_initdb.pl> script. 
Should they happen to become altered you can reset
them as shown below as the root user:

	cd /var/run
	chown -R spam dbtarpit
	chgrp -R spam dbtarpit
	chmod 755 dbtarpit
	cd dbtarpit
	chmod 660 *

=head2 Installing optional LaBrea::Tarpit report statistics pages

The optional LaBrea::Tarpit statistics pages show the number and IP
addresses of spam/virus hosts that are currently visiting or have recently
visited your site. 

pods/quick_install.pod  view on Meta::CPAN

 AddHandler cgi-script .cgi

=head2 X<13>13. Set up the Admin Web Interface

Activate the admin script by renaming it and setting up the password:

 cd /usr/local/spamcannibal/public_html
 cp spam_report.cgi.exmple to spam_report.cgi
 cd ../private
 cp passwd.initial passwd
 chown spam:spam passwd
 chmod 600 passwd

(the passwd file must be owned by the C<spam> user)

Set the admin password (default is blank):

 htpasswd /usr/local/spamcannibal/private/passwd admin

Reload apache, and go to the admin interface at:

scripts/sc_initdb.pl  view on Meta::CPAN

}

my @files = grep(!/^\./,readdir(D));
closedir D;

foreach(0..$#files) {
  $files[$_] = $CONFIG->{SPMCNBL_ENVIRONMENT}.'/'.$files[$_];
}

# set ownership of the files to spamcannibal user, group
chown $uid, $gid, @files;

# set mode of files to 666 based on umask in case some files already exist
my $mask = 0777 ^ $CONFIG->{SPAMCANNIBAL_UMASK};
$mask &= 0666;
chmod $mask, @files;

# set ownership of the environment directory to spamcannibal user, group
chown $uid, $gid, $CONFIG->{SPMCNBL_ENVIRONMENT};

scripts/sc_recoverdb.pl  view on Meta::CPAN

  print STDERR "$dbfile $recno -> $newfile ",$tool->nkeys($newfile),"\n";
}

$tool->closedb;

unless ($VERIFY) {
  $_ = $environment .'/'. $dbfile;
  my($mode,$uid,$gid) = (stat($environment .'/'. $dbfile))[2,4,5];
  $mode &= 0777;
  chmod $mode, $environment .'/'. $newfile;
  chown $uid, $gid, $environment .'/'. $newfile;
  foreach (0..$#evfiles) {
    $evfiles[$_] = $environment .'/'. $evfiles[$_];
  }
  unlink @evfiles;		# delete environment
}



( run in 1.409 second using v1.01-cache-2.11-cpan-5511b514fd6 )