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

12 Test Postfix

To see if Postfix is ready for SMTP-AUTH and TLS, run

telnet localhost 25

After you have established the connection to your Postfix mail server type

ehlo localhost

If you see the lines

250-STARTTLS

and

250-AUTH LOGIN PLAIN

everything is fine:

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

Type

quit

to return to the system shell.

 

13 Populate The Database And Test

To populate the database you can use the MySQL shell:

mysql -u root -p

USE mail;

At least you have to create entries in the tables domains and users:

INSERT INTO `domains` (`domain`) VALUES ('example.com');
INSERT INTO `users` (`email`, `password`, `quota`) VALUES ('sales@example.com', ENCRYPT('secret'), 10485760);

(Please take care that you use the ENCRYPT syntax in the second INSERT statement in order to encrypt the password!)

If you want to make entries in the other two tables, that would look like this:

INSERT INTO `forwardings` (`source`, `destination`) VALUES ('info@example.com', 'sales@example.com');
INSERT INTO `transport` (`domain`, `transport`) VALUES ('example.com', 'smtp:mail.example.com');

To leave the MySQL shell, type

quit;

For most people it is easier if they have a graphical front-end to MySQL; therefore you can also use phpMyAdmin (in this example under http://192.168.0.100/phpmyadmin/ or http://server1.example.com/phpmyadmin/) to administrate the mail database. Again, when you create a user, go sure that you use the ENCRYPT function to encrypt the password:

I do not think I have to explain the domains and users table further.

The forwardings table can have entries like the following:

source destination  
info@example.com sales@example.com Redirects emails for info@example.com to sales@example.com
@example.com thomas@example.com Creates a Catch-All account for thomas@example.com. All emails to example.com will arrive at thomas@example.com, except those that exist in the users table (i.e., if sales@example.com exists in the users table, mails to sales@example.com will still arrive at sales@example.com).
@example.com @anotherdomain.tld This redirects all emails to example.com to the same user at anotherdomain.tld. E.g., emails to thomas@example.com will be forwarded to thomas@anotherdomain.tld.
info@example.com sales@example.com, billing@anotherdomain.tld Forward emails for info@example.com to two or more email addresses. All listed email addresses under destination receive a copy of the email.

The transport table can have entries like these:

domain transport  
example.com : Delivers emails for example.com locally. This is as if this record would not exist in this table at all.
example.com smtp:mail.anotherdomain.tld Delivers all emails for example.com via smtp to the server mail.anotherdomain.com.
example.com smtp:mail.anotherdomain.tld:2025 Delivers all emails for example.com via smtp to the server mail.anotherdomain.com, but on port 2025, not 25 which is the default port for smtp.
example.com

smtp:[1.2.3.4]
smtp:[1.2.3.4]:2025
smtp:[mail.anotherdomain.tld]

The square brackets prevent Postfix from doing lookups of the MX DNS record for the address in square brackets. Makes sense for IP addresses.
.example.com smtp:mail.anotherdomain.tld Mail for any subdomain of example.com is delivered to mail.anotherdomain.tld.
* smtp:mail.anotherdomain.tld All emails are delivered to mail.anotherdomain.tld.
joe@example.com smtp:mail.anotherdomain.tld Emails for joe@example.com are delivered to mail.anotherdomain.tld.

See

man transport

for more details.

Please keep in mind that the order of entries in the transport table is important! The entries will be followed from the top to the bottom.

Important: Postfix uses a caching mechanism for the transports, therefore it might take a while until you changes in the transport table take effect. If you want them to take effect immediately, run

postfix reload

after you have made your changes in the transport table.

 

14 Send A Welcome Email For Creating Maildir

When you create a new email account and try to fetch emails from it (with POP3/IMAP) you will probably get error messages saying that the Maildir doesn't exist. The Maildir is created automatically when the first email arrives for the new account. Therefore it's a good idea to send a welcome email to a new account.

First, we install the mailx package:

apt-get install mailx

To send a welcome email to sales@example.com, we do this:

mailx sales@example.com

You will be prompted for the subject. Type in the subject (e.g. Welcome), then press ENTER, and in the next line type your message. When the message is finished, press ENTER again so that you are in a new line, then press CTRL+D; if you don't want to cc the mail, press ENTER again:

root@server1:/usr/local/sbin# mailx sales@example.com
Subject: Welcome
<-- ENTER
Welcome! Have fun with your new mail account. <-- ENTER
<-- CTRL+D
Cc: <-- ENTER
root@server1:/usr/local/sbin#

Share this page:

45 Comment(s)

Add comment

Comments

From: at: 2009-03-12 04:20:33

how can i write one script after user run this script they log in to root user?

 This script contain username and password of root.

 

 

From: sektalah at: 2010-06-22 14:10:31

Help me please...

How to integrated with postfixadmin...

 I'm try and ...

Error connection DROPED by IMAP

Thank's 

From: rieschl at: 2009-04-11 21:32:28

You should consider changing the permission of the "/etc/postfix/sasl/smtpd.conf" and "/etc/pam.d/smtp" files (chmod o= [filename]) so that the mysql mail-admin-password is not world-readable.

From: at: 2009-11-15 09:10:49

On Mail Clients (Outlook etc.) can the option SMTP Authentification not be activated. Is that correct?

From: Anonymous at: 2010-03-08 17:45:07

cuando entro por el telnet al puerto 25 me da el siguiente error:

 Trying 192.168.1.4...
Connected to 192.168.1.4.
Escape character is '^]'.
+OK Hello there.
user eduardo
+OK Password required.
pass eduardo
-ERR Login failed.

 he seguido el tutorial al pie de la letra, incluso lo hice dos veces, pero me sigue dando error

¿que puedo hacer?

From: Anonymous at: 2010-03-08 15:57:51

seguí los pasos al pie de la letra, pero cuando hago lo siguiente: Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. +OK Hello there. user eduardo +OK Password required. pass eduardo -ERR Login failed. ¿que puedo hacer? Saludos

From: Anonymous at: 2009-03-09 14:02:55

pls update dcc-dccproc

cd dcc-dccproc-1.3.103 acctually

From: White at: 2009-08-27 20:13:48

cd dcc-dccproc-1.3.102 this is now cd dcc-dccproc-1.3.115

 Falko it may be worth placing a note in the instructions that say check to see what level this program is and update the text prior to entering it into the shell.

White

From: hstoellinger at: 2009-11-17 10:19:22

cd dcc-dccproc-1.3.102 this is now cd dcc-dccproc-1.3.116

From: at: 2009-11-11 16:17:12

Please, someone, post the quota.txt file here, the website is no longer available

From: at: 2009-11-15 08:57:08

Hope, that helps:

 

#!/usr/bin/perl -w

# Author <jps@tntmax.com>
#
# This script assumes that virtual_mailbox_base in defined
# in postfix's main.cf file. This directory is assumed to contain
# directories which themselves contain your virtual user's maildirs.
# For example:
#
# -----------/
#            |
#            |
#    home/vmail/domains/
#        |          |
#        |          |
#  example.com/  foo.com/
#                   |
#                   |
#           -----------------
#           |       |       |
#           |       |       |
#         user1/   user2/  user3/
#                           |
#                           |
#                        maildirsize
#

use strict;

my $POSTFIX_CF = "/etc/postfix/main.cf";
my $MAILPROG = "/usr/sbin/sendmail -t";
my $WARNPERCENT = 80;
my @POSTMASTERS = ('postmaster@domain.tld');
my $CONAME = 'My Company';
my $COADDR = 'postmaster@domain.tld';
my $SUADDR = 'postmaster@domain.tld';
my $MAIL_REPORT = 1;
my $MAIL_WARNING = 1;

#get virtual mailbox base from postfix config
open(PCF, "< $POSTFIX_CF") or die $!;
my $mboxBase;
while (<PCF>) {
   next unless /virtual_mailbox_base\s*=\s*(.*)\s*/;
   $mboxBase = $1;
}
close(PCF);

#assume one level of subdirectories for domain names
my @domains;
opendir(DIR, $mboxBase) or die $!;
while (defined(my $name = readdir(DIR))) {
   next if $name =~ /^\.\.?$/;        #skip '.' and '..'
   next unless (-d "$mboxBase/$name");
   push(@domains, $name);
}
closedir(DIR);
#iterate through domains for username/maildirsize files
my @users;
chdir($mboxBase);
foreach my $domain (@domains) {
        opendir(DIR, $domain) or die $!;
        while (defined(my $name = readdir(DIR))) {
           next if $name =~ /^\.\.?$/;        #skip '.' and '..'
           next unless (-d "$domain/$name");
      push(@users, {"$name\@$domain" => "$mboxBase/$domain/$name"});
        }
}
closedir(DIR);

#get user quotas and percent used
my (%lusers, $report);
foreach my $href (@users) {
   foreach my $user (keys %$href) {
      my $quotafile = "$href->{$user}/maildirsize";
      next unless (-f $quotafile);
      open(QF, "< $quotafile") or die $!;
      my ($firstln, $quota, $used);
      while (<QF>) {
         my $line = $_;
              if (! $firstln) {
                 $firstln = 1;
                 die "Error: corrupt quotafile $quotafile"
                    unless ($line =~ /^(\d+)S/);
                 $quota = $1;
            last if (! $quota);
            next;
         }
         die "Error: corrupt quotafile $quotafile"
            unless ($line =~ /\s*(-?\d+)/);
         $used += $1;
      }
      close(QF);
      next if (! $used);
      my $percent = int($used / $quota * 100);
      $lusers{$user} = $percent unless not $percent;
   }
}

#send a report to the postmasters
if ($MAIL_REPORT) {
   open(MAIL, "| $MAILPROG");
   select(MAIL);
   map {print "To: $_\n"} @POSTMASTERS;
   print "From: $COADDR\n";
   print "Subject: Daily Quota Report.\n";
   print "DAILY QUOTA REPORT:\n\n";
   print "----------------------------------------------\n";
   print "| % USAGE |            ACCOUNT NAME          |\n";
   print "----------------------------------------------\n";
   foreach my $luser ( sort { $lusers{$b} <=> $lusers{$a} } keys %lusers ) {
      printf("|   %3d   | %32s |\n", $lusers{$luser}, $luser);
      print "---------------------------------------------\n";
   }
        print "\n--\n";
        print "$CONAME\n";
        close(MAIL);
}

#email a warning to people over quota
if ($MAIL_WARNING) {
        foreach my $luser (keys (%lusers)) {
           next unless $lusers{$luser} >= $WARNPERCENT;       # skip those under quota
           open(MAIL, "| $MAILPROG");
           select(MAIL);
           print "To: $luser\n";
      map {print "BCC: $_\n"} @POSTMASTERS;
           print "From: $SUADDR\n";
           print "Subject: WARNING: Your mailbox is $lusers{$luser}% full.\n";
           print "Reply-to: $SUADDR\n";
           print "Your mailbox: $luser is $lusers{$luser}% full.\n\n";
           print "Once your e-mail box has exceeded your monthly storage quota\n";
      print "your monthly billing will be automatically adjusted.\n";
      print "Please consider deleting e-mail and emptying your trash folder to clear some space.\n\n";
           print "Contact <$SUADDR> for further assistance.\n\n";
           print "Thank You.\n\n";
           print "--\n";
           print "$CONAME\n";
           close(MAIL);
        }
}

From: Den at: 2010-06-02 08:35:20

That helps a lot!

Thanks :)

Den

From: Anonymous at: 2009-10-21 07:45:34

Can sombody send me quota.txt or post some other link cose this isnt working

From: Marco at: 2009-10-01 12:36:19

The quata.txt page you mention is not there anymore (http://puuhis.net/vhcs/quota.txt).

By the way: this is a great tutorial!

Best regards.
Marco

From: timv at: 2010-11-22 08:00:08

Here is the info for quota.txt as the link in the document is dead.

 

11 Quota Exceedance Notifications

If you want to get notifications about all the email accounts that are over quota, then do this:

cd /usr/local/sbin/
nano quota.txt

#!/usr/bin/perl -w

# Author <jps@tntmax.com>
#
# This script assumes that virtual_mailbox_base in defined
# in postfix's main.cf file. This directory is assumed to contain
# directories which themselves contain your virtual user's maildirs.
# For example:
#
# -----------/
#            |
#            |
#    home/vmail/domains/
#        |          |
#        |          |
#  example.com/  foo.com/
#                   |
#                   |
#           -----------------
#           |       |       |
#           |       |       |
#         user1/   user2/  user3/
#                           |
#                           |
#                        maildirsize
#

use strict;

my $POSTFIX_CF = "/etc/postfix/main.cf";
my $MAILPROG = "/usr/sbin/sendmail -t";
my $WARNPERCENT = 80;
my @POSTMASTERS = ('postmaster@domain.tld');
my $CONAME = 'My Company';
my $COADDR = 'postmaster@domain.tld';
my $SUADDR = 'postmaster@domain.tld';
my $MAIL_REPORT = 1;
my $MAIL_WARNING = 1;

#get virtual mailbox base from postfix config
open(PCF, "< $POSTFIX_CF") or die $!;
my $mboxBase;
while (<PCF>) {
   next unless /virtual_mailbox_base\s*=\s*(.*)\s*/;
   $mboxBase = $1;
}
close(PCF);

#assume one level of subdirectories for domain names
my @domains;
opendir(DIR, $mboxBase) or die $!;
while (defined(my $name = readdir(DIR))) {
   next if $name =~ /^\.\.?$/;        #skip '.' and '..'
   next unless (-d "$mboxBase/$name");
   push(@domains, $name);
}
closedir(DIR);
#iterate through domains for username/maildirsize files
my @users;
chdir($mboxBase);
foreach my $domain (@domains) {
        opendir(DIR, $domain) or die $!;
        while (defined(my $name = readdir(DIR))) {
           next if $name =~ /^\.\.?$/;        #skip '.' and '..'
           next unless (-d "$domain/$name");
      push(@users, {"$name\@$domain" => "$mboxBase/$domain/$name"});
        }
}
closedir(DIR);

#get user quotas and percent used
my (%lusers, $report);
foreach my $href (@users) {
   foreach my $user (keys %$href) {
      my $quotafile = "$href->{$user}/maildirsize";
      next unless (-f $quotafile);
      open(QF, "< $quotafile") or die $!;
      my ($firstln, $quota, $used);
      while (<QF>) {
         my $line = $_;
              if (! $firstln) {
                 $firstln = 1;
                 die "Error: corrupt quotafile $quotafile"
                    unless ($line =~ /^(\d+)S/);
                 $quota = $1;
            last if (! $quota);
            next;
         }
         die "Error: corrupt quotafile $quotafile"
            unless ($line =~ /\s*(-?\d+)/);
         $used += $1;
      }
      close(QF);
      next if (! $used);
      my $percent = int($used / $quota * 100);
      $lusers{$user} = $percent unless not $percent;
   }
}

#send a report to the postmasters
if ($MAIL_REPORT) {
   open(MAIL, "| $MAILPROG");
   select(MAIL);
   map {print "To: $_\n"} @POSTMASTERS;
   print "From: $COADDR\n";
   print "Subject: Daily Quota Report.\n";
   print "DAILY QUOTA REPORT:\n\n";
   print "----------------------------------------------\n";
   print "| % USAGE |            ACCOUNT NAME          |\n";
   print "----------------------------------------------\n";
   foreach my $luser ( sort { $lusers{$b} <=> $lusers{$a} } keys %lusers ) {
      printf("|   %3d   | %32s |\n", $lusers{$luser}, $luser);
      print "---------------------------------------------\n";
   }
        print "\n--\n";
        print "$CONAME\n";
        close(MAIL);
}

#email a warning to people over quota
if ($MAIL_WARNING) {
        foreach my $luser (keys (%lusers)) {
           next unless $lusers{$luser} >= $WARNPERCENT;       # skip those under quota
           open(MAIL, "| $MAILPROG");
           select(MAIL);
           print "To: $luser\n";
      map {print "BCC: $_\n"} @POSTMASTERS;
           print "From: $SUADDR\n";
           print "Subject: WARNING: Your mailbox is $lusers{$luser}% full.\n";
           print "Reply-to: $SUADDR\n";
           print "Your mailbox: $luser is $lusers{$luser}% full.\n\n";
           print "Once your e-mail box has exceeded your monthly storage quota\n";
      print "your monthly billing will be automatically adjusted.\n";
      print "Please consider deleting e-mail and emptying your trash folder to clear some space.\n\n";
           print "Contact <$SUADDR> for further assistance.\n\n";
           print "Thank You.\n\n";
           print "--\n";
           print "$CONAME\n";
           close(MAIL);
        }
}
 

From: LightVision at: 2011-01-26 04:03:45

Those who are using your tutorial with copy and paste will stuck with vim and the certainly woul'nt know how to use it.

Default editor should be left as it is, in Debian: nano; advanced users would know how to change it anyway.

Besides the fact that I alway use dpkg -P vim-tiny vim-common tasksel tasksel-data and other few packages which are never used in a server.


In Debian Lenny 5.0.3 $pax='pax'; is enabled by default so it isn't necesary to include in /etc/amavis/conf.d/50-user


Two questions:

-For what is the cron? Ok, update database but with what and for what?

-How clamav update it's virus database ?


Thank You

From: Anonymous at: 2009-05-01 07:24:00

Hi, is it possible to put more than 1 address in field "destination" of  forwardings table? it doesn't seem to work. Can you help me?

 Very good work! thk

 

 

From: Anonymous at: 2009-09-15 07:43:25

You don't add several to the destination, you just insert a second row with all fields the same, but the destination differing.

 

from/to:

test@test.com/destination@test.com

test@test.com/otherdestination@test.com

 

If, for example, only the destination differs, you still insert a row for each unique forwarding.

 

Tim

From: Karolis Tamutis at: 2010-01-04 20:35:33

Please save yourself some frustration and know that passwords encrypted with crypt are salted, up to 8 characters long.

You may enter 9+ char password into PMA which would discard everything after 8th char, this can lead to some weird scenarions, like users being able to authenticate with other users passwords (which match up to 8 first chars).

In short: be aware of the 8 char limit, users with MySQL setup passwords such as 123456781 and 123456782 will be able to authenticate with either password.

From: at: 2010-02-01 14:42:16

If I setup as a local user an email like user@gmail.com then when I want to send an email to externaluser@gmail.com, postfix will try to send that email locally, because match gmail.com in mail_domains and it think that that is an internal email...

 Any idea how to solve this problem?

 

Thanks

MiK

From: Anonymous2 at: 2010-02-24 23:39:56

Hey!

When I try to send an email from yahoo/google to the email account which I inserted into the databases, the email isn't delivered.

The mail from yahoo says:

 test@mydomain.com: unknown user: test


From: tomiC at: 2010-09-30 14:57:03

When i try to start postfix /etc/init.d/postfix restart i get the following message in the mail.log

fatal: /etc/postfix/master.cf: line 83: missing "transport type" field

What's the problem?

regards

From: Pete at: 2011-03-08 01:46:54

This is a superb tutorial, I learnt so much from it, and best of all, it works!  Thanks very much for all your time and effort.

From: at: 2009-04-10 05:05:40

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

 

From: Cory LYnch at: 2009-11-11 12:15:42

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.

From: admin at: 2009-04-08 08:42:04

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

From: at: 2009-09-13 11:16:38

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 `);`.

From: Anonymous at: 2009-04-07 23:26:54

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.

From: Anonymous at: 2009-07-15 14:03:34

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.

From: A Happy Reader at: 2009-03-25 02:33:30

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.!   

From: at: 2009-07-01 11:47:07

Only 1 problem :

ERROR: Connection dropped by IMAP server.

From: hstoellinger at: 2009-11-17 12:03:54

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

From: fulm at: 2009-12-18 13:16:32

someone has a solution to solve the problem?

From: mitja at: 2009-11-20 01:29:49

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

From: Fejame at: 2010-04-27 18:15:30

ERROR: Connection dropped by IMAP server.

login squirrelmail??

 

From: Anonymous at: 2009-09-18 01:24:44

same problem

From: Anonymous at: 2009-08-29 06:57:28

Same problem here

From: Yogalu at: 2010-11-05 14:01: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.

From: ifos at: 2010-07-15 05:32:47

maildirmake /home/vmail/example.com/sales

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

From: catchu at: 2011-04-26 16:50:25

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.

 

From: Anonymous at: 2010-03-12 09:45:12

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

From: catchu at: 2011-04-27 15:12:46

 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.

From: Niklas C Aden at: 2011-01-31 12:07:49

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.

From: michael at: 2011-02-24 17:01:59

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)';


From: dynamike at: 2011-10-05 13:19:33

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