3

I'm installing GitLab for my work, I'm doing it on Ubuntu Server available 16.04.1 and everything is running pretty well.

The only thing I need to do now is to configure the Reply by email feature because we are interested about the concept so we want to enable it.

The good news is, on the GitLab website, there is a detailed how-to telling you how to put this in place. Basically, this feature uses Postfix and is based on Courier Mail Server (at least as I can understand). The bad news is, on this how-to, everything goes well but the really last part, about testing the final IMAP setup (i.e. Test the final setup section), fails every time.

So, when I try to retrieve the contents of the IMAP folder with the following command, as requested in the how-to:

telnet <my.server.here> 143

I get this result:

<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.

I looked for several logs files, and after 4 hours of research, I'm really lost.

The contents of the /var/log/mail.err is the following:

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

The contents of /var/log/mail.log is:

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

When I try something simple, that command below, it fails in the same way. So it seems to be related to PAM Authentication?

sudo authtest incoming <my_cool_pwd>

The output of the above command is:

ERR: authdaemon: s_connect() failed: No such file or directory
Authentication FAILED: No such file or directory

Exactly the same stuff. The thing is, I really don't know what file/directory is involved!

Any help would be really appreciated!

8

Finally I figured out what's going wrong after playing with the strace command.

The service courier-authdaemon, part of courier-imap package, wasn't launched automatically at startup for some reason.

To definitively fix this problem, execute the following:

  1. Define the courier-authdaemon service to run at startup: sudo systemctl enable courier-authdaemon.
  2. Start the courier-authdaemon service for the current session with sudo service courier-authdaemon start, or if you want you can just restart your server with sudo reboot.

After enabling the courier-authdaemon service, you can check that everything is OK by using the authtest command: sudo authtest <login> <pwd>.

You should have an output like:

    Authentication succeeded.

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

I used these resources to solve my problem:

So now I can continue to follow the GitLab tutorial.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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