I need help with courier and mysql for mailserver

Discussion in 'HOWTO-Related Questions' started by maykel535, Nov 29, 2010.

  1. maykel535

    maykel535 New Member

    Hi very good I have followed this tutorial http://www.howtoforge.com/virtual-u...x-courier-mysql-and-squirrelmail-ubuntu-10.10
    which incidentally is fucking great. The issue is that need of necessity, that
    authenticate users with [email protected] than I need
    also authenticate itself only with a user name and access
    same mailbox is:

    Username: [email protected]
    Username: zjvK001
    password: secret

    I've added one more column in the users table called user being
    as follows:

    email password user quota
    [email protected] secret zjvK001 1000000

    -------------------------------------------------- --------------------

    To do this, I changed the queries to databases from
    postfix running as follows:

    /etc/postfix/mysql-virtual_mailboxes.cf:

    user = mail_admin
    password = mail_admin_password
    dbname = mail
    query = SELECT CONCAT (SUBSTRING_INDEX (1 ),'/', SUBSTRING_INDEX ,'@',- email (email ,'@', 1 ),'/') FROM users WHERE email = '%s' OR user = '%s'
    hosts = 127.0.0.1


    /etc/postfix/mysql-virtual_email2email.cf:

    user = mail_admin
    password = mail_admin_password
    dbname = mail
    query = SELECT email FROM users WHERE email = '%s' OR user = '%s'
    hosts = 127.0.0.1



    /etc/postfix/mysql-virtual_mailbox_limit_maps.cf:

    user = mail_admin
    password = mail_admin_password
    dbname = mail
    query = SELECT quota FROM users WHERE email = '% s' OR user = '% s'
    hosts = 127.0.0.1


    /etc/postfix/sasl/smtpd.conf:

    pwcheck_method: saslauthd
    mech_list: plain login
    allow_plaintext: true
    auxprop_plugin: mysql
    sql_hostnames: 127.0.0.1
    sql_user: mail_admin
    sql_passwd: mail_admin_password
    sql_database: mail
    sql_select: select password from users WHERE email = '% u' OR user = '% u'

    I imagine it will have to change this:

    /etc/pam.d /smtp:

    pam_mysql.so auth required user = passwd = mail_admin_password mail_admin
    host = 127.0.0.1 db = mail table = users usercolumn passwdcolumn email = password =
    crypt = 1
    Sufficient pam_mysql.so account user = passwd = mail_admin_password mail_admin
    host = 127.0.0.1 db = mail table = users usercolumn passwdcolumn email = password =
    crypt = 1


    Although no how.

    And also have to change this:

    /etc/courier/authmysqlrc:

    Mysql_server localhost
    Mail_admin MYSQL_USERNAME
    Mail_admin_password MYSQL_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 // I think change the line but I don't know
    MYSQL_HOME_FIELD "/ home / vmail"
    MYSQL_MAILDIR_FIELD
    CONCAT (SUBSTRING_INDEX (1 ),'/', SUBSTRING_INDEX ,'@',- email (email ,'@', 1 ),'/')
    # MYSQL_NAME_FIELD // I uncomment this line for MYQL_NAME_FIELD user
    // but is not work either
    MYSQL_QUOTA_FIELD quota

    Do not know how ... I need to be so by necessity, since the domains
    I manage are in a remote server and users can enter
    say your username and the alias, ie:

    Username: [email protected]
    Username: zjvK001
    password: secret

    When I logging, either from webmail or from a mail client
    [email protected] and agree to enter my mailbox, then enter
    zjvK001 and agree to the same mailbox ... Any ideas? Thanks in advance.
     

Share This Page