aboutsummaryrefslogtreecommitdiffstats
path: root/rspamc.pl.in
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-09-08 20:13:29 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-09-08 20:13:29 +0400
commitc6d4570aa00c93e6d142aaa8cd38a3c9ee29eb8f (patch)
tree51fd7b69c3cee4817daca44c15ea2576f3e37d68 /rspamc.pl.in
parent9af09b7467a4b9b7b2c9fbf1390b481e71bb07c6 (diff)
downloadrspamd-c6d4570aa00c93e6d142aaa8cd38a3c9ee29eb8f.tar.gz
rspamd-c6d4570aa00c93e6d142aaa8cd38a3c9ee29eb8f.zip
* Make settings working
Diffstat (limited to 'rspamc.pl.in')
-rwxr-xr-xrspamc.pl.in14
1 files changed, 11 insertions, 3 deletions
diff --git a/rspamc.pl.in b/rspamc.pl.in
index af2ea7a7e..7e435bf36 100755
--- a/rspamc.pl.in
+++ b/rspamc.pl.in
@@ -19,18 +19,20 @@ my %cfg = (
'password' => '',
'control' => 0,
'statfile' => '',
+ 'deliver_to'=> '',
);
$main::VERSION = '@RSPAMD_VERSION@';
sub HELP_MESSAGE {
print <<EOD;
-Usage: rspamc.pl [-h host] [-p port] [-P password] [-c conf_file] [-s statfile] [command]
+Usage: rspamc.pl [-h host] [-p port] [-P password] [-c conf_file] [-s statfile] [-d user\@domain] [command]
-h host to connect or unix socket path
-p port to connect (not used with unix sockets)
--P ask for control password
+-P define control password
-c config file to parse
-s statfile to use for learn commands
+-d define deliver-to header
Version: @RSPAMD_VERSION@
EOD
};
@@ -119,6 +121,9 @@ sub do_rspamc_command {
print "Sending ". length ($input) ." bytes...\n";
syswrite $sock, "$cfg{'command'} RSPAMC/1.0 $CRLF";
+ if ($cfg{'deliver_to'}) {
+ syswrite $sock, "Deliver-To: " . $cfg{'deliver_to'} . $CRLF;
+ }
syswrite $sock, "Content-Length: " . length ($input) . $CRLF . $CRLF;
syswrite $sock, $input;
syswrite $sock, $CRLF;
@@ -222,7 +227,7 @@ sub do_control_command {
}
my %args;
-getopt('c:h:p:P:s:', \%args);
+getopt('c:h:p:P:s:d:', \%args);
my $cmd = shift;
my $do_parse_config = 1;
@@ -262,6 +267,9 @@ if (defined ($args{p})) {
if (defined ($args{P})) {
$cfg{'password'} = $args{P};
}
+if (defined ($args{d})) {
+ $cfg{'deliver_to'} = $args{d};
+}
if ($cmd =~ /(SYMBOLS|SCAN|PROCESS|CHECK|REPORT_IFSPAM|REPORT|URLS|EMAILS)/i) {
$cfg{'command'} = $1;