Current time: 11-27-2024, 11:10 AM Hello There, Guest! (LoginRegister)


Thread Closed 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[ERLEDIGT]ispcp-dovecot-mngr
Author Message
Darkside2009 Offline
Junior Member
*

Posts: 80
Joined: Nov 2009
Reputation: 1
Post: #1
[ERLEDIGT]ispcp-dovecot-mngr
wie im Subject zu sehen..... kann mir einer sagen wo ich diese Datei finde ? denn, in /var/www/ispcp/engine ist sie nicht drinne
(This post was last modified: 02-09-2010 10:07 PM by ZooL.)
02-09-2010 08:27 PM
Find all posts by this user
TheCry Away
Member
***

Posts: 851
Joined: Oct 2008
Reputation: 21
Post: #2
RE: ispcp-dovecot-mngr
Wenn Du das Howto richtig gelesen hast, dann wäre Dir dieser Link nicht entgangen:
http://www.isp-control.net/forum/attachm...p?aid=1009

Code:
#!/usr/bin/perl

use FindBin;
use lib "$FindBin::Bin/";
require 'ispcp_common_code.pl';
use strict;
use warnings;
use Sys::Syslog;

my $tempErr = 111;
my $Err = 1;

my $local_part_dir = "$main::cfg{'MTA_VIRTUAL_MAIL_DIR'}";
my $uid = $main::cfg{'MTA_MAILBOX_UID'};
my $gid = $main::cfg{'MTA_MAILBOX_GID'};

my $real_password = '';
my($size, $data) = (undef,undef);
my($username, $password, $timestamp, $rest) = (undef, undef, undef, undef);

my $ip = "unknown ip";
my $server = "unknown";

if (defined $ENV{'TCPREMOTEIP'}){
        $ip = $ENV{'TCPREMOTEIP'};
}
if (defined $ENV{'SERVICE'}){
        $server = $ENV{'SERVICE'};
}

openlog("dovecot","ndelay,perror","mail");

if( open (HANDLER, "<&=3")) {
        $size = read(HANDLER, $data, 512);
        close HANDLER;
} else {
        syslog('err', 'No data read during login for %s from %s to %s server', $username, $ip, $server);
        exit ($tempErr);
}

if ($size < 4) {
        syslog('err', 'Invalid data read during login for %s from %s to %s server', $username, $ip, $server);
        exit($tempErr);
}

($username, $password, $timestamp, $rest) = split(/\0/,$data);

if ($username =~ /^(([a-z0-9\-_]+\.?)+)@(([a-z0-9\-]+\.?)+)$/) {
        $local_part_dir = "$local_part_dir/$3/$1";
} else {
        syslog('info', 'Bad username "%s" from %s to %s server', $username, $ip, $server);
        exit($Err);
}
my $sql = "SELECT mail_pass, mail_addr FROM mail_users WHERE mail_pass != '_no_' AND mail_addr='$username'";
my ($rs, $rows) = doSQL($sql);
if ($rs != 0){
        syslog('err', 'Can`t execute sql %s during login for %s from %s to %s server', $sql, $username, $ip, $server);
        exit($tempErr);
}
my $line = @$rows[0];

($rs,$real_password) = decrypt_db_password(@$line[0]);

if ($rs != 0){
        syslog('err', 'Internal error while decrypting password for username %s from %s for %s server', $username, $ip, $server);
        exit($tempErr);
}

if ($password ne $real_password) {
        syslog('info', 'Bad password for username %s from %s for %s server', $username, $ip, $server);
        exit($Err);
}


if (open (HANDLER, ">>&=4")) {
        printf  (HANDLER  "userdb_user=%s\tuserdb_home=%s\tuserdb_uid=%s\tuserdb_gid=%s\tuserdb_mail=%s\t",
                        $username, $local_part_dir, $uid, $gid, "maildir:$local_part_dir");
        close HANDLER;
} else {
        syslog('err', 'Failed returning data during login for %s from %s to %s server', $username, $ip, $server);
        exit($tempErr);
}

exit(0);
(This post was last modified: 02-09-2010 09:35 PM by TheCry.)
02-09-2010 09:32 PM
Find all posts by this user
Darkside2009 Offline
Junior Member
*

Posts: 80
Joined: Nov 2009
Reputation: 1
Post: #3
RE: ispcp-dovecot-mngr
sorry, habs auch schon gefunden
02-09-2010 09:45 PM
Find all posts by this user
Thread Closed 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)