About alias for mail server

Discussion in 'HOWTO-Related Questions' started by maykel535, Jan 28, 2010.

  1. maykel535

    maykel535 New Member

    I do this manual that is very good Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 9.10), but I neccesary that the users can access also with name without @domain.com.

    Example:

    This user sales@example.com can access the mail server and the user sales also can access mail server with this account.

    I created the camp in the table users called alias into mysql:

    mysql> select * from users;
    +--------------------+---------------+----------+-----------+
    | email | password | quota | alias |
    +--------------------+---------------+----------+-----------+
    | sales@example.com | XVZZr4jc1Ojzg | 10485760 | |
    | antonio@rucucu.com | kvBtAOYS4HrXw | 10485760| antonio |
    | prueba@prueba.com | B2/jOfnjvNO.s | 10485760 | |
    +--------------------+---------------+----------+-----------+

    I modified this archives:

    file /etc/postfix/mysql-virtual_mailboxes.cf

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

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

    That file for this file, I add "OR alias='%s' in the consult database:

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

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


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





    file /etc/postfix/mysql-virtual_email2email.cf

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


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

    That file for this file, I add "OR alias='%s' in the consult database:

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




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


    That file for this file, I add "OR alias='%s' in the consult database:

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

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

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



    I`m sorry for my english, I need help for this thread. Thanks in advanced.
     

Share This Page