2014-09-11 17:13:32 +02:00
|
|
|
#!perl
|
2014-09-10 01:09:31 +02:00
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
sub hook_user_config {
|
|
|
|
my ($self,$txn,$user,$conf) = @_;
|
|
|
|
my $username = $user->host or return DECLINED;
|
|
|
|
my $filename = "/home/$username/.qpsmtpd/$conf";
|
|
|
|
return DECLINED unless -f $filename;
|
|
|
|
my $fh;
|
|
|
|
unless (open $fh,$filename) {
|
|
|
|
$self->log(LOGNOTICE,"Couldn't open $filename:$!");
|
|
|
|
return DECLINED;
|
|
|
|
}
|
|
|
|
map {chomp} (my @return = (<$fh>));
|
|
|
|
return OK,@return;
|
|
|
|
}
|