GPLed
[PerlMail.git] / perlmail-submit
index 8a452ad..b367979 100755 (executable)
@@ -1,12 +1,34 @@
 #! /usr/bin/perl
-#
+# 
 #      $Id$
+# Copyright (C) 2002-2003 Jan Kratochvil <project-PerlMail@jankratochvil.net>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
 
 use vars qw($VERSION);
 $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
 use strict;
 use warnings;
 
+use File::Basename;
+BEGIN {
+       use lib $ENV{"PERLMAIL_BASEDIR"} || File::Basename::dirname($0);
+       use PerlMail::Config;
+       }
+
 use Getopt::Long;
 use DBI;
 use Carp qw(cluck confess);
@@ -16,14 +38,6 @@ use POSIX qw(mktime);
 use Fcntl qw(:flock);
 
 
-my $Lock_pathname="/tmp/PerlMail.lock";
-#my $PeerAddr="dejhome.dyn.jankratochvil.net.:852";
-my $PeerAddr="127.0.0.1:2852";
-my $Socket_timeout=7600;       # 15sec is NOT enough!
-my $DB_table="PerlMail_folder";
-my $DBI_database="short";
-my $DBI_user="short";
-my $DBI_pwd=$ENV{"HOME"}."/priv/mysql.".$DBI_user.".pwd";
 open DBI_PWD,$DBI_pwd or die "open \"$DBI_pwd\": $!";
 $DBI_pwd=<DBI_PWD>;
 close DBI_PWD or warn "close DBI_pwd: $!";