View Single Post
  #27  
Old 1st January 2007, 12:26
ciprianz ciprianz is offline
Junior Member
 
Join Date: Dec 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I haven't been succesuful to use user@domain.tld aplying any of the ideea found in the forum.
I would like to use the authentification method provided in Tutorial: ISP-style Email Service with Debian-Sarge and Postfix 2.1
I was interested in special on
Step 8: Configure the POP3 / IMAP service
that will allow authentification based on information found in a table
as you may see in tutorial we need the following information
MYSQL_SERVER localhost
MYSQL_USERNAME provider_admin
MYSQL_PASSWORD ...
MYSQL_PORT 0
MYSQL_DATABASE provider
MYSQL_USER_TABLE users
#MYSQL_CRYPT_PWFIELD (comment this out)
MYSQL_CLEAR_PWFIELD password
MYSQL_UID_FIELD 5000
MYSQL_GID_FIELD 5000
MYSQL_LOGIN_FIELD email
MYSQL_HOME_FIELD "/home/vmail"
#MYSQL_NAME_FIELD (comment this out)
MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')

some of the fields are missing in our isp_isp_user table
MYSQL_CLEAR_PWFIELD, MYSQL_UID_FIELD, MYSQL_GID_FIELD, MYSQL_LOGIN_FIELD, MYSQL_HOME_FIELD, MYSQL_MAILDIR_FIELD

for quick testing I added the fields missing above like this:

1. Go to ISP Config -> Management - > Form designer -> Edit form
2. Search for isp - ISP User: [Edit] [Delete]
3. Click on [Edit]
4. Choose from Add dropdown menu: Short Textfield and press OK
5. complete the field according to your needs
example: to add a field that will contain username
write to
Fieldname: username
Title: Username (courier) (or whatever you want to see when you add new user, I choosed like that because I wanted to know that it is the field added by me for courier-authmysql method
all the other fields are optional

I created the following fields with the method described above:
password, gid, username,usermaildir
these fields will be used with
MYSQL_CLEAR_PWFIELD, MYSQL_UID_FIELD, MYSQL_GID_FIELD, MYSQL_LOGIN_FIELD, MYSQL_MAILDIR_FIELD


Fields explained:
MYSQL_SERVER, MYSQL_USERNAME, MYSQL_PASSWORD -these are easy: i modified only the MYSQL_USERNAME and MYSQL_PASSWORD, use your own user and password to connect to your mysql server.
MYSQL_PORT 0 i didnt' modified anything
MYSQL_DATABASE is the database that contains your ispconfig tables, you specified this database when you have installed your ispconfig, in my case was ispconfig
MYSQL_USER_TABLE in our case that table should be isp_isp_user
MYSQL_CLEAR_PWFIELD is the field that contains the user password, altough in isp_isp_user exists user_passwort that fields gets empty for security reason. so you have to create another one: userpassword that should contain the user password
MYSQL_UID_FIELD -this field could be generated from the isp_isp_user, there is doc_id field that contains the user id in the table but what we need is the user id used in linux, the linux userid is build like this: userid+doc_id where userid it is set in ispconfig under management -> server -> settings -> Other -> "Userid from" . The default value for "Userid from" is 10000 so we could build MYSQL_UID_FIELD like this 10000+doc_id
MYSQL_GID_FIELD - this is a little bit harder to build from what I see the group id is the same for all user from a Site. so MYSQL_GID_FIELD should be something like this 10000+[WEBID]
MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD "/var/www/"
MYSQL_MAILDIR_FIELD usermaildir

I will continue later, all I said until now was theory, I didn't test it yet.
__________________
I don't know english very well.
I'm from Romania and I'm sorry if I write in english so bad.

Last edited by ciprianz; 1st January 2007 at 12:29.
Reply With Quote