dovecot-postfix-sasl-squirrelmail issue

745 views Asked by At

I'm just setting this webserver up for fun and learning so if nobody knows what my problem is its ok.

I did a search of stackoverflow/google already and didn't find any solution.

I am able to log into the test user that I made in squirrel mail, but unable to send/receive email.

in error log:

Jun 17 03:52:34 vps46420 postfix/smtpd[2490]: connect from localhost[127.0.0.1]
Jun 17 03:52:34 vps46420 postfix/smtpd[2490]: warning: SASL: Connect to /var/spool/postfix/private/auth failed: No such file or directory
Jun 17 03:52:34 vps46420 postfix/smtpd[2490]: fatal: no SASL authentication mechanisms
Jun 17 03:52:35 vps46420 postfix/master[2441]: warning: process /usr/lib/postfix/smtpd pid 2490 exit status 1
Jun 17 03:52:35 vps46420 postfix/master[2441]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling

dovecot -n:

/var/spool/postfix$ dovecot -n
# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-042stab106.4 x86_64 Debian 7.8 ext4
mail_location = maildir:/home/john/Maildir/%d/%n
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix = 
}
passdb {
  args = scheme=CRYPT username_format=%u /etc/dovecot/users
  driver = passwd-file
}
plugin {
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
}
protocols = " imap pop3"
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
}
ssl_cert = </etc/dovecot/dovecot.pem
ssl_key = </etc/dovecot/private/dovecot.pem
userdb {
  args = username_format=%u /etc/dovecot/users
  driver = passwd-file
}

postconf -n:

/var/spool/postfix$ postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
inet_interfaces = all
mailbox_size_limit = 0
mydestination = vps46420.vps.ovh.ca, localhost.vps.ovh.ca, , localhost
myhostname = vps46420.vps.ovh.ca
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 (Debian/GNU)
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = /var/spool/postfix/private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_mailbox_domains = hash:/etc/postfix/virtual_mailbox_domains
virtual_mailbox_maps = hash:/etc/postfix/virtual_mailbox_users

I can post additional details if necessary.

1

There are 1 answers

1
Nianliang On

Obviously, the process smtpd is failed to start as the Unix socket file auth is not created by Dovecot. Confirm that by run:

$ sudo ls -l /var/spool/postfix/private/auth

It should output "No such file or directory".

Try appending this line auth_mechanisms = plain login into dovecot.conf Then Restart Dovecot, and check the socket again.

$ sudo service dovecot restart

You also need to confirm that Dovecot is running, on Debian 8:

$ sudo tail /var/log/syslog

or check if the port 143 and/or 993 is opened by:

$ sudo netstat -plnt

If the port is not presents, add following lines to dovecot.conf:

service imap-login {
  inet_listener imap {
    port = 143
  }
  inet_listener imaps {
    port = 993
  }
}

I'd recommend to read my blog post for setup a simple and secure mail server.