0

I have raised a query with the below mentioned link, and i have below mentioned configuration in main.cf POSTFIX SASL Configuration

main.cf


alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
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
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname,<"all other destination list">
mydomain = <"my domain name">
myhostname = <"my hotname name">
mynetworks = <"ALL IPS">
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
relay_domains = $mydestination
relayhost = <"MY RELAY HOST SERVER DETAILS">
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
smtpd_sasl_type = cyrus
smtpd_sasl_path = smtpd
cyrus_sasl_config_path = /etc/postfix/sasl
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous

master.cf


#File has the below mentioned
smtp inet n - y - - smtpd #smtp inet n - n - 1 postscreen #smtpd pass - - - - - smtpd
#dnsblog unix - - n - 0 dnsblog
#tlsproxy unix - - n - 0 tlsproxy
#submission inet n - - - - smtpd

/etc/postfix/sasl/smtpd.conf


pwcheck_method: saslauthd mech_list: LOGIN PLAIN
saslauthd_path: private/saslauthd/mux

With the above configuration i get the below error postfix/smtpd[20980]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory postfix/smtpd[20980]: warning: unknown[]: SASL LOGIN authentication failed: generic failure

1
  • 1
    What is your Linux distribution? Oct 6 '20 at 13:42
1

Simply put: Postfix communicates with SASL (saslauthd) using files. In the configuration of both, you can specify the path to use. In that path, the following files will be created:

~# ls -l /var/spool/postfix/var/run/saslauthd/
total 4
srwxrwxrwx 1 root root 0 Feb 12 11:41 mux
-rw------- 1 root root 0 Feb 12 11:41 mux.accept
-rw------- 1 root root 7 Feb 12 11:41 saslauthd.pid

Chances are, your postfix process is chrooted. Which is a good thing from security point of view. This means though that postfix will write it's sasl stuff into /whatever-your-postfix-chroot-is/var/run/saslauthd/

I believe you should not specify a file in your path. So NOT:

saslauthd_path: private/saslauthd/mux

Because that would lead to postfix looking for private/saslauthd/mux/mux file. That's probably now what you intend.

Either leave that line out completely and use the default path, or specify the sasl path explicitly:

saslauthd_path: private/saslauthd/

So far for the Postfix side of things.

There is also the SASL side of things. In the saslauthd configuration, you have the OPTIONS parameter. Check out the -m parameter which is /var/run/saslauthd/ by default.

Since your postfix is probably chrooted, it does not have access to /var/run/saslauthd/ path. So change your SASL configuration to /whatever-your-postfix-chroot-is/private/saslauthd/ Like this: OPTIONS="-m /whatever-your-postfix-chroot-is/private/saslauthd/ -r"

And restart your saslauthd

systemctl restart saslauthd

If you still experience communication issues between Postfix and saslauthd, suggest you post the output of

ps -ef | grep sasl
0

The error message says: cannot connect to saslauthd server: No such file or directory. The two most likely explanations is either that saslauthd is not running, or that smtpd and saslauthd disagree on the name.

9
  • The daemon is running : i checked with the status command. But I didnt get your second point ---> or that smtpd and saslauthd disagree on the name. How can i check this ??
    – Naga
    Oct 6 '20 at 13:03
  • You can use the the command sudo lsof -c saslauthd | grep unix to see all unix domain sockets that saslauthd has open. You can also use sudo lsof -c smtpd | grep rtd to see if postfix is chrooted.
    – madcap
    Oct 6 '20 at 13:32
  • Actuall the command gives more output, but due to the space constraint, i have placed the first two line. ---> sudo lsof -c saslauthd | grep unix saslauthd 23203 root 3u unix 0xffff888079bbcc00 0t0 3194590 socket saslauthd 23203 root 5u unix 0xffff888079bbc400 0t0 3194591 /run/saslauthd/mux
    – Naga
    Oct 6 '20 at 14:02
  • sudo lsof -c smtpd | grep rtd --> this gives no output
    – Naga
    Oct 6 '20 at 14:02
  • Your lsof does not have the same output format as mine. For me, the third line contains the root directory for the process. The FD is "rtd" and the TYPE is "DIR" and NAME is "/var/spool/postfix". Try sudo lsof -c smtpd | more, and you can probably figure it out. You already have the pathname that sslauthd is using, which in not same as you have configured smtpd to use.
    – madcap
    Oct 6 '20 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.