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
  #51  
Old 23rd February 2007, 15:09
porjo porjo is offline
Junior Member
 
Join Date: Nov 2006
Location: Australia
Posts: 15
Thanks: 0
Thanked 2 Times in 1 Post
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
This works for me...however...

On Centos 4.4 , the 0.99 version of Dovecot included doesn't support the 'auth_username_format' option. You need Dovecot v1.0.x

1. remove the old Dovecot 0.99 RPM - 'rpm -e dovecot'
2. Download and install new Dovecot 1.0.x RPM from ATrpm e.g:
"rpm -ivh http://dl.atrpms.net/all/dovecot-1.0-3_47.rc24.el4.at.x86_64.rpm"
Reply With Quote
Sponsored Links
  #52  
Old 11th April 2007, 04:48
TimeJunky TimeJunky is offline
Junior Member
 
Join Date: Dec 2006
Posts: 23
Thanks: 6
Thanked 1 Time in 1 Post
Default

hello,

how to handle this? - Registred to emails with ISPC on different domains but same main-name 'register'

register@server1....de
reigster@server2....de

Now, I am getting this error:

Cannot store record for register - duplicate or out of disk space.
Cannot store record for register - duplicate or out of disk space.
Cannot create /etc/courier/userdbshadow.tmp
Cannot store record for register - duplicate or out of disk space



Script iscp-courier-convertion :
..............................................
#!/bin/bash
# http://www.howtoforge.com/forums/sho...light=mailuser

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
/usr/sbin/makeuserdb
done
IFS=$OIFS
Reply With Quote
  #53  
Old 11th April 2007, 12:51
advinser advinser is offline
Junior Member
 
Join Date: Nov 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I try the solutions of desmondk with the correction of rojozak.

If I run manualy the script (I put it in my /usr/sbin/ folder and I rename it my_email ) it doesn't return errors and it execute.

But if I try to login with user@domain.tld i receive an error from my client.

Can you explain me: I add a new user than I run the script, but the script from where take the user datails?
The file /etc/courier/userdb is always empty (also if I comment the line makeuserdb in the script).

Can you suggest me a debug solutions? I'm not able with linux but I have to understand.

Thank you.

Andrea
Reply With Quote
  #54  
Old 11th April 2007, 14:11
TimeJunky TimeJunky is offline
Junior Member
 
Join Date: Dec 2006
Posts: 23
Thanks: 6
Thanked 1 Time in 1 Post
Default

now, it is running again after small correction

As former told by users like ars, the spaces in
username=$(echo $remain | cut -d " " -f1 )
have to be replaced with a tab. Unfortunatelley, debian was complaining afterwards, so I took the delemiter >"< instead of >' < to get it working.

Code:
#!/bin/bash
# http://www.howtoforge.com/forums/showthread.php?t=7881&highlight=mailuser

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 ) # tab inside
   remain2=$(echo $remain | cut -d "    " -f2 ) # tab inside
   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
   /usr/sbin/makeuserdb
 done
IFS=$OIFS
@Andrea
The script is creating first data with the command /usr/sbin/pw2userdb
Remember, that it takes 5 Minutes to update the dababase and don't forget to initialize new mailboxes with a mail.
Reply With Quote
  #55  
Old 11th April 2007, 14:27
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 TimeJunky
@Andrea
The script is creating first data with the command /usr/sbin/pw2userdb
Remember, that it takes 5 Minutes to update the dababase and don't forget to initialize new mailboxes with a mail.
Ok, but I can login with the domain.tld_user but not with user@domain.tld

How to verify the correct iter of the script?

If the script work, how can I understand?

Thx!!!
Reply With Quote
  #56  
Old 11th April 2007, 14:44
TimeJunky TimeJunky is offline
Junior Member
 
Join Date: Dec 2006
Posts: 23
Thanks: 6
Thanked 1 Time in 1 Post
Default

where do you try to log in?

https://my-xy-domain...de:81/webmail
https://my-xy-domain...de:81/squirrelmail

... are the access points to try out. Login -> success -> script works

I never checked login with email-clients and the user name test@dom...de (if you mean that)
Reply With Quote
  #57  
Old 11th April 2007, 14:54
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 TimeJunky
where do you try to log in?

https://my-xy-domain...de:81/webmail
https://my-xy-domain...de:81/squirrelmail

... are the access points to try out. Login -> success -> script works

I never checked login with email-clients and the user name test@dom...de (if you mean that)
But the system is to login using a mail client (thunderbird, outlook, etc) using user@domain.tld

But the script create a particular line in one file or not?

I don't understand.
Reply With Quote
  #58  
Old 11th April 2007, 22:59
TimeJunky TimeJunky is offline
Junior Member
 
Join Date: Dec 2006
Posts: 23
Thanks: 6
Thanked 1 Time in 1 Post
Default

access with clients are not a problem.
user: domain_user
pw: yours
Reply With Quote
  #59  
Old 11th April 2007, 23:29
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 TimeJunky
access with clients are not a problem.
user: domain_user
pw: yours
I think you don't understand my problem: I want access with my email client to the mail not usign the domain.tld_user + pwd but using user@domain.tld + pwd like other system (ensim, plesk, etc.)

The method in this post is not for this problem???
Reply With Quote
  #60  
Old 12th April 2007, 02:02
rojozak rojozak is offline
Junior Member
 
Join Date: Oct 2006
Posts: 14
Thanks: 0
Thanked 2 Times in 1 Post
 
Default Check paths and Use courierauthtest command

advinser,

If your userdb file is empty, something is not right. check your paths on your system against the paths in the script. the paths that i used were based on my install which was the Ubuntu 6.06 Perfect Setup. In other words, your setup may vary.

Also, are you absolutely certain you replaced spaces with tabs when copying/pasting the script from this website?

Once you confirm that you have users in the userdb file, the script should have created the userdb.db file. Then you can confirm that the userdb file is formated correctly by using:

Code:
courierauthtest user@domain.tld
If it worked, it will give you userid and other info. If it fails, it will tell you that authentication failed.

Finally, you can use the same test with the password:

Code:
courierauthtest user@domain.tld password
and again check for pass/fail. If it passes here, you are good to go.

Finally, (remember, it won't work until you've gotten as far as above. But then there are only certain applications that you can use this method in. (ie those that use courier for authentication). It will not work as a login for ISPConfig.

Good Luck.
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 17:43.


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