Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 8.10) - Page 2

5 Configure Postfix

Now we have to tell Postfix where it can find all the information in the database. Therefore we have to create six text files. You will notice that I tell Postfix to connect to MySQL on the IP address 127.0.0.1 instead of localhost. This is because Postfix is running in a chroot jail and does not have access to the MySQL socket which it would try to connect if I told Postfix to use localhost. If I use 127.0.0.1 Postfix uses TCP networking to connect to MySQL which is no problem even in a chroot jail (the alternative would be to move the MySQL socket into the chroot jail which causes some other problems).

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

vi /etc/mysql/my.cnf

[...]
bind-address            = 127.0.0.1
[...]

If you had to modify /etc/mysql/my.cnf, please restart MySQL now:

/etc/init.d/mysql restart

Run

netstat -tap | grep mysql

to make sure that MySQL is listening on 127.0.0.1 (localhost.localdomain):

root@server1:/usr/src# netstat -tap | grep mysql
tcp        0      0 localhost.localdo:mysql *:*                     LISTEN      7224/mysqld
root@server1:/usr/src#

Now let's create our six text files.

vi /etc/postfix/mysql-virtual_domains.cf

user = mail_admin
password = mail_admin_password
dbname = mail
query = SELECT domain AS virtual FROM domains WHERE domain='%s'
hosts = 127.0.0.1

vi /etc/postfix/mysql-virtual_forwardings.cf

user = mail_admin
password = mail_admin_password
dbname = mail
query = SELECT destination FROM forwardings WHERE source='%s'
hosts = 127.0.0.1

vi /etc/postfix/mysql-virtual_mailboxes.cf

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

vi /etc/postfix/mysql-virtual_email2email.cf

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

vi /etc/postfix/mysql-virtual_transports.cf

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

vi /etc/postfix/mysql-virtual_mailbox_limit_maps.cf

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

Then change the permissions and the group of these files:

chmod o= /etc/postfix/mysql-virtual_*.cf
chgrp postfix /etc/postfix/mysql-virtual_*.cf

Now we create a user and group called vmail with the home directory /home/vmail. This is where all mail boxes will be stored.

groupadd -g 5000 vmail
useradd -g vmail -u 5000 vmail -d /home/vmail -m

Next we do some Postfix configuration. Go sure that you replace server1.example.com with a valid FQDN, otherwise your Postfix might not work properly!

postconf -e 'myhostname = server1.example.com'
postconf -e 'mydestination = server1.example.com, localhost, localhost.localdomain'
postconf -e 'mynetworks = 127.0.0.0/8'
postconf -e 'virtual_alias_domains ='
postconf -e 'virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf'
postconf -e 'virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf'
postconf -e 'virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf'
postconf -e 'virtual_mailbox_base = /home/vmail'
postconf -e 'virtual_uid_maps = static:5000'
postconf -e 'virtual_gid_maps = static:5000'
postconf -e 'smtpd_sasl_auth_enable = yes'
postconf -e 'broken_sasl_auth_clients = yes'
postconf -e 'smtpd_sasl_authenticated_header = yes'
postconf -e 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination'
postconf -e 'smtpd_use_tls = yes'
postconf -e 'smtpd_tls_cert_file = /etc/postfix/smtpd.cert'
postconf -e 'smtpd_tls_key_file = /etc/postfix/smtpd.key'
postconf -e 'transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf'
postconf -e 'virtual_create_maildirsize = yes'
postconf -e 'virtual_maildir_extended = yes'
postconf -e 'virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf'
postconf -e 'virtual_mailbox_limit_override = yes'
postconf -e 'virtual_maildir_limit_message = "The user you are trying to reach is over quota."'
postconf -e 'virtual_overquota_bounce = yes'
postconf -e 'proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps'

Afterwards we create the SSL certificate that is needed for TLS:

cd /etc/postfix
openssl req -new -outform PEM -out smtpd.cert -newkey rsa:2048 -nodes -keyout smtpd.key -keyform PEM -days 365 -x509

Country Name (2 letter code) [AU]: <-- Enter your Country Name (e.g., "DE").
State or Province Name (full name) [Some-State]:
<-- Enter your State or Province Name.
Locality Name (eg, city) []:
<-- Enter your City.
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
<-- Enter your Organization Name (e.g., the name of your company).
Organizational Unit Name (eg, section) []:
<-- Enter your Organizational Unit Name (e.g. "IT Department").
Common Name (eg, YOUR name) []:
<-- Enter the Fully Qualified Domain Name of the system (e.g. "server1.example.com").
Email Address []:
<-- Enter your Email Address.

Then change the permissions of the smtpd.key:

chmod o= /etc/postfix/smtpd.key

 

6 Configure Saslauthd

First run

mkdir -p /var/spool/postfix/var/run/saslauthd

Then edit /etc/default/saslauthd. Set START to yes and change the line OPTIONS="-c -m /var/run/saslauthd" to OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r":

vi /etc/default/saslauthd

#
# Settings for saslauthd daemon
# Please read /usr/share/doc/sasl2-bin/README.Debian for details.
#

# Should saslauthd run automatically on startup? (default: no)
START=yes

# Description of this saslauthd instance. Recommended.
# (suggestion: SASL Authentication Daemon)
DESC="SASL Authentication Daemon"

# Short name of this saslauthd instance. Strongly recommended.
# (suggestion: saslauthd)
NAME="saslauthd"

# Which authentication mechanisms should saslauthd use? (default: pam)
#
# Available options in this Debian package:
# getpwent  -- use the getpwent() library function
# kerberos5 -- use Kerberos 5
# pam       -- use PAM
# rimap     -- use a remote IMAP server
# shadow    -- use the local shadow password file
# sasldb    -- use the local sasldb database file
# ldap      -- use LDAP (configuration is in /etc/saslauthd.conf)
#
# Only one option may be used at a time. See the saslauthd man page
# for more information.
#
# Example: MECHANISMS="pam"
MECHANISMS="pam"

# Additional options for this mechanism. (default: none)
# See the saslauthd man page for information about mech-specific options.
MECH_OPTIONS=""

# How many saslauthd processes should we run? (default: 5)
# A value of 0 will fork a new process for each connection.
THREADS=5

# Other options (default: -c -m /var/run/saslauthd)
# Note: You MUST specify the -m option or saslauthd won't run!
#
# WARNING: DO NOT SPECIFY THE -d OPTION.
# The -d option will cause saslauthd to run in the foreground instead of as
# a daemon. This will PREVENT YOUR SYSTEM FROM BOOTING PROPERLY. If you wish
# to run saslauthd in debug mode, please run it by hand to be safe.
#
# See /usr/share/doc/sasl2-bin/README.Debian for Debian-specific information.
# See the saslauthd man page and the output of 'saslauthd -h' for general
# information about these options.
#
# Example for postfix users: "-c -m /var/spool/postfix/var/run/saslauthd"
#OPTIONS="-c -m /var/run/saslauthd"
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"

Then create the file /etc/pam.d/smtp. It should contain only the following two lines (go sure to fill in your correct database details):

vi /etc/pam.d/smtp

auth    required   pam_mysql.so user=mail_admin passwd=mail_admin_password host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1
account sufficient pam_mysql.so user=mail_admin passwd=mail_admin_password host=127.0.0.1 db=mail table=users usercolumn=email passwdcolumn=password crypt=1

Next create the file /etc/postfix/sasl/smtpd.conf. It should look like this:

vi /etc/postfix/sasl/smtpd.conf

pwcheck_method: saslauthd
mech_list: plain login
allow_plaintext: true
auxprop_plugin: mysql
sql_hostnames: 127.0.0.1
sql_user: mail_admin
sql_passwd: mail_admin_password
sql_database: mail
sql_select: select password from users where email = '%u'

Next add the postfix user to the sasl group (this makes sure that Postfix has the permission to access saslauthd):

adduser postfix sasl

Then restart Postfix and Saslauthd:

/etc/init.d/postfix restart
/etc/init.d/saslauthd restart

 

7 Configure Courier

Now we have to tell Courier that it should authenticate against our MySQL database. First, edit /etc/courier/authdaemonrc and change the value of authmodulelist so that it reads:

vi /etc/courier/authdaemonrc

[...]
authmodulelist="authmysql"
[...]

Then make a backup of /etc/courier/authmysqlrc and empty the old file:

cp /etc/courier/authmysqlrc /etc/courier/authmysqlrc_orig
cat /dev/null > /etc/courier/authmysqlrc

Then open /etc/courier/authmysqlrc and put the following lines into it:

vi /etc/courier/authmysqlrc

MYSQL_SERVER localhost
MYSQL_USERNAME mail_admin
MYSQL_PASSWORD mail_admin_password
MYSQL_PORT 0
MYSQL_DATABASE mail
MYSQL_USER_TABLE users
MYSQL_CRYPT_PWFIELD password
#MYSQL_CLEAR_PWFIELD password
MYSQL_UID_FIELD 5000
MYSQL_GID_FIELD 5000
MYSQL_LOGIN_FIELD email
MYSQL_HOME_FIELD "/home/vmail"
MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
#MYSQL_NAME_FIELD
MYSQL_QUOTA_FIELD quota

Then restart Courier:

/etc/init.d/courier-authdaemon restart
/etc/init.d/courier-imap restart
/etc/init.d/courier-imap-ssl restart
/etc/init.d/courier-pop restart
/etc/init.d/courier-pop-ssl restart

By running

telnet localhost pop3

you can see if your POP3 server is working correctly. It should give back +OK Hello there. (Type quit to get back to the Linux shell.)

root@server1:/etc/postfix# telnet localhost pop3
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
+OK Hello there.
quit
+OK Better luck next time.
Connection closed by foreign host.
root@server1:/etc/postfix#

 

8 Modify /etc/aliases

Now we should open /etc/aliases. Make sure that postmaster points to root and root to your own username or your email address, e.g. like this:

vi /etc/aliases

[...]
postmaster: root
root: postmaster@yourdomain.tld
[...]

or like this (if administrator is your own username):

[...]
postmaster: root
root:   administrator
[...]

Whenever you modify /etc/aliases, you must run

newaliases

afterwards and restart Postfix:

/etc/init.d/postfix restart

Share this page:

27 Comment(s)

Add comment

Comments

From: Dale Hutchinson at: 2009-04-21 00:09:30

Falko,


 Thank you for these guides. Not only do these get a great server up and running with little effort your are teaching me Linux! 


 


Thanks!


 

From: Johnny at: 2009-03-25 19:34:10

Excellent guide, thanks. You got any advice on integrating domain keys into the setup?

From: at: 2008-11-26 20:02:26

Thanks for this one.

From: at: 2009-01-20 13:04:20

What a great guide!


I found a small typo in the configuration of postfix.


The line:


postconf -e 'virtual_mailbox_extended = yes'


should be:


postconf -e 'virtual_maildir_extended = yes'


If not, quota does not work


Best regards,


Hans Audun

From: Michel at: 2009-03-07 00:49:11

hi my problem is not recive email send is ok


log:


Mar  7 01:38:39 mail postfix/smtpd[23978]: connect from localhost[127.0.0.1]
Mar  7 01:38:39 mail postfix/smtpd[23978]: 2A94618127: client=localhost[127.0.0.1]
Mar  7 01:38:39 mail postfix/cleanup[23974]: 2A94618127: message-id=<01d701c99ebd$055b0af0$101120d0$@b@netcore.ch>
Mar  7 01:38:39 mail postfix/qmgr[23768]: 2A94618127: from=<michel.b@netcore.ch>, size=3640, nrcpt=1 (queue active)
Mar  7 01:38:39 mail postfix/smtpd[23978]: disconnect from localhost[127.0.0.1]
Mar  7 01:38:39 mail amavis[23161]: (23161-07) Passed CLEAN, [212.90.203.27] [62.48.100.149] <michel.b@netcore.ch> -> <info@dmbox.ch>, Message-ID: <01d701c99ebd$055b0af0$101120d0$@b@netcore.ch>, mail_id: $
Mar  7 01:38:39 mail postfix/smtp[23975]: 00A8918126: to=<info@dmbox.ch>, relay=127.0.0.1[127.0.0.1]:10024, delay=1.2, delays=0.22/0.01/0.01/1, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=23161-07, from MTA($
Mar  7 01:38:39 mail postfix/qmgr[23768]: 00A8918126: removed
Mar  7 01:38:39 mail pop3d-ssl: Connection, ip=[::ffff:62.48.100.149]
Mar  7 01:38:39 mail postfix/smtpd[23971]: warning: 62.48.100.157: hostname 62-48-100-157.adsl.ticino.com verification failed: Name or service not known
Mar  7 01:38:39 mail postfix/smtpd[23971]: connect from unknown[62.48.100.157]
Mar  7 01:38:39 mail postfix/smtp[23979]: warning: host mail.dmbox.ch[62.48.100.157]:25 greeted me with my own hostname mail.dmbox.ch
Mar  7 01:38:39 mail postfix/smtp[23979]: warning: host mail.dmbox.ch[62.48.100.157]:25 replied to HELO/EHLO with my own hostname mail.dmbox.ch
Mar  7 01:38:39 mail postfix/smtp[23979]: 2A94618127: to=<info@dmbox.ch>, relay=mail.dmbox.ch[62.48.100.157]:25, delay=0.25, delays=0.01/0.02/0.22/0, dsn=5.4.6, status=bounced (mail for mail.dmbox.ch loop$
Mar  7 01:38:39 mail postfix/smtpd[23971]: disconnect from unknown[62.48.100.157]
Mar  7 01:38:39 mail postfix/cleanup[23974]: 6995018128: message-id=<20090307003839.6995018128@mail.dmbox.ch>
Mar  7 01:38:39 mail postfix/qmgr[23768]: 6995018128: from=<>, size=5436, nrcpt=1 (queue active)
Mar  7 01:38:39 mail postfix/bounce[23982]: 2A94618127: sender non-delivery notification: 6995018128
Mar  7 01:38:39 mail postfix/qmgr[23768]: 2A94618127: removed
Mar  7 01:38:39 mail pop3d-ssl: LOGIN, user=info@dmbox.ch, ip=[::ffff:62.48.100.149], port=[62236]
Mar  7 01:38:39 mail pop3d-ssl: LOGOUT, user=info@dmbox.ch, ip=[::ffff:62.48.100.149], port=[62236], top=0, retr=0, rcvd=12, sent=39, time=0
Mar  7 01:38:40 mail postfix/smtp[23979]: 6995018128: to=<michel.b@netcore.ch>, relay=mail.netcore.ch[213.200.248.134]:25, delay=1.4, delays=0.01/0/0.77/0.65, dsn=2.0.0, status=sent (250 Requested mail ac$
Mar  7 01:38:40 mail postfix/qmgr[23768]: 6995018128: removed
Mar  7 01:38:41 mail pop3d-ssl: Connection, ip=[::ffff:62.48.100.149]
Mar  7 01:38:41 mail pop3d-ssl: LOGIN, user=info@dmbox.ch, ip=[::ffff:62.48.100.149], port=[62248]
Mar  7 01:38:41 mail pop3d-ssl: LOGOUT, user=info@dmbox.ch, ip=[::ffff:62.48.100.149], port=[62248], top=0, retr=0, rcvd=12, sent=39, time=0


my main.cf


myhostname = mail.dmbox.ch
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mail.dmbox.ch, localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
message_size_limit = 30720000
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_create_maildirsize = yes
virtual_maildir_extended = yes
#virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sende$
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings


help my please

From: Gergely Kiss at: 2009-01-11 21:55:52

This howto is great, works as expected, however I've found a small issue with it: quota warnings don't get sent until the setting "virtual_maildir_extended = yes" is added  to the main postfix config file (/etc/postfix/main.cf). This instructs postfix to create or update the maildirsize file for each maildir, which is required to check the actual size of a maildir.

From: sunil at: 2010-06-10 02:51:28

Guys,


for the quota set.I am not able to download the quota.txt from http://puuhis.net/vhcs/quota.txt.


It would be great If you can tell me where I can download the same

From: at: 2009-04-02 01:56:49

Hello


 


can any one can help how to 


change http://10.30.5.225/squirrelmail to http://mail.mynetmagician.net


2)


Did i need make MX entires into my DNS server 


my server hostname is mynetmagician.net


need i have go with public IP ,


Last but not least what is relayhost?

From: at: 2009-04-02 01:53:05

ERROR: Connection dropped by IMAP server.


 


after checking the mail.log i get the below entries


Apr  1 21:08:46 ubuntu postfix/qmgr[25175]: 646A4BD189: from=<root@mynetmagic.net>, size=352, nrcpt=1 (queue active)
Apr  1 21:08:46 ubuntu postfix/smtp[25760]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
Apr  1 21:08:46 ubuntu postfix/smtp[25760]: 646A4BD189: to=<servicedesk@mynetmagician.net>, relay=none, delay=508, delays=508/0.2/0.03/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
Apr  1 21:18:46 ubuntu postfix/qmgr[25175]: 646A4BD189: from=<root@mynetmagic.net>, size=352, nrcpt=1 (queue active)
Apr  1 21:18:46 ubuntu postfix/smtp[26076]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
Apr  1 21:18:46 ubuntu postfix/smtp[26076]: 646A4BD189: to=<servicedesk@mynetmagician.net>, relay=none, delay=1109, delays=1109/0.04/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
Apr  1 21:24:08 ubuntu imapd: Connection, ip=[::ffff:127.0.0.1]
Apr  1 21:24:08 ubuntu imapd: LOGIN FAILED, user=servicedesk, ip=[::ffff:127.0.0.1]
Apr  1 21:24:13 ubuntu imapd: LOGOUT, ip=[::ffff:127.0.0.1], rcvd=53, sent=332
Apr  1 21:24:46 ubuntu imapd: Connection, ip=[::ffff:127.0.0.1]
Apr  1 21:24:46 ubuntu imapd: chdir mynetmagician.net/servicedesk/: No such file or directory
Apr  1 21:24:57 ubuntu imapd: Connection, ip=[::ffff:127.0.0.1]
Apr  1 21:24:57 ubuntu imapd: LOGIN FAILED, user=servicedesk, ip=[::ffff:127.0.0.1]
Apr  1 21:25:03 ubuntu imapd: LOGOUT, ip=[::ffff:127.0.0.1], rcvd=53, sent=332
Apr  1 21:25:12 ubuntu imapd: Connection, ip=[::ffff:127.0.0.1]
Apr  1 21:25:12 ubuntu imapd: LOGIN FAILED, user=wasimr, ip=[::ffff:127.0.0.1]
Apr  1 21:25:17 ubuntu imapd: LOGOUT, ip=[::ffff:127.0.0.1], rcvd=45, sent=332
Apr  1 21:25:31 ubuntu imapd: Connection, ip=[::ffff:127.0.0.1]
Apr  1 21:25:31 ubuntu imapd: LOGIN FAILED, user=servicedesk, ip=[::ffff:127.0.0.1]
Apr  1 21:25:36 ubuntu imapd: LOGOUT, ip=[::ffff:127.0.0.1], rcvd=53, sent=332
Apr  1 21:26:04 ubuntu imapd: Connection, ip=[::ffff:127.0.0.1]
Apr  1 21:26:04 ubuntu imapd: chdir mynetmagician.net/servicedesk/: No such file or directory
Apr  1 21:28:12 ubuntu postfix/smtpd[26189]: connect from unknown[10.30.5.225]
Apr  1 21:28:27 ubuntu postfix/smtpd[26189]: disconnect from unknown[10.30.5.225]
Apr  1 21:28:33 ubuntu imapd: Connection, ip=[::ffff:10.30.5.225]
Apr  1 21:29:09 ubuntu imapd: Disconnected, ip=[::ffff:10.30.5.225], time=36
Apr  1 21:31:47 ubuntu postfix/anvil[26192]: statistics: max connection rate 1/60s for (smtp:10.30.5.225) at Apr  1 21:28:12
Apr  1 21:31:47 ubuntu postfix/anvil[26192]: statistics: max connection count 1 for (smtp:10.30.5.225) at Apr  1 21:28:12
Apr  1 21:31:47 ubuntu postfix/anvil[26192]: statistics: max cache size 1 at Apr  1 21:28:12
Apr  1 21:35:40 ubuntu imapd: Connection, ip=[::ffff:10.30.1.80]
Apr  1 21:35:47 ubuntu imapd: Disconnected, ip=[::ffff:10.30.1.80], time=7
Apr  1 21:35:51 ubuntu pop3d: Connection, ip=[::ffff:10.30.1.80]
Apr  1 21:36:08 ubuntu pop3d: LOGIN FAILED, user=servicedesk, ip=[::ffff:10.30.1.80]
Apr  1 21:36:18 ubuntu pop3d: Disconnected, ip=[::ffff:10.30.1.80]
Apr  1 21:38:46 ubuntu postfix/qmgr[25175]: 646A4BD189: from=<root@mynetmagic.net>, size=352, nrcpt=1 (queue active)
Apr  1 21:38:46 ubuntu postfix/smtp[26279]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
Apr  1 21:38:46 ubuntu postfix/smtp[26279]: 646A4BD189: to=<servicedesk@mynetmagician.net>, relay=none, delay=2308, delays=2308/0.02/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
Apr  1 21:39:14 ubuntu imapd: Connection, ip=[::ffff:127.0.0.1]
Apr  1 21:39:14 ubuntu imapd: chdir mynetmagician.net/salil/: No such file or directory
Apr  1 21:39:22 ubuntu imapd: Connection, ip=[::ffff:127.0.0.1]
Apr  1 21:39:22 ubuntu imapd: LOGIN FAILED, user=salil, ip=[::ffff:127.0.0.1]
Apr  1 21:39:27 ubuntu imapd: LOGOUT, ip=[::ffff:127.0.0.1], rcvd=41, sent=332
Apr  1 21:39:47 ubuntu imapd: Connection, ip=[::ffff:127.0.0.1]
Apr  1 21:39:47 ubuntu imapd: chdir mynetmagician.net/wasim/: No such file or directory
Apr  1 21:42:06 ubuntu postfix/pickup[25174]: 95094BD193: uid=0 from=<root>
Apr  1 21:42:06 ubuntu postfix/cleanup[26455]: 95094BD193: message-id=<20090402014206.95094BD193@mynetmagician.net>
Apr  1 21:42:06 ubuntu postfix/qmgr[25175]: 95094BD193: from=<root@mynetmagic.net>, size=313, nrcpt=1 (queue active)
Apr  1 21:42:06 ubuntu postfix/smtp[26458]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
Apr  1 21:42:06 ubuntu postfix/smtp[26458]: 95094BD193: to=<wasim@mynetmagician.net>, relay=none, delay=0.25, delays=0.23/0.02/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)


 


Can u please help me how to get rid of this error.


 


 


 

From: de5truct0r at: 2009-03-27 17:31:25

Hi, my problem was the same, courier couldn't find mail directory (in my case it is /home/vmail). Problem is in /etc/courier/authmysqlrc  line: MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')


I just changed highlighted part to '/home/vmail' and now at least I can login using squirrel mail.


 I still don't know why courier can't login server.example.com/vmail. I would appreciate if someone who understands this issue could explain it.

From: Anonymous at: 2009-02-11 10:07:39

I had a similar issue when the change password plugin was loaded. Login and all I got was a blank page. Unloaded the plugin and it worked ok.


 It ended up being a stray bit of code in the sqlpass change config.php


Make sure you don't have any stray bits of code. I had "                        );" just under the $password_update_queries section.

From: dleonce at: 2009-01-08 08:43:07

I am having the same problem.  During the setup, I inadvertently selected YES to the question "Create directories for web-based administration?" in STEP 2.To install Postfix, Courier, Saslauthd, MySQL, and phpMyAdmin. Can someone tell me the implications of this? Could this be the reason for this error and can someone assist with the configuration changes?

From: Lochinvar at: 2008-12-30 04:52:01

I had the same issue. I solved it by sending an email to the account in question.


What is going on is that the directory to contain the email has yet to be created and the server throws the error.


 Try using mailx to send a sample email to the account.

From: keddie at: 2008-12-25 23:52:35

Try this:

 run squirrelmail-configure command, then go to server settings (2), next go to update IMAP settings (A), change IMAP Port(5) to 993 and Secure IMAP (TLS)(7) to true.


Hope that will help :)

From: Black-Adder at: 2009-01-18 16:38:07

Hello i have solved the problem. in the place of mail_user a put in the mysql user vmail that i maked with phpmyadmin and gif the richts to db mail after that it works

From: TomT at: 2009-01-18 19:44:03

Solved my own problem...  Whilst edditing one of the files I pasted an extra : at the end of the line.
That's what stopped the sending of emails :(


SquirrelMail was giving me a blank page, becuase I'd missed entering my MySQL password in one of the files for the password_changer plugin.


All my own fault :)


So how do I tell if ClamAV is upto date ?? And that SpamAssasin is working properly ?
I don't see any ref to Clamav in the email headers. Is that normal ?

Is it possible to set up more DNSBL or RBL entries in either Postfix or SpamAssasin ?
Is it possible to drop connections from any hosts that don't haev a FQN ? with exceptions based on host names ??
 


Thanks :)
 

From: w0x at: 2008-12-12 16:04:56

I have a problem (i speak spanish)


ERROR: Connection dropped by IMAP server.


follow all the step (changed the IPs), but don't work. Anybody can helpme?

From: at: 2008-12-24 20:24:49

And I have same problems. How Fix it?

From: at: 2008-12-26 13:46:44

I did it. Nothing has changed.

From: maczkal at: 2009-03-02 14:25:10


This is part of my mail.log file after using "mailx sales@example.com"

Mar  2 15:24:51 ubuntu dccproc[9231]: no working DCC servers dcc1.dcc-servers.net dcc2.dcc-servers.net dcc3.dcc-servers.net ... at 208.201.249.233 209.169.14
Mar  2 15:24:51 ubuntu postfix/smtpd[9233]: connect from localhost.localdomain[127.0.0.1]
Mar  2 15:24:51 ubuntu postfix/smtpd[9233]: 5D16214819E: client=localhost.localdomain[127.0.0.1]
Mar  2 15:24:51 ubuntu postfix/cleanup[9224]: 5D16214819E: message-id=<20090302142438.EC90C14819F@server1.example.com>
Mar  2 15:24:51 ubuntu postfix/qmgr[7542]: 5D16214819E: from=<root@server1.example.com>, size=770, nrcpt=1 (queue active)
Mar  2 15:24:51 ubuntu postfix/smtpd[9233]: disconnect from localhost.localdomain[127.0.0.1]
Mar  2 15:24:51 ubuntu amavis[7340]: (07340-02) Passed CLEAN, <root@server1.example.com> -> <sales@example.com>, Message-ID: <20090302142438.EC90C14819F@server1.example.com>, mail_id: lqMclwAqoZLI, Hits: 4.305, size: 303, queued_as: 5D16214819E, 12253 ms
Mar  2 15:24:51 ubuntu postfix/smtp[9227]: EC90C14819F: to=<sales@example.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=13, delays=0.27/0.05/0.02/12, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=07340-02, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 5D16214819E)
Mar  2 15:24:51 ubuntu postfix/qmgr[7542]: EC90C14819F: removed
Mar  2 15:24:51 ubuntu postfix/smtp[9236]: 5D16214819E: to=<sales@example.com>, relay=none, delay=0.34, delays=0.05/0.05/0.24/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=mail.example.com type=A: Host not found)
Mar  2 15:24:51 ubuntu postfix/cleanup[9224]: B785E1481A0: message-id=<20090302142451.B785E1481A0@server1.example.com>
Mar  2 15:24:51 ubuntu postfix/qmgr[7542]: B785E1481A0: from=, size=2776, nrcpt=1 (queue active)
Mar  2 15:24:51 ubuntu postfix/bounce[9237]: 5D16214819E: sender non-delivery notification: B785E1481A0
Mar  2 15:24:51 ubuntu postfix/qmgr[7542]: 5D16214819E: removed
Mar  2 15:24:51 ubuntu postfix/cleanup[9224]: CF1DC14819E: message-id=<20090302142451.B785E1481A0@server1.example.com>
Mar  2 15:24:51 ubuntu postfix/local[9239]: B785E1481A0: to=<root@server1.example.com>, relay=local, delay=0.1, delays=0.04/0.05/0/0.01, dsn=2.0.0, status=sent (forwarded as CF1DC14819E)
Mar  2 15:24:51 ubuntu postfix/qmgr[7542]: CF1DC14819E: from=, size=2916, nrcpt=1 (queue active)
Mar  2 15:24:51 ubuntu postfix/qmgr[7542]: B785E1481A0: removed
Mar  2 15:24:55 ubuntu postfix/smtp[9236]: CF1DC14819E: to=<maczkal@wp.pl>, orig_to=<root@server1.example.com>, relay=mx.wp.pl[212.77.101.4]:25, delay=3.4, delays=0.01/0/0.13/3.2, dsn=2.0.0, status=sent (250 ok 1236003703 qp 5679)
Mar  2 15:24:55 ubuntu postfix/qmgr[7542]: CF1DC14819E: removed





maczkal@wp.pl is my email.


When i want to login with Squirrelmail i have ERROR: Connection dropped by IMAP server.


This is in mail.log


Mar  2 15:27:07 ubuntu imapd: Connection, ip=[::ffff:127.0.0.1]
Mar  2 15:27:07 ubuntu imapd: chdir example.com/sales/: No such file or directory
 


Any hints?


From: Anonymous at: 2009-01-18 16:20:33

I've followed this guide and installed everything as shown.


When I go to my browser and view http://192.168.1.172/squirrelmail I get the log in screen.


I log in and nothing. No pages showing waiting mail. I have telnetted in and using STAT I can see mail waiting.  Any ideas what's wrong with SquirrelMail ??


Also when I try to send I get asked for a password, I've entered the same pasword that I used for IMAP/POP3 but it won't let me send.


Any Ideas ?


Thanks 

From: r00tz at: 2008-12-31 04:52:55

Very nice tutorial ! 100% works !


Lots of thanks !!! (I'm French)


 Thanks !!!!!

From: LQman at: 2009-01-11 11:48:50

This is my opinion about connection dropped by imap.


 Imap try to open user directory (maildir), while the directory (maildir) doesn't exist or didn't created before.


So we have to send "welcome message" to every new user, than courier will make maildir automatically, after that our new user will be able to login.

From: at: 2009-01-30 07:59:11

I have a problem where it is not letting me log as well. I look at /var/log/mail.log and this is what I see. I have tried looking through all the config files and I cannot find why it is sending UNKNOWN_USER instead of mail_admin
and advise would be great. Thank you all in advance. 



Jan 29 23:49:45 server1 postfix/cleanup[1001]: warning: connect to mysql server 127.0.0.1: Access denied for user 'UNKNOWN_USER'@'localhost' (using password: YES)


Jan 29 23:49:45 server1 postfix/cleanup[1001]: warning: 20E4B3A2426: virtual_alias_maps map lookup problem for test@fotofunonline.com


Jan 29 23:49:45 server1 amavis[631]: (00631-03) Negative SMTP response to data-dot (<test@fotofunonline.com>): 451 4.3.0 Error: queue file write error


Jan 29 23:49:45 server1 amavis[631]: (00631-03) (!)FWD via SMTP: <root@fotofunonline.com> -> <test@fotofunonline.com>,BODY=7BIT 451 4.3.0 TempFailed, id=00631-03, from MTA([127.0.0.1]:10025): 451 4.3.0 Error: queue file write error


Jan 29 23:49:45 server1 amavis[631]: (00631-03) Blocked MTA-BLOCKED, <root@fotofunonline.com> -> <test@fotofunonline.com>, Message-ID: <20090130064323.105373A249C@server1.fotofunonline.com>, mail_id: V54gw8ndSzXh, Hits: 3.033, size: 343, 8584 ms


Jan 29 23:49:45 server1 postfix/cleanup[1001]: warning: 258C53A2426: virtual_alias_maps map lookup problem for postmaster@fotofunonline.com


Jan 29 23:49:45 server1 postfix/smtpd[1031]: disconnect from localhost[127.0.0.1]


Jan 29 23:49:45 server1 postfix/smtp[1026]: 105373A249C: to=<test@fotofunonline.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=3982, delays=3974/0.01/0/8.6, dsn=4.3.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.3.0 TempFailed, id=00631-03, from MTA([127.0.0.1]:10025): 451 4.3.0 Error: queue file write error (in reply to end of DATA command))


Jan 29 23:51:38 server1 postfix/anvil[1008]: statistics: max connection rate 1/60s for (smtp:209.85.146.181) at Jan 29 23:45:46


Jan 29 23:51:38 server1 postfix/anvil[1008]: statistics: max connection count 1 for (smtp:209.85.146.181) at Jan 29 23:45:46


Jan 29 23:51:38 server1 postfix/anvil[1008]: statistics: max cache size 1 at Jan 29 23:45:46


Jan 29 23:54:36 server1 postfix/qmgr[991]: 1000

From: Maykel at: 2009-05-27 10:55:49

This tutorial is a excellent but i had problems.


Where connect http://192.168.0.100/squirrelmain


I had problem... ERROR: Connection dropped by IMAP server.


I doing some solutions as creating mailbox manually and not working.


 Have some ideas or any solutions? Thanks

From: justin at: 2009-03-05 16:18:45

where does it create the maildir directory ?  can i just run the makemaildir command to create it manually ?

From: Frederik at: 2009-12-27 08:37:00

 Hello


 I got the same problem I dont know that much from this system and are very fresh to it


I also got this error  `pure-ftpd-mysql' uses 32-bit capabilities (legacy support in use)


means (mysql is stoping) if its in your case the same then you have to fix this problem first


I am still doing resource on it to solve it , if I did fix it I will let you know


Regards FJB