Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 10.04) - Page 5

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:

aptitude 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:

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.16-1.0.tar.gz
tar xvfz compatibility-2.0.16-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
    gmail       = IMAP access to Google mail (Gmail) accounts

    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 some 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
    1. view_as_html

  Available Plugins:
    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. view_as_html
    2. compatibility

  Available Plugins:
    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. view_as_html
    2. compatibility
    3. change_sqlpass

  Available Plugins:
    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. view_as_html
    2. compatibility
    3. change_sqlpass

  Available Plugins:
    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...
<-- press some key


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

  Available Plugins:
    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:

If the password has been changed successfully, you will see the following error message which means you must log in again with your new password (because the old one isn't active anymore):

 

16 References

 

17 Links

Share this page:

33 Comment(s)

Add comment

Comments

From: Rick Stanley at: 2010-06-10 23:59:47

I wish people would stop tagging every posting with Ubuntu! Most of the postings involved with the installation and configuration of software I have seen tagged with "Ubuntu" can also be done with MANY different Distros, including this one! You would think that there is only ONE Distro available! NOT!!!

Take a look at the top ten Distributions: DistroWatch

From: Anonymous at: 2010-08-11 16:37:17

Did you not notice that distro-specific how-to's are what's created here for some topics? Calm down. This article, and in fact no post on this site claims Ubuntu is the end-all of linux.

From: Mohamed Elsayed at: 2010-11-02 12:36:10

Dear Falko:

 many thanks for this great effort; actually I have installed my mail server before based on Christoph Haas tutorial at http://workaround.org. it was very helpful, and works 100%.

but for my need, there was something missing which is the mailing lists; I wanted to integrate mailman or any of mailing list management SW to be able to create mailing lists (for example sales@mydomain.com) and add the sales users to this list.

it will be perfect if you could complete this part in your great  tutorial which is (as I think) is very important for a many people.

I sent a comment like this to Christoph Haas on http://workaround.org and I noticed that another people also were interested to add this feature to their implementation. 

 

thanks again for you and I hope you can find a time to complete it soon.

 

From: at: 2011-01-24 02:48:07

you could use the forward table, create a user and add all the emails to it

example: create user salesdept@yourdomain.com

and add  the users salesperson1@yourdomain.com

                               salesperson2@yourdomain.com

and etc, this would be all done in the sql table forwards

I would use phpadmin much easier

From: eric.ni at: 2011-09-20 07:20:56

I follow this,and the tables like this:

mysql> select * from forwardings;
+------------------+----------------------------------+
| source           | destination                      |
+------------------+----------------------------------+
| @test.com     | eric@test.com                 |
| test@test.com | eric@test.com,jan@test.com |
+------------------+----------------------------------+
 then i sent a email to test@test.com, only test usr can receive this email. but when i sent a email to a invalid user,eric user can receive a email.

Anyone can help me?

 

From: Trapper at: 2010-10-04 17:24:49

I note that when creating the 6 text files in postfix for mysql parsing that there's a line:

password = mail_admin_password

Is it to be left as is or is the actual password to be used?

I also note the same circumstances with other files later in the howto.

From: Anonymous at: 2010-10-16 03:49:48

It should be replaced with your actual password, in those 6 files and everywhere else.

From: Jaac at: 2011-01-26 10:48:35

And be sure it does not contains any invalid characters like # which will comment out the rest of the line. Because that will get you into troubles with the configuration and give you a hard time locating the source of the problem.

Having the password in between single quotes will probably work, like 'your#Pa$$w0rd'. But i just avoided the problem by not using certain characters.

From: Anonymous at: 2011-02-12 04:30:01

Please make sure that /etc/mysql/my.cnf contains the following line:

vi /etc/mysql/my.cnf

[...]
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1
[...]
#bind-address           =127.0.0.1   Is this line shoud be unable comment? 
 

From: blueday at: 2011-12-06 10:46:17

Hello.

 I folowed your guide, all works ok. However, there is a nasty bug somewhere.

 If you create let;s say webmaster@domain.com and set a password domain99 it's possible to get autentificated with passwords like domain.ro, domain, domain12 etc. Basically, if you put anything in the password field starting wirh domain, you get autentificated.

 Can anyone reproduce this issue?

 Thank you,

From: at: 2012-02-02 06:47:47

Note: If you want to use your domain also as a virtual Domain, than 'mydestination' should be only 'localhost, localhost.localdomain'

postconf -e 'mydestination= server1.example.com, localhost, localhost.localdomain'

From: undifined at: 2010-08-30 12:42:58

 for amavis-d:

it is important to order  the /etc/hosts file, the important parts are: ipv6 before ipv4, fqdn before shortname

 # The following lines are desirable for IPv6 capable hosts

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts


::1 localhost6.localdomain6 localhost6 localhost.localdomain localhost ip6-localhost ip6-loopback


127.0.0.1 localhost.localdomain localhost


From: Markofealing at: 2010-06-19 17:05:15

Great tutorial however I've seem to have fallen at the last fence!

When I try to login to my e-mail account using SquirrelMail I'm getting the error message "ERROR: Connection dropped by IMAP server." When I type in sales@training.lan.

If I type in an invalid e-mail address I see waiting for moodle3.training.lan before I get the "unknown user or password incorrect" message, which is what I would expect because the account does not exist. The connection dropped message suggests that the account is validated but then SquirrelMail falls-over!

From: at: 2010-06-24 07:51:42

Usually it happens because the Maildir for that email does not exist.

Have you send greeting email for that account?

From: Anonymous at: 2010-06-26 12:58:53

Sure..! Very useful document for Linux Newbie administrator like me, however, i am getting the similar error,

ERROR: Connection dropped by IMAP server.

I followed the steps as explained. Instead of using the user sales i used a new one, following similar steps as for the user sales.

However, i can not log in.

Will you please assist? 

From: Anonymous at: 2010-06-27 22:44:41

Hello, I received the same error.

Anyway, great HOWTO, gotta thank You a lot.

Please, if someone figured it out, let us know.

Thank You once again

From: cejohnsonsr at: 2010-10-04 01:06:46

I saw this error 1 time. I sent a welcome message to the account & the next attempt to login produced a blank page. Does anyone have any idea why this might happen? No matter what account I try to login to, I always get a blank page.

 

Ed

From: johnny at: 2011-03-10 17:20:42

Well after going through this walk through a few times and still getting errors on the particular server I'm using, particularly the Connection Dropped by IMAP when logging into squirrel mail and trouble creating mailboxes under /home/vmail and msc other errors.

 I decided to try a Dovecot setup instead of Courier and have this setup working now. After installing Squirrel mail by itself after the mail setup I still had the Error connection dropped from Squirrel mail and after numerous file checks disabled the sql_pass from Squirrel mail as 1 user suggested and got Squirrel mail up then to fix the final errors displaying in the left side nav column I edited the following:

 /etc/squirrelmail/config_local.php and added the following to the end of the file which I believe had the opening <?php tag but was missing the closing one.

 nano or vim  /etc/squirrelmail/config_local.php

$default_folder_prefix='INBOX.';
$trash_folder='Trash';
$send_folder='Sent';
$draft_folder='Draft';
?>
 

The tutorial I located on the Dovecot setup is located at the link below and I noticed the author even took the time to set up an automated install script which was much appreciated and worked great aside from the fact the password regex patterns were older and did not account for symbols in the password. The links are below, First is to the tutorial, second to the automated install script, Enjoy ;-)

 Full Tutorial ::

 http://library.linode.com/email/postfix/dovecot-mysql-ubuntu-10.10-maverick

Automated Install ::

http://www.palegray.net/projects/automate/pdm/ubuntu-10-10

From: kunci at: 2010-10-08 08:02:11

Hi!

You must insert the

mailbox_transport = virtual

row in the  /etc/postfix/main.cf and delete or insert # the mailbox_command = procmail -a …. line:

vi /etc/postfox/main.cf
# mailbox_command = procmail -a...
mailbox_transport = virtual

From: Anonymous at: 2010-07-20 22:36:18

Al work i can send mail but i can not receive mail. any suggestions?

 

Oh, about the above two. you must make a dir it's in de tutorial you must first send one mail so the dirs wil be created.

From: toopaq at: 2010-08-04 11:01:31

Why do you need the samba package? I suppose for encrypting passwords but not sure.

From: Anonymous at: 2010-07-27 06:06:22

Hi, i have followed the tutorial, and succesfull to login to squirrel and also can send email to another mail server

but when i try to send email from another server to this ubuntu mail server, still the inbox in squirrel is empty, i've tried to use outlook as well but no luck.

i see the mail.log of postfix/local status is sent and delivered to mailboxes..

any idea? thanx a lot

 Irvan

From: at: 2010-08-07 21:25:42

Hi,

Ive used your tutorials before (couple of years back) and they rock! Luckily i have more experience these days. In any case, i followed it exactly and used patience and common sense. Everything works splendid, i've just sent out my first mail to a gmail address and vice versa, and both emails arrived fast.

To reply on some comments below, even if you buy/rent a domain and forward it correctly, e.g.

domain.tld MX 10 server1.example.com.

If your using a home server on your home ISP, they might be blocking the incoming or outgoing ports. Some ISP's even block both. In that case you can have problems with the mails arriving. Do some research about your specific ISP and their mail server policy.

 Also you should definitely check out the logs on your server (e.g. using: tail -f):

  • /var/log/system.log

  • /var/log/mail.log

  • /var/log/mysql.log

  • /var/log/apache2/access.log

Using a server (dedicated/private) at a hosting company usually saves a lot of headaches but your going to have to pay. In some cases you could also choose to pay for a mail forwarding/redirection service which is cheaper.

Hope that helps!

From: Anonymous at: 2010-11-15 16:30:28

thanks, mailbox_transport = virtual really helped ;)

From: Mike at: 2010-11-07 02:17:36

This is a very good and straightforward tutorial. I have spent hours trying to solve this one though. From the mail.log:

 Nov  7 11:43:02 tbpl postfix/proxymap[1626]: warning: connect to mysql server 127.0.0.1: Access denied for user 'mail_admin'@'localhost' to database 'maildb'
Nov  7 11:43:02 tbpl postfix/proxymap[1626]: warning: connect to mysql server 127.0.0.1: Access denied for user 'mail_admin'@'localhost' to database 'maildb'
Nov  7 11:43:02 tbpl postfix/trivial-rewrite[1665]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Nov  7 11:43:03 tbpl postfix/smtpd[1628]: warning: problem talking to service rewrite: Success
Nov  7 11:43:03 tbpl postfix/smtpd[1624]: warning: problem talking to service rewrite: Connection reset by peer
Nov  7 11:43:03 tbpl postfix/master[1418]: warning: process /usr/lib/postfix/trivial-rewrite pid 1665 exit status 1
Nov  7 11:43:03 tbpl postfix/master[1418]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

 

maildb is the correct name, I changed it from mail in the installation.

 

I can't work out what I doing wrong. Any help appreciated.

 

Mike

From: at: 2010-11-14 05:50:58

My fault for not reading properly!!! I went back to scratch and built the basic server according to Falko BEFORE doing this install and all worked fine. Excellent Tutorial.

 Mike, Australia

From: bob at: 2011-03-04 07:34:47

i have a problem with squirrelmail.. when i try to login, i got this error

ERROR: Connection dropped by IMAP server.

how to solve this problem.

 

From: Talgat at: 2011-03-28 04:34:14

Thanks for helpful tutorial, but I have 1 problem. When I trying to get mail by POP3 i have authentication error. In mail.log I can see that:

 Mar 28 04:20:15 mail pop3d: LOGIN FAILED, user=admin@4image.uz, ip=[::ffff:10.160.123.3]
Mar 28 04:20:20 mail pop3d: Disconnected, ip=[::ffff:10.160.123.3]

Please, Help me!

From: at: 2011-09-17 15:50:04

An script (based on this tutorial) to automate the entire installation for postfix-courier SquirrelMail. 3 minutes for install process. You find this script at http://forum.ubuntu.ro/viewtopic.php?id=11790 (post #10)

From: Anonymous at: 2011-10-19 13:07:02

I have a problem with adding users and domains. I added sales@domain.tld. ( form the tutorial ) and it works just fine, but if I add another domain or another email address, I cannot login.

 I restarted the postfix and the mysql and the courier-imap... but still the same problem.

I am getting this error:

                           ERROR:

ERROR: Connection dropped by IMAP server.

 

Can somebody help me?

From: at: 2012-03-09 23:47:06

This is because domain name is in two places at time, as real and virtual, and it will not work like that.

Edit /etc/postfix/main.cf and remove Your domain name from "mydestination" .

Then restart postfix.

From: Anonymous at: 2012-04-13 10:24:39

Thanks a lot for your tutorial, clear and simple to follow.

From: Alex at: 2012-12-04 10:23:37

Just tried your setup and it's really good. Also in last installation step I changed Squirrelmail to RoundCube which is less difficult in configuration and looks much better.
 
There were no changes to the entire setup except when you started installing Squirrel - I started installing RoundCube. It also has password change plugin and mysql authorization that are enabled in config file.