Mail authentication not working: Connection closed by foreign host


2016-11-16 13:14:15 UTC


2017-04-24 11:42:10 UTC


Was this article helpful?

Have more questions?

Submit a request

Mail authentication not working: Connection closed by foreign host

Applicable to:

  • Plesk 12.5 for Linux


Unable to login to mailbox via any mail client.

Unable to login to IMAP using telnet :

# telnet localhost 143
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

In /var/log/audit/audit.log the following can be found:

type=AVC msg=audit(1460369603.662:31325): avc:  denied  { setuid } for  pid=14898 comm="imaplogin" capability=7  scontext=system_u:system_r:courier_pop_t:s0 tcontext=system_u:sy
stem_r:courier_pop_t:s0 tclass=capability
type=SYSCALL msg=audit(1460369603.662:31325): arch=c000003e syscall=105 success=yes exit=0 a0=1e a1=0 a2=7ff32d06e7b8 a3=7ffca8bb41c0 items=0 ppid=12489 pid=14898 auid=429496729
5 uid=30 gid=31 euid=30 suid=30 fsuid=30 egid=31 sgid=31 fsgid=31 tty=(none) ses=4294967295 comm="imaplogin" exe="/usr/sbin/imaplogin" subj=system_u:system_r:courier_pop_t:s0 ke
type=AVC msg=audit(1460369608.364:31326): avc: denied { read write } for pid=14915 comm="imaplogin" path="/run/couriersslcache" dev="tmpfs" ino=1361553 scontext=system_u:syst
em_r:courier_pop_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file


SELinux is blocking connection to IMAP.


  1. Remove module

    # semodule -r courier
  2. Restore context

    # restorecon -R /var
    # restorecon -R /run
  3. Restart courier-imap services:

    # service courier-imapd restart
    # service courier-imaps restart
    # service courier-authdaemon restart
Have more questions? Submit a request
Please sign in to leave a comment.