I hope this is the appropriate form for this as I am trying to write a script that obtains a Kerberos ticket for my pop server. I am getting a Kerberos error from 'get_in_tkt_with_password'. The error is "No credentials cache found." My kdc log only shows 'badlogin'. My script is below. Can someone spot the error or at least point me to a more appropriate form? Thanks.

#!/usr/bin/perl -w
#
# Script that reads mail from the POP server to attach it to a case in
# aimaudit via web services to the imaging system.

use strict;
use Net::POP3;
use Authen::Krb5;

my $USERNAME="myusername";
my $PASSWORD="mypassword";
my $SERVICE="pop";
my $SERVER="popserver.mydomain.com";

my $ac=Authen::Krb5::init_context();
defined $ac or die "Fatal: Unable to establish Kerberos context\n";

my $clientp=Authen::Krb5::parse_name($USERNAME);
my $serverp=Authen::Krb5::sname_to_principal($SERVER, $SERVICE,KRB5_NT_SRV_HST);
my $cc=Authen::Krb5::cc_default();

if (Authen::Krb5::get_in_tkt_with_password($clientp,$serverp, $PASSWORD,$cc)) {
        print "Success!!!\n";
        my $sasl=new Authen::SASL(mechanism=> "GSSAPI SASL");
        my $pop=Net::POP3->new($SERVER)
                or die "Unable to connect to mail server: ",$!,"\n";
        if ($pop->auth($sasl) > 0) {
                my $messages=$pop->list()
                        or die "Unable to get messages: ",$!,"\n";
        }
        else {
                print "Authentication failed: ",$!,"\n";
        }
}
else {
        print "Unable to get Kerberos ticket: ",Authen::Krb5::error(),"\n";
}

Authen::Krb5::free_context();


Dennis Putnam
Sr. IT Systems Administrator
AIM Systems, Inc.
11675 Rainwater Dr., Suite 200
Alpharetta, GA  30004
Phone: 678-240-4112
Main Phone: 678-297-0700
FAX: 678-297-2666 or 770-576-1000
The information contained in this e-mail and any attachments is strictly confidential. If you are not the intended recipient, any use, dissemination, distribution, or duplication of any part of this e-mail or any attachment is prohibited. If you are not the intended recipient, please notify the sender by return e-mail and delete all copies, including the attachments.


Reply via email to