How can I setup postfix to read unencrypted passwords from the database?

Discussion in 'Server Operation' started by voltron81, Jan 11, 2010.

  1. voltron81

    voltron81 New Member

  2. voltron81

    voltron81 New Member

    nothing?
    :confused:
     
  3. falko

    falko Super Moderator Howtoforge Staff

    I haven't tried this yet.
     
  4. voltron81

    voltron81 New Member

    Hi Falko,
    Thanks for your reply.

    I really can not understand what I've to change in postfix to do it...

    I've a database with emails and passwords, but I can not encrypt passwords because I use that passwords also to fetch emails...
    So if I don't find the way to solve this problem, I've to save the password twice, one encrypted and one no...

    :cool:
     
  5. topdog

    topdog Active Member

    This is pretty easy, you can use unencrypted passwords. just set crypt=0 in your pam configurations. for more info read the pam_mysql man page.
     
  6. voltron81

    voltron81 New Member

    Thanks topdog for your reply.

    Basically in /etc/pam.d/pop3 I've this:
    Code:
    # PAM configuration file for Courier POP3 daemon
    
    #@include common-auth
    #@include common-account
    #@include common-password
    #@include common-session
    
    and in common-password:
    Code:
    password   required   pam_unix.so nullok obscure md5
    
    I tried to just cancel the md5 from common-password, but it's look like not working...

    What should I modify?

    Thanks

    Michele
     
  7. topdog

    topdog Active Member

    If you followed that howto, then you need to change /etc/pam.d/smtp and /etc/courier/authmysqlrc

    /etc/pam.d/smtp

    Code:
    auth    required   pam_mysql.so user=mail_admin passwd=mail_admin_password host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=0
    account sufficient pam_mysql.so user=mail_admin passwd=mail_admin_password host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=0
    /etc/courier/authmysqlrc

    Code:
    MYSQL_SERVER localhost
    MYSQL_USERNAME mail_admin
    MYSQL_PASSWORD mail_admin_password
    MYSQL_PORT 0
    MYSQL_DATABASE mail
    MYSQL_USER_TABLE users
    #MYSQL_CRYPT_PWFIELD password
    MYSQL_CLEAR_PWFIELD password
    MYSQL_UID_FIELD 5000
    MYSQL_GID_FIELD 5000
    MYSQL_LOGIN_FIELD email
    MYSQL_HOME_FIELD "/home/vmail"
    MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
    #MYSQL_NAME_FIELD
    MYSQL_QUOTA_FIELD quota
    http://www.howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-debian-lenny-p2
     
  8. voltron81

    voltron81 New Member

    Perfect!!!

    Thanks a lot

    Michele
     

Share This Page