CentOS 6.5 Webmail Server: warning: SASL: Connect to private/auth failed: No such file or directory
Looks like mismatch of dovecot configuration and postfix configuration.
In dovecot configuration (especially in section service auth, you just define two socket auth-client and auth-master. Add one section unix_listener
with content
unix_listener /var/spool/postfix/private/auth {
mode = 0660
# Assuming the default Postfix user and group
user = postfix
group = postfix
}
See this page for further documentation.
Related videos on Youtube
Brandon Nguyen
Updated on September 18, 2022Comments
-
Brandon Nguyen almost 2 years
I'm trying to run a webmail server on CentOS with Postfix, Docecot and Roundcube. Whenever I try to send mail or send a test email to my server it fails. I can login so looks like Dovecot is okay.
Here is my server log:
Jul 2 14:01:42 phantastyc postfix/smtpd[20154]: warning: SASL: Connect to private/auth failed: No such file or directory Jul 2 14:01:42 phantastyc postfix/smtpd[20154]: fatal: no SASL authentication mechanisms Jul 2 14:01:43 phantastyc postfix/master[18459]: warning: process /usr/libexec/postfix/smtpd pid 20154 exit status 1 Jul 2 14:01:43 phantastyc postfix/master[18459]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
When I send a test email to my server:
Jul 2 14:01:42 phantastyc postfix/smtpd[20154]: connect from mail-ve0-f178.google.com[209.85.128.178]
Then it displays the same error as above.
And when I compose mail with Roundcube, it just hangs at
Sending message...
and after a while saysSMTP Error (-1): Connection to server failed
and the logs say the same message.Here is my
postconf -n
output:alias_database = $alias_maps alias_maps = hash:/etc/postfix/aliases broken_sasl_auth_clients = yes command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 html_directory = no inet_interfaces = all inet_protocols = ipv4 mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $myhostname, localhost.$mydomain, localhost newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES relay_domains = * sample_directory = /usr/share/doc/postfix-2.6.6/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtp_sasl_type = dovecot smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $mydomain smtpd_sasl_path = private/auth smtpd_sasl_security_options = noanonymous smtpd_sasl_tls_security_options = $smtpd_sasl_security_options smtpd_sasl_type = dovecot unknown_local_recipient_reject_code = 550 virtual_alias_maps = hash:/etc/postfix/vmail_aliases virtual_gid_maps = static:2222 virtual_mailbox_base = /var/vmail virtual_mailbox_domains = hash:/etc/postfix/vmail_domains virtual_mailbox_maps = hash:/etc/postfix/vmail_mailbox virtual_minimum_uid = 2222 virtual_transport = virtual virtual_uid_maps = static:2222
Here is
doveconf -n
output:# 2.0.9: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-042stab088.4 i686 CentOS release 6.5 (Final) reiserfs auth_mechanisms = plain login default_login_user = vmail disable_plaintext_auth = no first_valid_gid = 2222 first_valid_uid = 2222 listen = * mail_access_groups = vmail mail_location = maildir:/var/vmail/%d/%n passdb { args = scheme=SHA1 /etc/dovecot/passwd driver = passwd-file } protocols = imap lmtp service auth { unix_listener auth-client { group = vmail mode = 0660 user = vmail } unix_listener auth-master { group = vmail mode = 0660 user = vmail } user = root } service imap-login { process_min_avail = 1 user = vmail } ssl = no userdb { args = uid=2222 gid=2222 home=/var/vmail/%d/%n allow_all_users=yes driver = static }
And when I do:
[root@phantastyc ~]# ls -l /var/spool/postfix/private/auth ls: cannot access /var/spool/postfix/private/auth: No such file or directory
Edit 1
It sort of worked, except there's now a new error message:
Jul 3 03:03:14 phantastyc postfix/trivial-rewrite[23348]: fatal: open database /etc/postfix/vmail_domains.db: No such file or directory Jul 3 03:03:15 phantastyc postfix/master[18459]: warning: process /usr/libexec/postfix/trivial-rewrite pid 23348 exit status 1 Jul 3 03:03:15 phantastyc postfix/master[18459]: warning: /usr/libexec/postfix/trivial-rewrite: bad command startup -- throttling
Also Google (the server where I sent the test email from) returns a delay error saying the connection to the server was dropped and that it'll keep retrying.
Edit 2
After fixing the problem above using
postmap
, I ran into another problem.Here's some logging:
Jul 4 21:51:20 phantastyc postfix/smtpd[13016]: connect from mail-vc0-f171.google.com[209.85.220.171] Jul 4 21:51:21 phantastyc postfix/trivial-rewrite[13019]: warning: do not list domain phantastyc.tk in BOTH mydestination and virtual_mailbox_domains Jul 4 21:51:21 phantastyc postfix/smtpd[13016]: NOQUEUE: reject: RCPT from mail-vc0-f171.google.com[209.85.220.171]: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in local recipient table; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-vc0-f171.google.com> Jul 4 21:51:21 phantastyc postfix/smtpd[13016]: disconnect from mail-vc0-f171.google.com[209.85.220.171]
Not in local table?
Here is
/etc/postfix/vmail_domains
:[email protected] phantastyc.tk/admin [email protected] phantastyc.tk/bnguyen [email protected] oa2019.tk/admin [email protected] oa2019.tk/bnguyen
What else did I screw up?
Edit 3
Since the log said I couldn't have the domain name in both
mydestination
andvirtual_mailbox_domains
I removed it from themydestination
field and now outgoing mail is fine. Incoming mail is still a little unsteady.Jul 4 22:10:41 phantastyc postfix/smtpd[13160]: connect from mail-vc0-f173.google.com[209.85.220.173] Jul 4 22:10:41 phantastyc postfix/smtpd[13160]: 514F213E0E3A: client=mail-vc0-f173.google.com[209.85.220.173] Jul 4 22:10:41 phantastyc postfix/cleanup[13164]: 514F213E0E3A: message-id=<CADZik+X9uC8QGJZtNoWKk_Aw0bdCP49DUVgdWkhVBCZVOuz3cg@mail.gmail.com> Jul 4 22:10:41 phantastyc postfix/qmgr[13153]: 514F213E0E3A: from=<[email protected]>, size=1930, nrcpt=1 (queue active) Jul 4 22:10:41 phantastyc postfix/virtual[13165]: 514F213E0E3A: to=<[email protected]>, relay=virtual, delay=0.4, delays=0.32/0.01/0/0.06, dsn=4.2.0, status=deferred (delivery failed to mailbox /var/vmail/phantastyc.tk/admin: cannot open file: Is a directory) Jul 4 22:10:41 phantastyc postfix/smtpd[13160]: disconnect from mail-vc0-f173.google.com[209.85.220.173] Jul 4 22:11:08 phantastyc postfix/smtpd[13160]: connect from localhost.localdomain[127.0.0.1] Jul 4 22:11:08 phantastyc postfix/smtpd[13160]: 4292A13E0E3B: client=localhost.localdomain[127.0.0.1], sasl_method=LOGIN, [email protected]
This freaks me out:
(delivery failed to mailbox /var/vmail/phantastyc.tk/admin: cannot open file: Is a directory)
What's up with that?
Here is
ls /var/vmail/phantastyc.tk/admin
:cur dovecot.index.log dovecot.mailbox.log dovecot.uidlist dovecot.uidvalidity dovecot.uidvalidity.53b3965c new subscriptions tmp
Here is
/etc/postfix/vmail_domains
:[email protected] phantastyc.tk/admin [email protected] phantastyc.tk/bnguyen [email protected] oa2019.tk/admin [email protected] oa2019.tk/bnguyen
Edit 4
Sorry I was rushing ahead of myself. I should've done that first. A simple search found that a trailing slash was missing on the mailbox directory. My mail server now works fine.
-
Brandon Nguyen almost 10 yearsThanks for the
postmap
solution. Except we have more problems. See edits above. -
Brandon Nguyen almost 10 yearsShould I keep editing it or make new threads?
-
masegaloeh almost 10 yearsWell I suggest that you post another question. NOTE: Please invest some time to googling the error message in your problem. Your problem has been asked and answered many times in serverfault or in other forums.
-
Brandon Nguyen almost 10 yearsSorry I was rushing ahead of myself. I should've done that first. A simple search found that a trailing slash was missing on the mailbox directory. My mail server now works fine. Thanks for your help and sorry if I was really dumb.