1

I am trying to set up a mail server that has multi domain support using Postfix+Dovecot+mySQL. I was following this guide.

I seem to have everything set up and the server is sending the dovecot SSL cert (throwing a cert exception dialog in my client) however mail is not sending or receiving.

/var/log/mail_err returns this postfix error:

Connect to private/auth failed: Connection refused

/var/log/mail.log is returning a bit more detail:

Sep 25 19:33:58 localhost postfix/postscreen[11483]: CONNECT from [MYIPADDRESS]:58837 to [MYSERVERIPADDRESS]:25
Sep 25 19:33:58 localhost postfix/postscreen[11483]: PASS OLD [MYIPADDRESS]:58837
Sep 25 19:34:01 localhost postfix/smtpd[11486]: connect from MYHOSTMASK[MYIPADDRESS]
Sep 25 19:34:01 localhost postfix/smtpd[11486]: warning: SASL: Connect to private/auth failed: Connection refused
Sep 25 19:34:01 localhost postfix/smtpd[11486]: fatal: no SASL authentication mechanisms
Sep 25 19:34:02 localhost postfix/master[4556]: warning: process /usr/lib/postfix/smtpd pid 11486 exit status 1
Sep 25 19:34:02 localhost postfix/master[4556]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling
Sep 25 19:34:02 localhost postfix/postscreen[11483]: CONNECT from [MYIPADDRESS]:58839 to [MYSERVERIPADDRESS]:25
Sep 25 19:34:02 localhost postfix/postscreen[11483]: PASS OLD [MYIPADDRESS]:58839
Sep 25 19:35:02 localhost postfix/smtpd[11780]: connect from MYHOSTMASK[MYIPADDRESS]
Sep 25 19:35:49 localhost dovecot: auth-worker: mysql(127.0.0.1): Connected to database mailserver
Sep 25 19:35:49 localhost dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=MYIPADDRESS, lip=MYSERVERIPADDRESS, mpid=11804, TLS
Sep 25 19:38:07 localhost postfix/anvil[11379]: statistics: max connection rate 1/60s for (submission:MYIPADDRESS) at Sep 25 19:28:57
Sep 25 19:38:07 localhost postfix/anvil[11379]: statistics: max connection count 1 for (submission:MYIPADDRESS) at Sep 25 19:28:57
Sep 25 19:38:07 localhost postfix/anvil[11379]: statistics: max cache size 2 at Sep 25 19:28:57
Sep 25 19:39:02 localhost postfix/smtpd[11780]: lost connection after UNKNOWN from MYHOSTMASK[MYIPADDRESS]
Sep 25 19:39:02 localhost postfix/smtpd[11780]: disconnect from MYHOSTMASK[MYIPADDRESS]
Sep 25 19:39:02 localhost postfix/smtpd[11945]: connect from MYHOSTMASK[MYIPADDRESS]
Sep 25 19:39:03 localhost postfix/smtpd[11945]: warning: SASL: Connect to private/auth failed: Connection refused
Sep 25 19:39:03 localhost postfix/smtpd[11945]: fatal: no SASL authentication mechanisms
Sep 25 19:39:04 localhost postfix/master[4556]: warning: process /usr/lib/postfix/smtpd pid 11945 exit status 1

Again, I am not receiving or able to send mail. It does seem that postfix is crashing, what with the premature exit. I'm out of ideas and I'd really prefer not to wipe everything out and start the setup all over again. Any thoughts? This is a VPS running on Ubuntu 12.04

EDIT

postconf -n output:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
inet_protocols = ipv4
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = localhost
myhostname = lightningcoders.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/dovecot.pem
smtpd_tls_key_file = /etc/ssl/private/dovecot.pem
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = lmtp:unix:private/dovecot-lmtp

postfix master config:

root@orion:~# cat /etc/postfix/master.cf | grep ^smtp
smtp      inet  n       -       -       -       -       smtpd
smtp      inet  n       -       -       -       1       postscreen
smtpd     pass  -       -       -       -       -       smtpd
smtp      unix  -       -       -       -       -       smtp

EDIT 2:

root@orion:/home/jknipp# ls -ld /var/spool/postfix/private/auth
srw-rw-rw- 1 postfix postfix 0 Sep 25 02:38 /var/spool/postfix/private/auth

As for the dovecot config:

2.0.19: /etc/dovecot/dovecot.conf
# OS: Linux 3.9.3-x86_64-linode33 x86_64 Ubuntu 12.04.3 LTS ext3
auth_mechanisms = plain login
mail_location = maildir:/var/mail/vhosts/%d/%n
mail_privileged_group = mail
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocols = imap pop3 lmtp
ssl = required
ssl_cert = </etc/ssl/certs/dovecot.pem
ssl_key = </etc/ssl/private/dovecot.pem
userdb {
  args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
  driver = static
}

My associate has set up some pretty strict initial firewall rules, that is only opening ports that are needed. Currently these ports are open: 22,10000,25,587,993,143,110,465,21, 80, 443, 6667. Do I need to open a specific port?

4
  • Add the output of postconf -n and cat /etc/postfix/master.cf | grep ^smtp to the question
    – ALex_hha
    Sep 25, 2013 at 19:57
  • And what about ls -ld /var/spool/postfix/private/auth ?
    – ALex_hha
    Sep 25, 2013 at 20:33
  • Post the output of doveconf -n as well. As you can see Postfix can not connect or use the SASL auth socket provided by Dovecot. You need to figure out why. Is Dovecot even running properly?
    – daff
    Sep 25, 2013 at 20:34
  • @daff any ideas, sir? Should I set the firewall to allow any destination port where the originating IP is my server's? Sep 27, 2013 at 12:31

1 Answer 1

7

Based on your edits I don't see that you have configured Dovecot's auth socket listener at all. It is number 34 and 35 of the Dovecot section in the guide you linked.

If you are using the conf.d directory structure (as suggested in the guide) make sure all the relevant sections like conf.d/10-master.conf are included and where they are supposed to be.

After you fixed or added these, restart Dovecot and doveconf -n should contain the following somewhere:

...
  unix_listener /var/spool/postfix/private/auth {
    mode = 0666
    user = postfix
    group = postfix
  }
...

You don't need to open any special ports on you firewall since Postfix and Dovecot are on the same machine and Postfix talks to Dovecot via the socket listener the above directives configure.

1
  • Server fault Email 1:1 And the Lord said, let email work correctly... 1:2 and it did! thanks! Sep 28, 2013 at 0:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .