courier-authlib:s_connect() 失败:没有这样的文件或目录

SiZ*_*OUS 4 server email postfix pam gitlab

我正在为我的工作安装GitLab,我在Ubuntu Server 16.04.1 上进行安装,并且一切运行良好。

我现在唯一需要做的就是配置通过电子邮件回复功能,因为我们对这个概念感兴趣,所以我们想启用它。

好消息是,在上GitLab网站上,有一个详细的操作方法,告诉你如何把这个到位。基本上,此功能使用 Postfix 并基于 Courier Mail Server(至少据我所知)。在坏消息是,这个如何做,一切顺利,但真正最后一部分,有关测试的最终IMAP设置(即测试最后的安装部分),失败每次。

所以,当我尝试使用以下命令检索IMAP文件夹的内容,如要求如何做

telnet <my.server.here> 143
Run Code Online (Sandbox Code Playgroud)

我得到这个结果:

<my_name>@<my_host>:~$ telnet <ip> 143
Trying <ip>...
Connected to <ip>.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION] Courier-IMAP ready. Copyright 1998-2011 Double Precision, Inc.  See COPYING for distribution information.
a login incoming <my_cool_pwd>
* BYE Temporary problem, please try again later
Connection closed by foreign host.
Run Code Online (Sandbox Code Playgroud)

我找了几个日志文件,经过4个小时的研究,我真的迷路了。

内容/var/log/mail.err如下:

Oct 18 17:37:23 <my_host> imapd: authdaemon: s_connect() failed: No such file or directory
Oct 18 17:37:23 <my_host> imapd: authentication error: No such file or directory
Run Code Online (Sandbox Code Playgroud)

内容/var/log/mail.log为:

Oct 18 17:37:10 <my_host> imapd: Connection, ip=[::ffff:xxx.xxx.xxx.xxx]
Oct 18 17:37:23 <my_host> imapd: authdaemon: s_connect() failed: No such file or directory
Oct 18 17:37:23 <my_host> imapd: LOGIN FAILED, user=incoming, ip=[::ffff:xxx.xxx.xxx.xxx]
Oct 18 17:37:23 <my_host> imapd: authentication error: No such file or directory
Run Code Online (Sandbox Code Playgroud)

当我尝试一些简单的东西时,下面的命令,它以同样的方式失败。所以它似乎与PAM 身份验证有关

sudo authtest incoming <my_cool_pwd>
Run Code Online (Sandbox Code Playgroud)

上面命令的输出是:

ERR: authdaemon: s_connect() failed: No such file or directory
Authentication FAILED: No such file or directory
Run Code Online (Sandbox Code Playgroud)

完全一样的东西。问题是,我真的不知道涉及到什么文件/目录!

任何帮助将非常感激!

SiZ*_*OUS 11

最后,我在使用strace命令后弄清楚出了什么问题。

出于某种原因courier-authdaemon,作为courier-imap包的一部分的服务没有在启动时自动启动。

要彻底解决此问题,请执行以下操作:

  1. 定义courier-authdaemon在启动时运行的服务:sudo systemctl enable courier-authdaemon.
  2. 使用 启动courier-authdaemon当前会话的服务sudo service courier-authdaemon start,或者如果需要,您可以使用 重新启动服务器sudo reboot

启用courier-authdaemon服务后,您可以使用以下authtest命令检查一切是否正常: sudo authtest <login> <pwd>

您应该有如下输出:

    Authentication succeeded.

     Authenticated: <login>  (system username: <login>)
    Home Directory: /home/<login>
           Maildir: (none)
             Quota: (none)
Encrypted Password: <hidden>
Cleartext Password: <hidden>
           Options: (none)
Run Code Online (Sandbox Code Playgroud)

我使用这些资源来解决我的问题:

所以现在我可以继续关注GitLab 教程了