I cannot get postfix / dovecot to work, I am also using postfixadmin. I have tried a number of how to's, installed and reinstalled a few times but no luck so far. I am running CentOS 6.2 on a hosted VDS. I am new to postfix and dovecot, and pretty new to Linux, I used to work with it a couple of years ago and I am getting back into it now whilst working on my webserver. I yum installed both dovecot and postfix, then altered the configs to what I've listed below. I have looked at many posts about MySQL postfix connection problems but can't get the solutions to work for me. The aim is to be able to host email for multiple domains on this vds, then maybe setup another for backup mx, but I need to get this one working first . This is a really long post with all my config info in it, but hopefully someone out there can help. TIA.
If I telnet localhost 25, I get:
then nothing. But for telnet localhost 143 (or 993) I get
Dovecot is not giving me any errors in maillog, but I am getting a few warnings for postfix which I am pretty sure is because it can't connect to MySQL:
main.cf:
/etc/postfix/mysql_virtual_alias_maps.cf
vi /etc/postfix/mysql_virtual_mailbox_maps.cf
/etc/postfix/mysql_virtual_alias_maps.cf
dovecot.conf
If I telnet localhost 25, I get:
Code:
220 mail.littleguy.com.au ESMTP Postfix
Code:
telnet: connect to address ::1: Connection refused
Dovecot is not giving me any errors in maillog, but I am getting a few warnings for postfix which I am pretty sure is because it can't connect to MySQL:
Code:
Jun 7 14:01:02 vds1 postfix/pickup[17640]: 8A8234998D: uid=0 from=<user@localhost>
Jun 7 14:01:02 vds1 postfix/cleanup[17645]: warning: connect to mysql server unix:/var/lib/mysql/mysql.sock: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
Jun 7 14:01:02 vds1 postfix/cleanup[17645]: warning: 8A8234998D: virtual_alias_maps map lookup problem for root@localhost.<mydomainname>.com.au
Jun 7 14:01:02 vds1 postfix/pickup[17640]: 8ADED4998D: uid=0 from=<user@localhost>
Jun 7 14:01:02 vds1 postfix/cleanup[17642]: warning: 8ADED4998D: virtual_alias_maps map lookup problem for root@localhost.<mydomainname>.com.au
Jun 7 14:01:02 vds1 postfix/pickup[17640]: 8B2794998D: uid=0 from=<user@localhost>
Jun 7 14:01:02 vds1 postfix/cleanup[17642]: warning: 8B2794998D: virtual_alias_maps map lookup problem for root@localhost.<mydomainname>.com.au
Jun 7 14:02:02 vds1 postfix/pickup[17640]: 8B4934998D: uid=0 from=<user@localhost>
Jun 7 14:02:02 vds1 postfix/cleanup[17645]: warning: 8B4934998D: virtual_alias_maps map lookup problem for root@localhost.<mydomainname>.com.au
main.cf:
Code:
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = mail.<mydomainname>.com
mydomain = <mydomainname>.com.au
myorigin = $mydomain
inet_interfaces = all
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_transport = virtual
virtual_mailbox_base = /etc/maildata
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_minimum_uid = 89
virtual_uid_maps = static:89
virtual_gid_maps = static:89
smtpd_tls_cert_file = /etc/ssl/postfix/postfix.pem
smtpd_tls_key_file = /etc/ssl/postfix/postfix.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:/var/spool/postfix/smtpd_tls_cache
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtp_tls_loglevel = 1
smtp_tls_cert_file = $smtpd_tls_cert_file
smtp_tls_key_file = $smtpd_tls_key_file
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:/var/spool/postfix/smtp_tls_scache
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
Code:
user = postfix
password = <password>
hosts = unix:/var/lib/mysql/mysql.sock -- I have tried 127.0.0.1 and localhost here, I can connect to mysql on either from the command line
dbname = postfix
query = SELECT goto FROM alias WHERE address='%s'
select_field = goto
table = alias
where_field = address
Code:
user = postfix
password = <password>
hosts = unix:/var/lib/mysql/mysql.sock
dbname = postfix
query = SELECT 1 FROM mailbox WHERE username='%s'
select_field = 1
table = mailbox
where_field = username
Code:
user = postfix
password = <password>
hosts = unix:/var/lib/mysql/mysql.sock
dbname = postfix
query = SELECT goto FROM alias WHERE address='%s'
select_field = goto
table = alias
where_field = address
Code:
# 2.0.9: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-220.17.1.el6.x86_64 x86_64 CentOS release 6.2 (Final)
auth_mechanisms = plain login
auth_realms = <mydomainname1>.com <mydomainname2>.com <mydomainname3>.com <mydomainname4>.com
first_valid_gid = 89
first_valid_uid = 89
last_valid_gid = 89
last_valid_uid = 89
listen =
mail_location = maildir:~/
passdb {
args = /etc/dovecot/dovecot-mysql.conf
driver = sql
}
plugin {
quota = maildir
}
service auth {
executable = /usr/libexec/dovecot/auth
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0666
user = postfix
}
user = nobody
}
ssl = no
ssl_cert = </etc/ssl/certs/dovecot/dovecot.pem
ssl_key = </etc/ssl/certs/dovecot/dovecot.key
userdb {
driver = prefetch
}
userdb {
args = /etc/dovecot/dovecot-mysql.conf
driver = sql
}
verbose_proctitle = yes
verbose_ssl = yes
protocol imap {
imap_client_workarounds = delay-newmail tb-extra-mailbox-sep
mail_plugins = quota imap_quota
}
protocol pop3 {
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
pop3_uidl_format = %08Xu%08Xv
}
protocol lda {
auth_socket_path = /var/run/dovecot/auth-master
hostname = mail.<mydomainname1>.com
postmaster_address = webmaster@<mydomainname1>.com
}