Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #61  
Old 12th April 2007, 11:22
advinser advinser is offline
Junior Member
 
Join Date: Nov 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by rojozak
Also, are you absolutely certain you replaced spaces with tabs when copying/pasting the script from this website?
Yes, thath's all right

Quote:
Originally Posted by rojozak
Once you confirm that you have users in the userdb file, the script should have created the userdb.db file.
I had an error in the script: now I write /etc/courier/userdb at the end of the line and it create finally the file (I have ubuntu 6.06 like you so the file is in the same place) but I've not the file userdb.db...

Quote:
Originally Posted by rojozak
Then you can confirm that the userdb file is formated correctly by using:

Code:
courierauthtest user@domain.tld
Now the new problem: the test return "Authentication Failed!"

Why?

Thx for all!
Reply With Quote
Sponsored Links
  #62  
Old 12th April 2007, 14:29
rojozak rojozak is offline
Junior Member
 
Join Date: Oct 2006
Posts: 14
Thanks: 0
Thanked 2 Times in 1 Post
Default

Look in /etc/courier/ for userdb.db, It should be in there.

Either way, check the final part of your script. It must have the make command to make the userdb.db file from userdb.

Code:
/usr/lib/courier/makeuserdb
Also, if you can't get that part working in your script, you can run makeuserdb from the commandline, to be sure you can create that userdb.db
Reply With Quote
  #63  
Old 12th April 2007, 14:58
advinser advinser is offline
Junior Member
 
Join Date: Nov 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have only userdb userdb.dat userdb.lock

Into the makeuserdb there is no line for creating userdb.db but only this 3 files.

Why?
Reply With Quote
  #64  
Old 2nd June 2007, 18:29
kassie kassie is offline
Senior Member
 
Join Date: May 2007
Location: Johannesburg, South Africa
Posts: 136
Thanks: 13
Thanked 0 Times in 0 Posts
Default

Hi All,

I have ubuntu 7.04 perfect install + ISPConfig 2.2.13.

I would like to apply this patch. Will it work?

Is there anybody that can take me through it step by step?? I am very new to linux. I see there is code in the post but i don't know what to do with this code....

Please help!!!!!
Reply With Quote
  #65  
Old 4th June 2007, 23:41
soho soho is offline
Member
 
Join Date: Jun 2007
Posts: 68
Thanks: 17
Thanked 3 Times in 3 Posts
Default

Quote:
Originally Posted by cotthemh
you can do this very easily with dovecot :

change ispconfig so that it prefixes with [DOMAIN]_

then change the line in the /etc/dovecot.conf file

auth_username_format="%Ld_%Ln"

next of course make sure all you're userid's are lowercase (otherwise just juse ="%Ld_%n") but the first solution avoids any typos in the login.

the nice thing is that squirrelmail works like a breeze,

have fun


In the case of multiples domain as to configure the DOMAIN in the ISPConfig?
__________________
Sergio Souza
SoHo - Small Office Service Office

If anything can go wrong, will, and will give wrong in the worst way, in the worst moment and in order to cause the most damage possible. (Murphy's Law)
Reply With Quote
  #66  
Old 5th June 2007, 10:09
kassie kassie is offline
Senior Member
 
Join Date: May 2007
Location: Johannesburg, South Africa
Posts: 136
Thanks: 13
Thanked 0 Times in 0 Posts
Default

Running this script now, It doesn't put any data to /etc/courier/userdb. No details in this file, means i have to access mail via domain_user.

Please help again

Here are my files
/usr/sbin/usernames
#!/bin/bash

delim="_"

OIFS=$IFS
IFS="
"
rm -rf /etc/courier/userdb
touch /etc/courier/userdb
chmod 600 /etc/courier/userdb

for line in `/usr/sbin/pw2userdb | grep -ir user`
do
full=$( echo $line )
domain=$( echo $line | cut -d"$delim" -f1 )
remain=$( echo $line | cut -d"$delim" -f2,3,4 )
username=$( echo $remain | cut -d' ' -f1 )
remain2=$( echo $remain | cut -d' ' -f2 )
uid=$( echo $remain2 | cut -d'|' -f1 )
gid=$( echo $remain2 | cut -d'|' -f2 )
home=$( echo $remain2 | cut -d'|' -f3 )
shell=$( echo $remain2 | cut -d'|' -f4 )
password=$( echo $remain2 | cut -d'|' -f5)
echo "$username@$domain $uid|$gid|$home|$shell|$password|/var/www/www.$domain/user/${domain}_$username/Maildir" >> /etc/courier/userdb
done
/usr/sbin/makeuserdb

IFS=$OIFS


/usr/sbin/pw2userdb

#! /usr/bin/perl
#
# Convert /etc/passwd and /etc/shadow to userdb format.
#
# $Id: pw2userdb.in,v 1.5 2000/07/19 11:55:15 mrsam Exp $
#
# Copyright 1998 - 1999 Double Precision, Inc. See COPYING for
# distribution information.

use Getopt::Long;

#
# Some undocumented options here (for vchkpw2userdb)
#

die "Invalid options.\n" unless
GetOptions("passwd=s" => \$passwd, "shadow=s" => \$shadow,
"noshadow" => \$noshadow, "nouid" => \$nouid,
"domain=s" => \$domain, "vpopuid" => \$vpopuid );

($dummy, $dummy, $fixed_uid, $fixed_gid)=getpwnam("vpopmail")
if $vpopuid;

$passwd="/etc/passwd" unless $passwd =~ /./;
$shadow="/etc/shadow" unless $shadow =~ /./;

$domain="" unless $domain =~ /./;
$domain="\@$domain" if $domain =~ /./;

open(PASSWD, $passwd) || die "$!\n";

while (<PASSWD>)
{
chop if /\n$/;
next if /^#/;
($acct,$passwd,$uid,$gid,$name,$home,$shell)=split ( /:/ );

($uid,$gid)=($fixed_uid,$fixed_gid) if $vpopuid;

$PASSWORD{$acct}=$passwd if $passwd ne "x";
$UID{$acct}=$uid;
$GID{$acct}=$gid;
$HOME{$acct}=$home;
$SHELL{$acct}=$shell;

$name =~ s/\|/./g; # Just in case
$GECOS{$acct}=$name;
}
close (PASSWD);

if ( -f $shadow && ! $noshadow)
{
open (SHADOW, $shadow) || die "$!\n";
while (<SHADOW>)
{
next if /^#/;
($acct,$passwd,$dummy)=split(/:/);
$PASSWORD{$acct}=$passwd;
}
close (SHADOW);
}

while ( defined ($key=each %UID))
{
print "$key$domain\tuid=$UID{$key}|gid=$GID{$key}|ho me=$ HOME{$key}" .
( $SHELL{$key} =~ /./ ? "|shell=$SHELL{$key}":"") .
( $PASSWORD{$key} =~ /./ ? "|systempw=$PASSWORD{$key}":"") .
( $GECOS{$key} =~ /./ ? "|gecos=$GECOS{$key}":"") .
"\n";
print "$UID{$key}=\t$key\n" unless $nouid;
}
Reply With Quote
  #67  
Old 25th September 2007, 21:21
erebus erebus is offline
Member
 
Join Date: Sep 2007
Posts: 63
Thanks: 10
Thanked 9 Times in 9 Posts
Default

Hello,

I have a "perfect setup" with Centos 4.5 and the latest stable ISPConfig.

I have upgraded my dovecot to 1.0x so as to be able to use

auth_username_format = %Ld_%Ln

I have also set the [DOMAIN]_ in ISPConfig settings. However when I try to login from Uebimiau, I get the following error:

Sep 25 22:15:48 nemesis dovecot: pop3-login: Disconnected: user=<_domain.gr_info>, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured

(assume that the username I enter in the webmail is info@domain.gr).

I suppose that the problem is the leading _, however I don't know how it appears there...

Any help?

P.S. If I comment out the auth_username_format line, everything works fine.
Reply With Quote
  #68  
Old 27th September 2007, 21:37
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,083
Thanks: 826
Thanked 5,396 Times in 4,240 Posts
Default

If I remeber correctly, the uebimiau package tries to lookup the email address in the database and this fails when you modify the login format. This can not be switched of in the ISPConfig UbeiMiau package, the easiest solution might be to install another webmail program which is not modified to lookup usernames in the ISPConfig database.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
erebus (28th September 2007)
  #69  
Old 29th September 2007, 11:59
Acker Acker is offline
Junior Member
 
Join Date: Sep 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi!

I think i've managed to get the script for converting the users working. So my userdb file contains this row:

test@server.com uid=10015|gid=10005|home=/var/www/web5/user/server.com_test|shell=/bin/false|systempw=gdfGefd4YUcGFg|/var/www/www.server.com/user/server.com_test/Maildir

But courierauthtest test@server.com password brings:
Trying authdaemon...
Authentication FAILED!

Any ideas?
Thx,
acker
Reply With Quote
  #70  
Old 3rd October 2007, 17:42
Melchior Melchior is offline
Junior Member
 
Join Date: Jul 2007
Location: Germany, Darmstadt
Posts: 25
Thanks: 5
Thanked 1 Time in 1 Post
 
Unhappy

Hello,

I can't get the patch to work
I think the problem is in the converter-script that creates the userdb for courier.

I little modified the script to get debug messages:

Code:
#!/bin/bash
delim="_"

OIFS=$IFS
IFS="
"
rm -rf /etc/courier/userdb
touch /etc/courier/userdb
chmod 600 /etc/courier/userdb
for line in `pw2userdb | grep -ir user`
do
	clear
	echo $line

	domain=$( echo $line | cut -d"$delim" -f1 )
	
	useruid=$( echo $line | cut -d"$delim" -f2 )
	
	username=$( echo $useruid | cut -d'	' -f1 )
	
	uid=$( echo $useruid | cut -d'	' -f2 )
	gid=$( echo $line | cut -d"$delim" -f3 )
	home=$( echo $line | cut -d"$delim" -f4 )
	shell=$( echo $line | cut -d"$delim" -f6 )
	password=$( echo $line | cut -d"$delim" -f7)
	
	#echo "$username@$domain $uid|$gid|${home}_$username|$shell|$password| /var/www/www.$domain/user/${domain}_$username/Maildir" >> /etc/courier/userdb
	
	echo "
	useruid: $useruid|
	
	domain: $domain 
	username: $username
	login: $username@$domain
	
	uid: $uid|
	gid: $gid|
	home: $home
	homedir: ${home}_$username|
	shell: $shell| 
	pass: $password|
	maildir /var/www/www.$domain/user/${domain}_$username/Maildir"
	#/usr/sbin/makeuserdb
done

IFS=$OIFS
And if I run the script with this single return of pw2userdb ...

XXX.org_mar uid=10018|gid=10002|home=/var/www/web2/user/XXX.org_mar|shell=/bin/false|systempw=^iaesnI7fcz/.|gecos=mar

... I got this output.

Code:
XXX.org_mar      uid=10018|gid=10002|home=/var/www/web2/user/XXX.org_mar|shell=/bin/false|systempw=^iaesnI7fcz/.|gecos=mar


        useruid: mar uid=10018|gid=10002|home=/var/www/web2/user/XX.org|

        domain: XX.org 
        username: mar
        login: mar@XX.org

        uid: uid=10018|gid=10002|home=/var/www/web2/user/XX.org|
        gid: mar|shell=/bin/false|systempw=^iaesnI7fcz/.|gecos=mar|
        home: 
        homedir: _mar|
        shell: | 
        pass: |
        maildir /var/www/www.XX.org/user/XX.org_mar/Maildir
Anybody an idea whats going wrong?
Courier-Auth is opening the userdb, but can't find a valid login. I think the email-account was written down by wrong-syntax.

I'am using ISPConfig 2.2.17 with Debian 4.0

greetings!
melchior

Last edited by Melchior; 3rd October 2007 at 17:45.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot send email from OE through ISPconfig site tomd General 10 12th March 2009 06:05
SP-Server Setup - Ubuntu 5.10 "Breezy Badger" - Page 6 (changes) LuisC-SM HOWTO-Related Questions 0 21st April 2006 15:16
ISPConfig 2.2.0 problem with email addresses DataJet General 1 29th March 2006 13:29
Debian Sarge, ISPConfig, perfect setup followed, email can't login! Zoon Installation/Configuration 3 12th February 2006 20:58
ISP-Ubuntu breezy ispconfig dns email e-mail working finally yellowjelly HOWTO-Related Questions 0 19th November 2005 20:30


All times are GMT +2. The time now is 18:39.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.