#--- Code snippet as an example of a username-plugin that could be
#--- called during authentication if $auth_type = 6 in mpopd.conf
#--- The username supplied by the client is placed in $uid
#--- The only restriction is that it must return 0 for success and
#--- 2 for failure.

open SHADOW, $shadow || &TimeIsUp("Could not open $shadow $CRLF");
unless (flock SHADOW, 2) {
	&TimeIsUp("Could not lock $shadow $CRLF");
}
while (<SHADOW>) {
	if (/^$uid:(.+?):/) {
		$crypt_password = $1;
		$user_id = getpwnam $uid;
		last;
	}
}
close SHADOW;
flock SHADOW, 8;
if (defined($crypt_password)) {
	print "+OK $uid send me your password....$CRLF";
	&LogUser;
	&Debug("$command  $arg  $arg1\n+OK $uid send me your password....");
	return 0;
}
else {
	return 2;
}
