Brian Szymanski wrote:
> 
> Can you send a copy of your config/plugins and any custom auth/ plugins
> you are using?

Sure. See attached.

> The patch is quite simple, I'd be quite surprised if it turns out to be
> a bug in the code - more likely the patch (me) or your auth plugins made
> some bad assumption. I just tested John's patch, and it works the same
> as my own does on my testbed server. My suspicion is that the problem is
> something about the way you are registering your auth hooks.

It could well be.

> 
> Cheers,
> Brian
> 
> PS - You're going to want to change your password, as you just sent it
> unencrypted (just encoded in Base64) to a list :)

Ooops. Done!

R.
#!/usr/bin/perl -w

use IO::Socket;

sub register {
    my ( $self, $qp ) = @_;

    $self->register_hook( "auth-plain", "auth_vpopmaild" );
    $self->register_hook( "auth-login", "auth_vpopmaild" );

}

sub auth_vpopmaild {
    my ( $self, $transaction, $method, $user, $passClear, $passHash, $ticket )
        = @_;

    # Read these from a config file
    my $vpopmaild_host = 'localhost';
    my $vpopmaild_port = 89;

    # create socket
    my $vpopmaild_socket = IO::Socket::INET->new(PeerAddr => $vpopmaild_host,
                                                 PeerPort => $vpopmaild_port,
                                                 Proto    => "tcp",
                                                 Type     => SOCK_STREAM)
        or return (DECLINED);

    # Get server greeting (+OK)
    my $connect_response = <$vpopmaild_socket>;
    if (! $connect_response =~ /\+OK.*/) {
        return (DECLINED);
    }

    # send login details
    print $vpopmaild_socket "login $user $passClear\n\r";

    # get response from server
    my $login_response = <$vpopmaild_socket>;

    close ($vpopmaild_socket);

    # check for successful login
    if ($login_response =~ /\+OK.*/) {
        return ( OK, "authcheckpassword" );
    } else {
        return (DECLINED);
    }
}
# __ CONNECT ________________________________________
check_earlytalker
count_unrecognized_commands 4
auth/auth_vpopmaild
#auth/auth_vchkpw
#qppoprelay
# tls ssl/smtp.robinbowes.com.cert ssl/smtp.robinbowes.com.key
tls

# __ RCPT FROM ______________________________________
#rhsbl
check_validrcptto_cdb cdb_file config/validrcptto.cdb
#check_localuser
check_badmailfrom
check_badrcptto
check_spamhelo
check_relay
#require_resolvable_fromhost
dnsbl

# __ DATAPOST _______________________________________
#virus/clamav clamscan_path=/usr/bin/clamdscan 
clamd_conf=/etc/clamd.d/qpsmtpd.conf action=reject max_size=1048576
spamassassin reject_threshold 8 spamd_socket /var/run/spamassassin/spamd.socket
#maillog
#virus/klez_filter
queue/qmail-queue

logging/accept_reject

# __ QUIT ___________________________________________
quit_fortune

rcpt_ok

Reply via email to