Virtual users... Ubuntu 8.04

Discussion in 'HOWTO-Related Questions' started by spaceuser, May 31, 2008.

  1. spaceuser

    spaceuser New Member

    I'm running Ubuntu Server 8.04 as guest OS on VMWare server and installed the mailserver, Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 8.04 LTS). On page 4, it says
    When I do the same, I receive only this:

    root@mailserver:~# telnet localhost 25
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    220 mailserver.vas.net ESMTP Postfix (Ubuntu)
    ehlo localhost
    250-mailserver.vas.net
    250-PIPELINING
    250-SIZE 10240000
    250-VRFY
    250-ETRN
    250-STARTTLS
    250-AUTH PLAIN LOGIN
    250-AUTH=PLAIN LOGIN
    250-ENHANCEDSTATUSCODES
    250-8BITMIME
    250 DSN
    quit
    221 2.0.0 Bye
    Connection closed by foreign host.
    root@mailserver:~#

    Therefore I wonder why the 250-STARTTLS and 250-AUTH LOGIN PLAIN wont show up.

    I would appreciate any comment on this.

    TIA
     
  2. thecaoticone

    thecaoticone New Member

    From what you posted everything is there.

     
  3. spaceuser

    spaceuser New Member

    Uh... silly me!! Seem to need new glasses obviously :D

    Thanx
     
  4. spaceuser

    spaceuser New Member

    Since I've received a lot of the same errors that more folks around here, I did check them first to see if they would solve my problem, but they didn't.

    When I tried to login using Squirrelmail I receive this in the /var/log/mail.err file:

    Jun 1 20:35:01 mailserver imapd: authentication error: Input/output error
    Jun 1 20:35:39 mailserver postfix/trivial-rewrite[11518]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:35:39 mailserver postfix/trivial-rewrite[11519]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:36:40 mailserver postfix/trivial-rewrite[11520]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:36:40 mailserver postfix/trivial-rewrite[11521]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:37:41 mailserver postfix/trivial-rewrite[11522]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:37:41 mailserver postfix/trivial-rewrite[11523]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:38:42 mailserver postfix/trivial-rewrite[11524]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:38:42 mailserver postfix/trivial-rewrite[11525]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:39:43 mailserver postfix/trivial-rewrite[11537]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:39:43 mailserver postfix/trivial-rewrite[11538]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:40:44 mailserver postfix/trivial-rewrite[11539]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:40:44 mailserver postfix/trivial-rewrite[11540]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:41:45 mailserver postfix/trivial-rewrite[11543]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:41:45 mailserver postfix/trivial-rewrite[11544]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:42:46 mailserver postfix/trivial-rewrite[11548]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:42:46 mailserver postfix/trivial-rewrite[11549]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:43:47 mailserver postfix/trivial-rewrite[11552]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:43:47 mailserver postfix/trivial-rewrite[11553]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:44:48 mailserver postfix/trivial-rewrite[11556]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:44:48 mailserver postfix/trivial-rewrite[11557]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:45:49 mailserver postfix/trivial-rewrite[11563]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:45:49 mailserver postfix/trivial-rewrite[11564]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:46:46 mailserver authdaemond: failed to connect to mysql server (server=localhost, userid=mail_admin): Access denied for user 'mail_admin'@'localhost' (using password: YES)
    Jun 1 20:46:46 mailserver imapd: authentication error: Input/output error
    Jun 1 20:46:50 mailserver postfix/trivial-rewrite[11569]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:46:50 mailserver postfix/trivial-rewrite[11570]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:47:51 mailserver postfix/trivial-rewrite[11595]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 20:47:51 mailserver postfix/trivial-rewrite[11596]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem


    Anyone that could give me a hint or two?

    PS... later. It seems that I may have missunderstood some courier and postfix config files. It says often "=mail_admin" and "=mail_admin_password". Should I replace these with my own of what? In Ubuntu I logged in as with a local user name/password, should I use that? Sorry for that question but I'm a newbie here, so please bare with me ;)

    PS... even later! Changed all "mail_admin" to my name, which is a local user on this computer, and the "mail_admin_password" to my local password on all places mentioned in the HowTo article, but with no luck. Still gives me the following in the /var/log/mail.err:

    Jun 1 21:20:16 mailserver imapd: authentication error: Input/output error
    Jun 1 21:20:27 mailserver authdaemond: failed to connect to mysql server (server=localhost, userid=lars): Access denied for user 'lars'@'localhost' (using password: YES)
    Jun 1 21:20:27 mailserver imapd: authentication error: Input/output error
    Jun 1 21:20:53 mailserver postfix/trivial-rewrite[12101]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 21:21:54 mailserver postfix/trivial-rewrite[12102]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
    Jun 1 21:22:55 mailserver postfix/trivial-rewrite[12103]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem


    TIA
     
    Last edited: Jun 1, 2008
  5. thecaoticone

    thecaoticone New Member

    From the error it looks like the first problem is in /etc/postfix/mysql-virtual_domains.cf

    I would re-check the entire file for errors. With this setup, voice of experience now talking,
    any little typo will cause problems. It is usually the password. It must be identical ( MyPassworD is not the same as mypassword ).


    Make sure MySQL is running by issuing the command:


    netstat -tap | grep mysql


    If it is running you should see something like:


    tcp 0 0 localhost.localdo:mysql *:* LISTEN 6177/mysqld



    As far as the user and password, you will set that in MySQL, page 1 of the guide. It can be anything you want. This will be your mail adminisrtator.



    GRANT SELECT, INSERT, UPDATE, DELETE ON mail.* TO 'who_ever_I_choose'@'localhost' IDENTIFIED BY 'My_Secret_PassWord';
    GRANT SELECT, INSERT, UPDATE, DELETE ON mail.* TO 'who_ever_I_choose'@localhost.localdomain' IDENTIFIED BY 'My_Secret_PassWord';
    FLUSH PRIVILEGES;



    The user and password you specify here is the same user and password you will need to use throughout the entire setup.

    It will need to be indentical in the following files:

    /etc/postfix/mysql-virtual_domains.cf

    /etc/postfix/mysql-virtual_forwardings.cf

    /etc/postfix/mysql-virtual_mailboxes.cf

    /etc/postfix/mysql-virtual_email2email.cf

    /etc/postfix/mysql-virtual_transports.cf

    /etc/postfix/mysql-virtual_mailbox_limit_maps.cf

    /etc/pam.d/smtp

    /etc/postfix/sasl/smtpd.conf

    /etc/courier/authmysqlrc




    Also make sure that you changed the line in:


    /etc/courier/authdaemonrc



    from:

    authmodulelist="authpam"


    to:

    authmodulelist="authmysql"



    Hope this helped.
     
    Last edited: Jun 2, 2008
  6. spaceuser

    spaceuser New Member

    This is strange. I did find an typo, but after restarting everything, it still gives me the same error in Squirrelmail web page, ERROR:
    ERROR: Connection dropped by IMAP server.


    It's also strange that it says that I have a new mail in /var/mail/lars instead of /home/vmail (See below):

    root@mailserver:~# mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 26
    Server version: 5.0.51a-3ubuntu5.1 (Ubuntu)

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> INSERT INTO `domains` (`domain`) VALUES ('mydomain.xx.');
    mysql> USE mail;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Database changed
    mysql> INSERT INTO `domains` (`domain`) VALUES ('mydomain.xx');
    mysql> quit
    Bye
    You have new mail in /var/mail/lars
    root@mailserver:~#


    When i use mailx to send a message to my domain, the /var/log/mail.log says:
    Jun 2 21:27:37 mailserver postfix/pickup[25650]: D85FE122164: uid=0 from=<root>
    Jun 2 21:27:37 mailserver postfix/cleanup[25777]: D85FE122164: message-id=<[email protected]>
    Jun 2 21:27:37 mailserver postfix/qmgr[25652]: D85FE122164: from=<[email protected]>, size=310, nrcpt=1 (queue active)
    Jun 2 21:27:45 mailserver postfix/smtpd[25786]: connect from localhost[127.0.0.1]
    Jun 2 21:27:45 mailserver postfix/smtpd[25786]: 4CFEE122137: client=localhost[127.0.0.1]
    Jun 2 21:27:45 mailserver postfix/cleanup[25777]: 4CFEE122137: message-id=<[email protected]>
    Jun 2 21:27:45 mailserver postfix/qmgr[25652]: 4CFEE122137: from=<[email protected]>, size=756, nrcpt=1 (queue active)
    Jun 2 21:27:45 mailserver postfix/smtpd[25786]: disconnect from localhost[127.0.0.1]
    Jun 2 21:27:45 mailserver postfix/virtual[25789]: 4CFEE122137: to=<[email protected]>, relay=virtual, delay=0.56, delays=0.04/0.39/0/0.13, dsn=5.1.1, status=bounced (unknown user: "[email protected]")
    Jun 2 21:27:45 mailserver postfix/cleanup[25777]: D71841221A5: message-id=<[email protected]>
    Jun 2 21:27:45 mailserver postfix/qmgr[25652]: D71841221A5: from=<>, size=2603, nrcpt=1 (queue active)
    Jun 2 21:27:45 mailserver postfix/bounce[25790]: 4CFEE122137: sender non-delivery notification: D71841221A5
    Jun 2 21:27:45 mailserver postfix/qmgr[25652]: 4CFEE122137: removed
    Jun 2 21:27:45 mailserver amavis[25673]: (25673-03) Passed CLEAN, <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: YnhavBpMFQn9, Hits: 1.862, size: 310, queued_as: 4CFEE122137, 7793 ms
    Jun 2 21:27:46 mailserver postfix/smtp[25780]: D85FE122164: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=8.3, delays=0.17/0.13/0.14/7.9, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 4CFEE122137)
    Jun 2 21:27:46 mailserver postfix/qmgr[25652]: D85FE122164: removed
    Jun 2 21:27:46 mailserver postfix/local[25792]: D71841221A5: to=<[email protected]>, relay=local, delay=0.23, delays=0.03/0.17/0/0.03, dsn=2.0.0, status=sent (delivered to mailbox)
    Jun 2 21:27:46 mailserver postfix/qmgr[25652]: D71841221A5: removed


    The user email "[email protected]" is proven to be inside the users table.

    No errors in /var/log/mail.err for the above.

    TIA
     
    Last edited: Jun 2, 2008
  7. thecaoticone

    thecaoticone New Member

    The "ERROR: Connection dropped by IMAP server" is because there is no mail in /home/vmail/your_domain.com/lars.

    For some reason it is not seeing your user.

    Check the /etc/postfix/main.cf file for this line:


    Code:
    virtual_mailbox_base = /home/vmail
    This line tells the system where mail should be delivered.


    The way it should work is
    /home
    /vmail
    /domain.com
    /user





    If that is right, check the Mail database for errors.

    In the console do:

    Code:
    mysql -u root -p
    (ENTER ROOT PASSWORD)

    switch to the mail db
    Code:
    USE mail;
    to display all domains
    Code:
    SELECT * FROM domains
    to display all users
    Code:
    SELECT * FROM users
    if everything is right
    Code:
    quit
    then just to be safe do:

    Code:
    /etc/init.d/postfix reload
     
    Last edited: Jun 3, 2008
  8. spaceuser

    spaceuser New Member

    Thank you very much for your effort to help here... but my problem is still here.

    My /etc/postfix/main.cf contains
    virtual_mailbox_base = /home/vmail

    My database looks like:
    root@mailserver:~# mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 103
    Server version: 5.0.51a-3ubuntu5.1 (Ubuntu)

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> USE mail;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Database changed
    mysql> SELECT * FROM domains
    -> \G
    *************************** 1. row ***************************
    domain: mydomain.xx
    1 row in set (0.00 sec)

    mysql> SELECT * FROM users
    -> \G
    *************************** 1. row ***************************
    email: [email protected]
    password: R6RfNRnuy0wDU
    quota: 10485760
    1 row in set (0.00 sec)

    mysql> quit
    Bye
    root@mailserver:~#


    The main problem here seem to be that the mail saves in /var/mail/lars:
    lars@udesktop:~$ sudo -s
    [sudo] password for lars:
    root@udesktop:~# ssh -p 22 [email protected]
    [email protected]'s password:
    Linux mailserver 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008 i686

    The programs included with the Ubuntu system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.

    Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
    applicable law.

    To access official Ubuntu documentation, please visit:
    http://help.ubuntu.com/
    You have new mail.
    Last login: Tue Jun 3 20:05:18 2008
    lars@mailserver:~$ sudo -s
    [sudo] password for lars:
    root@mailserver:~#


    /Lars
     
    Last edited: Jun 3, 2008
  9. thecaoticone

    thecaoticone New Member

    The /var/mail/user is the Postfix default delivery location for system users.

    This means for some reason Postfix is not using the Virtual System.


    Below is my /etc/postfix/main.cf file. This is from the 8.04 guide where I updated last week. This config is currently in use on my mail server. Feel free to compare it to yours or copy it to see if it will work for you. There are 2 lines highlighted that will need to be changed if you copy it. The SPAM settings are optional.

    Code:
    # See /usr/share/postfix/main.cf.dist for a commented, more complete version
    
    
    # Debian specific:  Specifying a file name will cause the first
    # line of that file to be used as the name.  The Debian default
    # is /etc/mailname.
    #myorigin = /etc/mailname
    
    smtpd_banner = $myhostname ESMTP $mail_name
    biff = no
    
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    
    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h
    
    readme_directory = /usr/share/doc/postfix
    
    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_use_tls = yes
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    
    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.
    
    [B] myhostname = mail.domain.com[/B]
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    [B] mydestination = mail.domain.com, localhost, localhost.localdomain[/B]
    relayhost = 
    mynetworks = 127.0.0.0/8
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    html_directory = /usr/share/doc/postfix/html
    virtual_alias_domains = 
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_mailbox_base = /home/vmail
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_create_maildirsize = yes
    virtual_maildir_extended = yes
    virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
    virtual_mailbox_limit_override = yes
    virtual_maildir_limit_message = "The user you are trying to reach is over quota."
    virtual_overquota_bounce = yes
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps     $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps     $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings
    
    
    ##SPAM Settings
    
    
    smtpd_recipient_restrictions =
       reject_unauth_pipelining,
       reject_non_fqdn_recipient,
       reject_unknown_recipient_domain,
       reject_rbl_client bl.spamcop.net,
       reject_rbl_client zen.spamhaus.org,
    
    
    smtpd_sender_restrictions =
        permit_sasl_authenticated,
        permit_mynetworks,
        permit
    
    
    smtpd_delay_reject = yes
    smtpd_helo_required = yes
    smtpd_helo_restrictions =
         permit_mynetworks,
         permit
    
    Hope this helps.
     
    Last edited: Jun 8, 2008
  10. spaceuser

    spaceuser New Member

    I did miss one line...
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf

    I restarted postfix, and tried, but I couldn't log in. But then I tried to send a new message with, mailx [email protected], and now it turned up in /home/vmail, and it went ok to log in, but the mail or screen was totally empty. I did add both Subject and a little message.

    Anyway this was a huge result anyway. Now I need to find out why the Squirrel mail screen went blank. Not even a menu as I expected.

    Thanks a lot so far ;)
     
  11. thecaoticone

    thecaoticone New Member

    I had the same problem. After several attempts, this was the only way I could get it to work.

    as root do:

    Code:
    cp /usr/share/squirrelmail/plugins/change_sqlpass/config.php  /usr/share/squirrelmail/plugins/change_sqlpass/config.php.old
    
    rm -rf /usr/share/squirrelmail/plugins/change_sqlpass/config.php 
    Then re-create the file with your favorite text editor:

    Code:
    nano  /usr/share/squirrelmail/plugins/change_sqlpass/config.php

    Copy from here:
    Code:
    <?php
    
    /**
      * SquirrelMail Change SQL Password Plugin
      * Copyright (C) 2001-2002 Tyler Akins
      *               2002 Thijs Kinkhorst <[email protected]>
      *               2002-2005 Paul Lesneiwski <[email protected]>
      * This program is licensed under GPL. See COPYING for details
      *
      * @package plugins
      * @subpackage Change SQL Password
      *
      */
    
    
       // Global Variables, don't touch these unless you want to break the plugin
       //
       global $csp_dsn, $password_update_queries, $lookup_password_query,
              $force_change_password_check_query, $password_encryption,
              $csp_salt_query, $csp_salt_static, $csp_secure_port,
              $csp_non_standard_http_port, $csp_delimiter, $csp_debug,
              $min_password_length, $max_password_length, $include_digit_in_password,
              $include_uppercase_letter_in_password, $include_lowercase_letter_in_password,
              $include_nonalphanumeric_in_password;
    
    
    
       // csp_dsn
       //
       // Theoretically, any SQL database supported by Pear should be supported
       // here.  The DSN (data source name) must contain the information needed
       // to connect to your database backend. A MySQL example is included below.
       // For more details about DSN syntax and list of supported database types,
       // please see:
       //   http://pear.php.net/manual/en/package.database.db.intro-dsn.php
       //
       $csp_dsn = 'mysql://mail_admin:mail_admin_password@localhost/mail';
    
    
    
       // lookup_password_query
       //
       // This plugin will always verify the user's old password
       // against their login password, but an extra check can also
       // be done against the database for more security if you
       // desire.  If you do not need the extra password check,
       // make sure this setting is empty.
       //
       // This is a query that returns a positive value if a user
       // and password pair are found in the database.
       //
       // This query should return one value (one row, one column), the
       // value being ideally a one or a zero, simply indicating that
       // the user/password pair does in fact exist in the database.
       //
       //   %1 in this query will be replaced with the full username
       //      (including domain), such as "[email protected]"
       //   %2 in this query will be replaced with the username (without
       //      any domain portion), such as "jose"
       //   %3 in this query will be replaced with the domain name,
       //      such as "example.com"
       //   %4 in this query will be replaced with the current (old)
       //      password in whatever encryption format is needed per other
       //      plugin configuration settings (Note that the syntax of
       //      the password will be provided depending on your encryption
       //      choices, so you NEVER need to provide quotes around this
       //      value in the query here.)
       //   %5 in this query will be replaced with the current (old)
       //      password in unencrypted plain text.  If you do not use any
       //      password encryption, %4 and %5 will be the same values,
       //      except %4 will have double quotes around it and %5 will not.
       //
       //$lookup_password_query = '';
       // TERRIBLE SECURITY: $lookup_password_query = 'SELECT count(*) FROM users WHERE username = "%1" AND plain_password = "%5"';
       //$lookup_password_query = 'SELECT count(*) FROM users WHERE username = "%1" AND crypt_password = %4';
       $lookup_password_query = 'SELECT count(*) FROM users WHERE email = "%1" AND password = %4';
    
    
       // password_update_queries
       //
       // An array of SQL queries that will all be executed
       // whenever a password change attempt is made.
       //
       // Any number of queries may be included here.
       // The queries will be executed in the order given here.
       //
       //   %1 in all queries will be replaced with the full username
       //      (including domain), such as "[email protected]"
       //   %2 in all queries will be replaced with the username (without
       //      any domain portion), such as "jose"
       //   %3 in all queries will be replaced with the domain name,
       //      such as "example.com"
       //   %4 in all queries will be replaced with the new password
       //      in whatever encryption format is needed per other
       //      plugin configuration settings (Note that the syntax of
       //      the password will be provided depending on your
       //      encryption choices, so you NEVER need to provide quotes
       //      around this value in the queries here.)
       //   %5 in all queries will be replaced with the new password
       //      in unencrypted plain text - BEWARE!  If you do not use
       //      any password encryption, %4 and %5 will be the same
       //      values, except %4 will have double quotes around it
       //      and %5 will not.
       //
    //   $password_update_queries = array(
    //            'UPDATE users SET crypt_password = %4 WHERE username = "%1"',
    //            'UPDATE user_flags SET force_change_pwd = 0 WHERE username = "%1"',
    //            'UPDATE users SET crypt_password = %4, force_change_pwd = 0 WHERE username = "%1"',
    //                                   );
       $password_update_queries = array('UPDATE users SET password = %4 WHERE email = "%1"');
    
    
       // force_change_password_check_query
       //
       // A query that checks for a flag that indicates if a user
       // should be forced to change their password.  This query
       // should return one value (one row, one column) which is
       // zero if the user does NOT need to change their password,
       // or one if the user should be forced to change it now.
       //
       // This setting should be an empty string if you do not wish
       // to enable this functionality.
       //
       //   %1 in this query will be replaced with the full username
       //      (including domain), such as "[email protected]"
       //   %2 in this query will be replaced with the username (without
       //      any domain portion), such as "jose"
       //   %3 in this query will be replaced with the domain name,
       //      such as "example.com"
       //
       //$force_change_password_check_query = 'SELECT IF(force_change_pwd = "yes", 1, 0) FROM users WHERE username = "%1"';
       //$force_change_password_check_query = 'SELECT force_change_pwd FROM users WHERE username = "%1"';
       $force_change_password_check_query = '';
    
    
    
       // password_encryption
       //
       // What encryption method do you use to store passwords
       // in your database?  Please use one of the following,
       // exactly as you see it:
       //
       //   NONE          Passwords are stored as plain text only
       //   MYSQLPWD      Passwords are stored using the MySQL password() function
       //   MYSQLENCRYPT  Passwords are stored using the MySQL encrypt() function
       //   PHPCRYPT      Passwords are stored using the PHP crypt() function
       //   MD5CRYPT      Passwords are stored using encrypted MD5 algorithm
       //   MD5           Passwords are stored as MD5 hash
       //
       //$password_encryption = 'MYSQLPWD';
       $password_encryption = 'MYSQLENCRYPT';
    
    
       // csp_salt_query
       // csp_salt_static
       //
       // Encryption types that need a salt need to know where to get
       // that salt.  If you have a constant, known salt value, you
       // should define it in $csp_salt_static.  Otherwise, leave that
       // value empty and define a value for the $csp_salt_query.
       //
       // Leave both values empty if you do not need (or use) salts
       // to encrypt your passwords.
       //
       // The query should return one value (one row, one column) which
       // is the salt value for the current user's password.  This
       // query is ignored if $csp_salt_static is anything but empty.
       //
       //   %1 in this query will be replaced with the full username
       //      (including domain), such as "[email protected]"
       //   %2 in this query will be replaced with the username (without
       //      any domain portion), such as "jose"
       //   %3 in this query will be replaced with the domain name,
       //      such as "example.com"
       //
       //$csp_salt_static = 'LEFT(crypt_password, 2)';
       //$csp_salt_static = '"a4"';  // use this format with MYSQLENCRYPT
       //$csp_salt_static = '$2$blowsomefish$';  // use this format with PHPCRYPT
       //$csp_salt_static = '';
       $csp_salt_static = 'LEFT(password, 2)';
    
       //$csp_salt_query = 'SELECT SUBSTRING_INDEX(crypt_password, '$', 1) FROM users WHERE username = "%1"';
       //$csp_salt_query = 'SELECT SUBSTRING(crypt_password, (LENGTH(SUBSTRING_INDEX(crypt_password, '$', 2)) + 2)) FROM users WHERE username = "%1"';
       //$csp_salt_query = 'SELECT salt FROM users WHERE username = "%1"';
       //$csp_salt_query = '';
    
    
    
       // csp_secure_port
       //
       // You may ensure that SSL encryption is used during password
       // change by setting this to the port that your HTTPS is served
       // on (443 is typical).  Set to zero if you do not wish to force
       // an HTTPS connection when users are changing their passwords.
       //
       // You may override this value for certain domains, users, or
       // service levels through the Virtual Host Login (vlogin) plugin
       // by setting a value(s) for $vlogin_csp_secure_port in the vlogin
       // configuration.
       //
       $csp_secure_port = 0;
       //$csp_secure_port = 443;
    
    
    
       // csp_non_standard_http_port
       //
       // If you serve standard HTTP web requests on a non-standard
       // port (anything other than port 80), you should specify that
       // port number here.  Set to zero otherwise.
       //
       // You may override this value for certain domains, users, or
       // service levels through the Virtual Host Login (vlogin) plugin
       // by setting a value(s) for $vlogin_csp_non_standard_http_port
       // in the vlogin configuration.
       //
       //$csp_non_standard_http_port = 8080;
       $csp_non_standard_http_port = 0;
    
    
    
       // min_password_length
       // max_password_length
       // include_digit_in_password
       // include_uppercase_letter_in_password
       // include_lowercase_letter_in_password
       // include_nonalphanumeric_in_password
       //
       // You can set the minimum and maximum password lengths that
       // you accept or leave those settings as zero to indicate that
       // no limit should be applied.
       //
       // Turn on any of the other settings here to check that the
       // new password contains at least one digit, upper case letter,
       // lower case letter and/or one non-alphanumeric character.
       //
       $min_password_length = 6;
       $max_password_length = 0;
       $include_digit_in_password = 0;
       $include_uppercase_letter_in_password = 0;
       $include_lowercase_letter_in_password = 0;
       $include_nonalphanumeric_in_password = 0;
    
    
    
       // csp_delimiter
       //
       // if your system has usernames with something other than
       // an "@" sign separating the user and domain portion,
       // specify that character here
       //
       //$csp_delimiter = '|';
       $csp_delimiter = '@';
    
    
    
       // debug mode
       //
       $csp_debug = 0;
    
    
    
    ?>


    Last change this line to match you mail_admin_user and mail_admin_password:

    Code:
    $csp_dsn = 'mysql://mail_admin:mail_admin_password@localhost/mail';
     
    Last edited: Jun 6, 2008
  12. spaceuser

    spaceuser New Member

    WOW it's working... THANK YOU SO MUCH!!!

    I really appreciate all your help on this. Thank you once again!
     
  13. cornflake

    cornflake New Member

    You are a genius!

    Thank you very much!

    Now everything works!!!
     

Share This Page