Dear John,
Thanks again, i have sucessfully written a plugin.
i am giving the code for my plugin. I have given
plugin name as "check_valid_auth", please check the
plugin at your end , and if find suitable pls publish
it in Version 0.31 of qpsmtpd as plugin.
also suggest me some improvement in it.
Anil
================================================
# -*- perl -*-
=head1 NAME
check_valid_auth - checks that Auth User and From
E-mail id should be same
=head1 DESCRIPTION
It check the Auth User Name and compare it with From
E-mail ID, if they are same
it allow to send mail other wise E-mail is Rejected.
It is for security
=cut
sub register {
my ($self, $qp) = @_;
$self->register_hook("mail", "mail_handler");
}
sub mail_handler {
my ($self, $transaction, $sender, $session) = @_;
my $host = lc $sender->host;
my $from = lc($sender->user) . '@' . $host;
my $auth_user = $self->qp->{_auth_user};
if($from ne $auth_user)
{
return (DENY, "Hey! You Can't change your From
E-mail ID, Please Use E-mail ID: $auth_user");
}
}
__________________________________________________________
Enjoy this Diwali with Y! India Click here
http://in.promos.yahoo.com/fabmall/index.html