Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Debian Lenny) - Page 5

Want to support HowtoForge? Become a subscriber!
 
Submitted by falko (Contact Author) (Forums) on Tue, 2009-03-03 18:34. ::

15 Installing SquirrelMail

SquirrelMail is a webmail interface that will let your users send and receive emails in a browser. This chapter shows how to install it and adjust it to our setup so that users can even change their email account password from the SquirrelMail interface.

To install SquirrelMail, we run:

apt-get install squirrelmail php-pear

Next we copy the Apache configuration that comes with the SquirrelMail package to the /etc/apache2/conf.d directory and restart Apache:

cp /etc/squirrelmail/apache.conf /etc/apache2/conf.d/squirrelmail.conf
/etc/init.d/apache2 restart

SquirrelMail comes with some pre-installed plugins, unfortunately none of them is capable of letting us change our email password in our MySQL database. But there's the Change SQL Password plugin which we can install manually:

The plugin depends on the Pear-DB package so we install it:

pear install DB

Then we install the Change SQL Password plugin itself:

cd /usr/share/squirrelmail/plugins
wget http://www.squirrelmail.org/countdl.php?fileurl=http%3A%2F%2Fwww.squirrelmail.org%2Fplugins%2Fchange_sqlpass-3.3-1.2.tar.gz
tar xvfz change_sqlpass-3.3-1.2.tar.gz
cd change_sqlpass
cp config.php.sample config.php

Now we must edit config.php and adjust it to our setup. Please adjust the $csp_dsn, $lookup_password_query, $password_update_queries, $password_encryption, $csp_salt_static, and $csp_delimiter variables as follows and comment out $csp_salt_query (please make sure to make no syntax error while you edit the file - if you do, you will get a blank page after the SquirrelMail login!):

vi config.php

[...]
$csp_dsn = 'mysql://mail_admin:mail_admin_password@localhost/mail';
[...]
$lookup_password_query = 'SELECT count(*) FROM users WHERE email = "%1" AND password = %4';
[...]
$password_update_queries = array('UPDATE users SET password = %4 WHERE email = "%1"');
[...]
$password_encryption = 'MYSQLENCRYPT';
[...]
$csp_salt_static = 'LEFT(password, 2)';
[...]
//$csp_salt_query = 'SELECT salt FROM users WHERE username = "%1"';
[...]
$csp_delimiter = '@';
[...]

The complete file looks as follows:

<?php

/**
  * SquirrelMail Change SQL Password Plugin
  * Copyright (C) 2001-2002 Tyler Akins
  *               2002 Thijs Kinkhorst <kink@users.sourceforge.net>
  *               2002-2005 Paul Lesneiwski <paul@openguild.net>
  * 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://user:password@localhost/email_users';
   $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 "jose@example.com"
   //   %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 "jose@example.com"
   //   %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 "jose@example.com"
   //   %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 "jose@example.com"
   //   %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;



?>

The Change SQL Password plugin also depends on the Compatibility plugin which we install as follows:

cd /usr/share/squirrelmail/plugins
wget http://www.squirrelmail.org/countdl.php?fileurl=http%3A%2F%2Fwww.squirrelmail.org%2Fplugins%2Fcompatibility-2.0.14-1.0.tar.gz
tar xvfz compatibility-2.0.14-1.0.tar.gz

Now we must go into the SquirrelMail configuration and tell SquirrelMail that we use Courier as our POP3 and IMAP server and enable the Change SQL Password and the Compatibility plugins:

/usr/sbin/squirrelmail-configure

You'll see the following menu. Navigate through it as indicated:

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1.  Organization Preferences
2.  Server Settings
3.  Folder Defaults
4.  General Options
5.  Themes
6.  Address Books
7.  Message of the Day (MOTD)
8.  Plugins
9.  Database
10. Languages

D.  Set pre-defined settings for specific IMAP servers

C   Turn color on
S   Save data
Q   Quit

Command >>
 <-- D


SquirrelMail Configuration : Read: config.php
---------------------------------------------------------
While we have been building SquirrelMail, we have discovered some
preferences that work better with some servers that don't work so
well with others.  If you select your IMAP server, this option will
set some pre-defined settings for that server.

Please note that you will still need to go through and make sure
everything is correct.  This does not change everything.  There are
only a few settings that this will change.

Please select your IMAP server:
    bincimap    = Binc IMAP server
    courier     = Courier IMAP server
    cyrus       = Cyrus IMAP server
    dovecot     = Dovecot Secure IMAP server
    exchange    = Microsoft Exchange IMAP server
    hmailserver = hMailServer
    macosx      = Mac OS X Mailserver
    mercury32   = Mercury/32
    uw          = University of Washington's IMAP server

    quit        = Do not change anything
Command >>
 <-- courier


SquirrelMail Configuration : Read: config.php
---------------------------------------------------------
While we have been building SquirrelMail, we have discovered some
preferences that work better with some servers that don't work so
well with others.  If you select your IMAP server, this option will
set some pre-defined settings for that server.

Please note that you will still need to go through and make sure
everything is correct.  This does not change everything.  There are
only a few settings that this will change.

Please select your IMAP server:
    bincimap    = Binc IMAP server
    courier     = Courier IMAP server
    cyrus       = Cyrus IMAP server
    dovecot     = Dovecot Secure IMAP server
    exchange    = Microsoft Exchange IMAP server
    hmailserver = hMailServer
    macosx      = Mac OS X Mailserver
    mercury32   = Mercury/32
    uw          = University of Washington's IMAP server

    quit        = Do not change anything
Command >> courier

              imap_server_type = courier
         default_folder_prefix = INBOX.
                  trash_folder = Trash
                   sent_folder = Sent
                  draft_folder = Drafts
            show_prefix_option = false
          default_sub_of_inbox = false
show_contain_subfolders_option = false
            optional_delimiter = .
                 delete_folder = true

Press any key to continue...
 <-- press a key


SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1.  Organization Preferences
2.  Server Settings
3.  Folder Defaults
4.  General Options
5.  Themes
6.  Address Books
7.  Message of the Day (MOTD)
8.  Plugins
9.  Database
10. Languages

D.  Set pre-defined settings for specific IMAP servers

C   Turn color on
S   Save data
Q   Quit

Command >>
 <-- 8


SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
  Installed Plugins

  Available Plugins:
    1. abook_take
    2. administrator
    3. bug_report
    4. calendar
    5. change_sqlpass
    6. compatibility
    7. delete_move_next
    8. demo
    9. filters
    10. fortune
    11. info
    12. listcommands
    13. mail_fetch
    14. message_details
    15. newmail
    16. sent_subfolders
    17. spamcop
    18. squirrelspell
    19. test
    20. translate

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >>
 <-- 6  (or whatever number the compatibility plugin has - it's needed by the change_sqlpass plugin)


SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
  Installed Plugins
    1. compatibility

  Available Plugins:
    2. abook_take
    3. administrator
    4. bug_report
    5. calendar
    6. change_sqlpass
    7. delete_move_next
    8. demo
    9. filters
    10. fortune
    11. info
    12. listcommands
    13. mail_fetch
    14. message_details
    15. newmail
    16. sent_subfolders
    17. spamcop
    18. squirrelspell
    19. test
    20. translate

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >>
 <-- 6 (the number of the change_sqlpass plugin)


SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
  Installed Plugins
    1. compatibility
    2. change_sqlpass

  Available Plugins:
    3. abook_take
    4. administrator
    5. bug_report
    6. calendar
    7. delete_move_next
    8. demo
    9. filters
    10. fortune
    11. info
    12. listcommands
    13. mail_fetch
    14. message_details
    15. newmail
    16. sent_subfolders
    17. spamcop
    18. squirrelspell
    19. test
    20. translate

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >>
 <-- S


SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
  Installed Plugins
    1. compatibility
    2. change_sqlpass

  Available Plugins:
    3. abook_take
    4. administrator
    5. bug_report
    6. calendar
    7. delete_move_next
    8. demo
    9. filters
    10. fortune
    11. info
    12. listcommands
    13. mail_fetch
    14. message_details
    15. newmail
    16. sent_subfolders
    17. spamcop
    18. squirrelspell
    19. test
    20. translate

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >> S

Data saved in config.php
Press enter to continue...
 <-- ENTER


SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Plugins
  Installed Plugins
    1. compatibility
    2. change_sqlpass

  Available Plugins:
    3. abook_take
    4. administrator
    5. bug_report
    6. calendar
    7. delete_move_next
    8. demo
    9. filters
    10. fortune
    11. info
    12. listcommands
    13. mail_fetch
    14. message_details
    15. newmail
    16. sent_subfolders
    17. spamcop
    18. squirrelspell
    19. test
    20. translate

R   Return to Main Menu
C   Turn color on
S   Save data
Q   Quit

Command >>
 <-- Q

Now you can type in http://server1.example.com/squirrelmail or http://192.168.0.100/squirrelmail in your browser to access SquirrelMail.

Log in with your email address (e.g. sales@example.com) and your password:

You should find the welcome email in your inbox:

To change your password, go to Options and then select Change Password:

Type in your current password and then your new password twice:

SquirrelMail will tell you if the password has been changed successfully:

 

16 References

 

17 Links


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by dynamike (not registered) on Wed, 2011-10-05 14:19.

Hey,

first of all, thank you so much for this great tutorial. My mail infrastructure is up and running.

What I am wondering is how and which server-side filtering solution can be integrated to e.g. move the emails marked as SPAM etc. to specific folders.

Any help more than appreciated.

Cheers,

Dynamike

Submitted by michael (not registered) on Thu, 2011-02-24 18:01.

Amavis-ng won't scan mails in that configuration. At least not the current version ( amavisd-new-2.6.4 ) on debian squeeze.

As it only scans outgoing mails it needs to determine which domains are local. You need to edit the file /etc/amavis/conf.d/50-user and add the following lines (replacing your password off course):

 @lookup_sql_dsn = (
    ['DBI:mysql:database=mail;host=127.0.0.1;port=3306',
     'mail_admin',
     'mail_admin_password']);

$sql_select_policy = 'SELECT domain FROM domains WHERE CONCAT("@",domain) IN (%k)';


Submitted by Niklas C Aden (not registered) on Mon, 2011-01-31 13:07.

Hey, all is good!

Except one thing, when I try to enter the squirrelmail it just gives me a blank page.

I've checked the apache2 log file and the mail.log file without success, there's simply no error msg when I try to sign in :/
Tried it with 2 different accounts in 2 different domains, just to see what could cause it.

Submitted by Anonymous (not registered) on Fri, 2010-03-12 10:45.
Hi,

thanks for this really great howto, I appreciate the work and knowledge given here.

I would like to add two notes:

ClamAV is, as all on-access virus scanners, very ressource intensive. After testing it on a general purpose webserver hosted on vps, I decided to remove it to have more ram for the apache processes.

The command:
postconf -e 'mydestination = server1.example.com, localhost, localhost.localdomain'
did not work in my case.  Yes, I have replaced "server1.example.com" with the correct FQDN. No mail got through postfix and mailboxes were not created, which triggered the Squirrelmail error "Connection dropped by IMAP server". I was able to fix this by altering the command to:
postconf -e 'mydestination = '
Sorry, I don't know why, maybe because of double clarifications of the hostname there and in the database. I use the hostname of the mailserver also in the virtual users database, to create email adresses for this domain. Now it's working.

Thanks again for the great work.

Best Regards
Anonymous

Submitted by catchu (not registered) on Wed, 2011-04-27 16:12.
 I couldn't receive mail too and found the following when ’tail -f /var/log/mail.log &‘

warning: do not list domain ltns.info in BOTH mydestination and virtual_mailbox_domains

 Then I modified /etc/postfix/main.cf as you mentioned.  It works.  :)

'mydestination = '

Thank you, and falko's great hwoto.
Submitted by gajosew (registered user) on Wed, 2009-07-01 12:47.

Only 1 problem :

ERROR: Connection dropped by IMAP server.

Submitted by catchu (not registered) on Tue, 2011-04-26 17:50.

tail -f /var/log/mail.log &

 I found:
failed to connect to mysql server (server=localhost, userid=mail_admin): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

 So I have to excute:
ln -s  /tmp/mysql.sock  /var/run/mysqld/mysqld.sock

But it still doesn't work.

Then:
maildirmake /home/vmail/example.com/sales
chown -hR vmail:vmail /home/vmail/example.com/sales


it works :)

 

THX to ifos & Yogalu.

 

Submitted by ifos (not registered) on Thu, 2010-07-15 06:32.

maildirmake /home/vmail/example.com/sales

chown -hR vmail:vmail /home/vmail/example.com/sales

Submitted by fulm (not registered) on Fri, 2009-12-18 14:16.
someone has a solution to solve the problem?
Submitted by mitja (not registered) on Fri, 2009-11-20 02:29.

ERROR: Connection dropped by IMAP server.

 

I get the same problem... Any idea how to solve this? It seems i'm not the only one with the problem

Submitted by Fejame (not registered) on Tue, 2010-04-27 19:15.

ERROR: Connection dropped by IMAP server.

login squirrelmail??

 

Submitted by hstoellinger (not registered) on Tue, 2009-11-17 13:03.

Has anybody found a solution to this issue. The only thing I can think of regarding my own "walk" through this excellent tutorial is that this is my test system I am using a dynamic IP address established by my provider. Therefore I thought that using "localhost" as the FQDN might be appropriate. Is this assumption wrong? I do want to test everything before I go live on my production system.

Again, I don't remember ever going through a better tutorial than this one. Congratulations!

Any help would be greatly appreciated. As usual, I am pressed for time and the mailserver should go online within the coming two weeks.

Regards

H. Stoellinger

Submitted by Anonymous (not registered) on Fri, 2009-09-18 02:24.
same problem
Submitted by Anonymous (not registered) on Sat, 2009-08-29 07:57.
Same problem here
Submitted by Yogalu (not registered) on Fri, 2010-11-05 15:01.

Well, i had the same problem as all you guys...

 I did some testing and log checking

 tail -f /var/log/mail.log &

 which kept giving me:

authdaemond: failed to connect to mysql server (server=localhost, userid=mail_admin): Access denied for user 'mail_admin'@'localhost' (using password: YES)

 So in the end (and with a little help from another page) i found out there was a 'SPACE' behind the password in the file  /etc/courier/authmysqlrc

So edit that file, make sure there is no space behind the password and restart the authdaemon

/etc/init.d/courier-authdaemon restart

And try again.

Submitted by Anonymous (not registered) on Wed, 2009-04-08 00:26.

I only ran into two small problems:

Problem: postfix/tlsmgr[31109]: warning: request to update table btree:/var/spool/postfix/smtpd_scache in non-postfix directory /var/spool/postfix

Solution: Change both smtp*_tls_session_cache_database in /etc/postfix/main.cf from "$queue_directory" to "$data_directory".

# mkdir /var/spool/postfix/smtp_scache

# mkdir /var/spool/postfix/smptd_scache

# chown -R postfix /var/spool/postfix/smtp_scache

# chown -R postfix /var/spool/postfix/smtpd_scache

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

 Problem: Blank page after squirrelmail login.

Solution: Well, it's not really a solution - more of a workaround.   Run /usr/sbin/squirrelmail-configure and remove the change_sqlpass plugin.  If someone discovers a real solution, please post it here.

Submitted by Anonymous (not registered) on Wed, 2009-07-15 15:03.

http://www.postfix.org/postconf.5.html#smtp_tls_session_cache_database

"As of version 2.5, Postfix no longer uses root privileges when opening this file. The file should now be stored under the Postfix-owned data_directory. As a migration aid, an attempt to open the file under a non-Postfix directory is redirected to the Postfix-owned data_directory, and a warning is logged."

I believe that /var/spool/postfix is not you data_directory.

Submitted by admin (registered user) on Wed, 2009-04-08 09:42.

You probably made a syntax error when you edited the change_sqlpass configuration file:

http://www.howtoforge.com/forums/showthread.php?t=32673&highlight=syntax+error+squirrelmail

Submitted by PrawnStar (registered user) on Sun, 2009-09-13 12:16.

The mistake that I made was here:

$password_update_queries = array('UPDATE users SET password = %4 WHERE email = "%1"');

 

The line in the default config file is split over several lines:

 $password_update_queries = array(

                  'UPDATE users SET password = %4 WHERE email = "%1"'

                   );

 

So blindly copying and pasting resulted in me having a duplicate `);`.

Submitted by A Happy Reader (not registered) on Wed, 2009-03-25 03:33.
Hello! Your Guide is Great! i managed to put together a mail server! my only tiny problem is whit SquirrelMaill PW change feature. it says  "ERROR Could not make database connection"  So if you could plz help me out. I don't wana rush you its not so big problem :) And Tanks again.!   
Submitted by DiAvOl (registered user) on Fri, 2009-04-10 06:05.

If you try to apt-upgrade the system, it will report that postfix and postfix-mysql should be upgraded too. To prevent this from happening you could run the following command (become root first):

 echo postfix hold | dpkg --set-selections && echo postfix-mysql hold | dpkg --set-selections

 This should prevent apt from upgrading the package (with upgrade or dist-upgrade).

 To restore it (when actually a new version comes out) use:

  echo postfix install | dpkg --set-selections && echo postfix-mysql install | dpkg --set-selections

 

Submitted by Cory LYnch (not registered) on Wed, 2009-11-11 13:15.

ok so after following this tutorial completely for about an hour or so i finished went and restarted apache noticed the squirrellmail page wasnt loading or any of my other previous functional websites.

the errors apache are spiting at me are:

 [Wed Nov 11 12:01:55 2009] [info] mod_fcgid: Process manager 2031 started
[Wed Nov 11 12:01:55 2009] [error] mod_log_sql: insufficient configuration info to establish database link
[Wed Nov 11 12:01:55 2009] [error] mod_log_sql: child spawned but unable to open database link
[Wed Nov 11 12:01:55 2009] [error] mod_log_sql: insufficient configuration info to establish database link
[Wed Nov 11 12:01:55 2009] [error] mod_log_sql: child spawned but unable to open database link
[Wed Nov 11 12:01:55 2009] [error] mod_log_sql: insufficient configuration info to establish database link
[Wed Nov 11 12:01:55 2009] [error] mod_log_sql: child spawned but unable to open database link
[Wed Nov 11 12:01:55 2009] [error] mod_log_sql: insufficient configuration info to establish database link
[Wed Nov 11 12:01:55 2009] [error] mod_log_sql: child spawned but unable to open database link
[Wed Nov 11 12:01:55 2009] [notice] Apache/2.2.9 (Debian) mod_perl/2.0.4 Perl/v5.10.0 configured -- resuming normal operations
[Wed Nov 11 12:01:55 2009] [info] Server built: Jul 14 2009 20:03:28
[Wed Nov 11 12:01:55 2009] [debug] prefork.c(1032): AcceptMutex: sysvsem (default: sysvsem)
[Wed Nov 11 12:01:55 2009] [error] mod_log_sql: insufficient configuration info to establish database link
[Wed Nov 11 12:01:55 2009] [error] mod_log_sql: child spawned but unable to open database link

if you can help i would greatly appreciate it.