#!/usr/bin/perl
#
# PERL module for connecting to ZMailer scheduler's MAILQ port
#

use ZMailer::mailq;

use Getopt::Std;

%opts = {};
$Q = undef;

getopt('Q:',\%opts);
if ($opts{'Q'}) {
    $Q = $opts{'Q'};
}

local($s);

$s = & ZMailer::mailq::new('vger.kernel.org','174');

$s->setdebug(1);
 
#if (!defined $s) {
#    printf("ZMailer::mailq::new() yielded UNDEF\n");
#} else {
#    printf("ZMailer::mailq::new() yielded connection, salt='%s'\n", $s->{salt});
#}

$s->login("nobody","nobody");

#printf("login responce: '%s'\n",$s->{resp});


if (0) {
    local($rc,@rc) = $s->showcmd("SHOW QUEUE THREADS");
    printf "SHOW QUEUE THREADS:\n%s\n",join("\n",@rc);
} else {
    local($rc,@rc) = $s->showcmd("SHOW THREAD smtp prolixium.com");
    printf "%s\n",join("\n",@rc);
}

#local($rc,@rc) = $s->showcmd("SHOW SNMP");
#printf "SHOW SNMP:\n%s\n",join("\n",@rc);

#local($rc,@rc) = $s->etrncmd("ETRN mea.tmt.tele.fi");
#printf "ETRN mea.tmt.tele.fi:\n%s\n",join("\n",@rc);

$s->bye();

exit 0;

1;
