Configuring Dovecot is installing postfixadmin

Configuring Dovecot is installing postfixadmin

 

Configuring your dovecot:


## Base Directory ##
base_dir = /var/run/dovecot/
## Protocols that he will run ##
protocols = imap imaps pop3 pop3s
log_timestamp = ‘%Y-%m-%d %H:%M:%S ‘
syslog_facility = mail
## SSL data ##
ssl_listen = localhost
ssl_cert_file = /etc/postfix/mail-cert.pem
ssl_key_file = /etc/postfix/mail-key.pem
ssl_parameters_regenerate = 168
verbose_ssl = no
mail_location = maildir:/var/vmail/%d/%u
mail_access_groups = mail
mail_debug = no
first_valid_uid = 150
last_valid_uid = 150
maildir_copy_with_hardlinks = yes
protocol imap {
}
protocol pop3 {
# Login executable location.
login_executable = /usr/libexec/dovecot/pop3-login
mail_executable = /usr/libexec/dovecot/pop3
pop3_uidl_format = %08Xu%08Xv
}
protocol lda {
sendmail_path = /usr/lib/sendmail
auth_socket_path = /var/run/dovecot/auth-master
}
auth_verbose = no
auth_debug = no
auth default {
mechanisms = plain
passdb pam {
}
passdb sql {
args = /etc/dovecot-sql.conf
}
userdb passwd {
}
userdb sql {
args = /etc/dovecot-sql.conf
}
socket listen {
master {
path = /var/run/dovecot/auth-master
mode = 0600
user = vmail
group = mail
}
client {
path = /var/run/dovecot/auth-client
mode = 0660
user = vmail
group = mail
}
}
}
dict {
}
plugin {
}

 

 


 

 

Now let’s create the dovecot dovecot-sql.conf to communicate with MySQL

# joe /etc/dovecot-sql.conf

driver = mysql

connect = host=localhost dbname=mail user=mail password=mail
# The new name for MD5 is MD5-CRYPT so you might need to change this depending on version
default_pass_scheme = MD5
# Get the mailbox
user_query = SELECT ‘/var/vmail/%d/%n’ as home, ‘maildir:/var/vmail/%d/%n’ as mail, 150 AS uid, 12 AS gid,
concat(‘dirsize:storage=’, quota) AS quota FROM mailbox WHERE username = ‘%u’ AND active = ‘1’
# Get the password
password_query = SELECT username as user, password, ‘/var/vmail/%d/%n’ as userdb_home,
‘maildir:/var/vmail/%d/%n’ as userdb_mail, 150 as userdb_uid, 12 as userdb_gid FROM mailbox WHERE username
= ‘%u’ AND active = ‘1’
# If using client certificates for authentication, comment the above

# chmod 600 /etc/dovecot.conf
# chmod 600 /etc/dovecot-sql.conf
# chown vmail /etc/dovecot.conf
# chown vmail /etc/dovecot-sql.conf

Let’s install the postfix admin:
# cd /root/
# wget
http://ufpr.dl.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-2.3.2/postfixadmin-2.3.2.tar.gz

# tar -zxvf postfixadmin-2.3.2.tar.gz
# mv postfixadmin-2.3.2.tar.gz postfixadmin
# mv postfixadmin /usr/share/
# cd /usr/share/postfixadmin

# joe config.inc.php

And change the following fields:

$CONF[‘database_type’] = ‘mysql';
$CONF[‘database_host’] = ‘localhost';
$CONF[‘database_user’] = ‘mail';
$CONF[‘database_password’] = ‘mail';
$CONF[‘database_name’] = ‘mail';
$CONF[‘database_prefix’] = ”;

Now go to http://localhost/postfixadmin/setup.php and configure it.

Be the First to Comment!