From 4d1d649240141b8f0949ab568f6c912cc792cd90 Mon Sep 17 00:00:00 2001 From: SJ Date: Thu, 7 May 2015 11:04:26 +0200 Subject: [PATCH] improved the milter script --- contrib/milter/pilter.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/contrib/milter/pilter.pl b/contrib/milter/pilter.pl index d81b8dc4..4e3b3ae0 100755 --- a/contrib/milter/pilter.pl +++ b/contrib/milter/pilter.pl @@ -8,6 +8,7 @@ use Data::Dumper; use Sys::Syslog; use Sys::Syslog qw(:DEFAULT setlogsock); use Time::HiRes qw(gettimeofday); +use Getopt::Long; my $savedir = "/var/piler/imap"; my $username = 'piler'; @@ -22,7 +23,17 @@ my $curdir = "cur"; my $newname; my $curname; my $messageid; +my $help = 0; +my $opts = GetOptions( + "conn=s" => \$conn, + "username=s" => \$username, + "savedir=s" => \$savedir, + "h" => \$help, + "help" => \$help + ); + +if($help == 1) { die("usage: $0 --conn inet:33333\@127.0.0.1 --username piler --savedir /var/piler/imap"); } chdir $savedir || die("cannot chdir to $savedir");