You are not logged in.

#1 2012-05-21 21:59:50

XT
Member
Registered: 2012-05-21
Posts: 14

Courier-IMAP disconnecting at successful login

Hi,

I'm using an x64 Arch Linux Server and I've been very happy with Arch Linux so far, especially the Wiki was very helpful.
Unfortunately I've run into trouble with the courier imap server.
I'm autheticating via authdaemond via mysql (plain) and everything works fine, I can logon, send & receive mail etc. until after an (seemingly undefined) uptime the server disconnects after a successful login. All I get is

# telnet localhost 143
Trying ::1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2011 Double Precision, Inc.  See COPYING for distribution information.
0 LOGIN %user %wrongpass
0 NO Login failed.
1 LOGIN %user %pass
Connection closed by foreign host.

mail.log is full of

May 21 23:33:48 %host imapd: Connection, ip=[::ffff:%IP]
May 21 23:39:09 %host imapd: Connection, ip=[::ffff:%IP]
May 21 23:39:09 %host imapd: Connection, ip=[::ffff:%IP]
May 21 23:39:09 %host imapd: Connection, ip=[::ffff:%IP]
May 21 23:39:09 %host imapd: Connection, ip=[::ffff:%IP]
May 21 23:39:25 %host imapd: Connection, ip=[::ffff:%IP]
May 21 23:39:25 %host imapd: Connection, ip=[::ffff:%IP]
May 21 23:39:25 %host imapd: Connection, ip=[::ffff:%IP]
May 21 23:39:25 %host imapd: Connection, ip=[::ffff:%IP]
May 21 23:39:45 %host imapd: Connection, ip=[::1]

Where ::1 is telnet (obviously) and %IP is my mail client

Authetication itself (authdaemond) works, postfix (sending mail) still works and I can successfully use authtest

# authtest %user %pass
Authentication succeeded.

     Authenticated: %user  (uid 999, gid 999)
    Home Directory: /www/mail
           Maildir: %user@%host
             Quota: (none)
Encrypted Password: (none)
Cleartext Password: %pass
           Options: (none)

Restarting courier, authdaemond, mysqld does not help, rebooting temporarily fixes the problem.
A similar server on x86 doesn't have the problem but the config isn't entirely the same so I can't say it must be x64.
Not sure wether this is a bug or I'm missing something. Anyone able to help?

Thanks so far

Last edited by XT (2012-05-21 22:01:02)

Offline

#2 2012-05-24 10:11:14

XT
Member
Registered: 2012-05-21
Posts: 14

Re: Courier-IMAP disconnecting at successful login

I've found this discussion on the courier-imap mailing list:

> « HTML content follows »
>
> This is a very weird problem. I did a standard apt-get upgrade on Debian and 
> got Courier IMAP 4.9.3-4. On upgrade all worked fine, however within 2 hours 
> the imapd stopped acknowledging successful logins. When it works, it returns 
> “1 OK LOGIN Ok.”. When it stops working, it returns nothing. The state, as I 
> know it, is thus:

Check for the number of concurrent connections at that time. The server 
enforces an upper limit on the number of concurrent connections overall, and 
the maximum number from a given IP address. When the limit has been reached, 
the server stops accepting any more connections.

> ·         It will acknowledge and log failed logins
>
> ·         It will not acknowledge or log successful logins and it will not 
> accept commands after a valid login is supplied

If, for example, you're running NFS and the kernel hangs the user process on 
a stalled NFS request, that's still an active connection, for all intents 
and purposes. Until the process terminates, the connection exists. After 
some time elapses, a sufficient number of dead zombies made the number of 
active connections reach its maximum. That would be another possibility.

I'm not using NFS nor FAM/Gamin. I'll check on the number of connections next time it occurs though...

Update: It just happened again. MAXPERIP was set to 20 (now 50), i had 6 to 8 active connections plus the telnet from localhost didn't work either. So It's not the MAXPERIP setting either.

Update: Gamin is a dependency of courier-imap so I am actually using it... The only known solution is switching to fam (even though it is considered deprecated in arch). The corresponding bug report is http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=669146

Last edited by XT (2012-05-25 12:18:30)

Offline

#3 2012-05-27 22:26:08

p4l4cl][n
Member
Registered: 2011-11-16
Posts: 43

Re: Courier-IMAP disconnecting at successful login

I have the same issue, any idea when it will work with gamin?

Offline

#4 2012-05-27 22:35:21

p4l4cl][n
Member
Registered: 2011-11-16
Posts: 43

Re: Courier-IMAP disconnecting at successful login

Ok, I have another question... How can I switch to FAM? I get:

[paladin@jstation fam]$ sudo pacman -U fam-2.7.0-16-x86_64.pkg.tar.xz
loading packages...
resolving dependencies...
looking for inter-conflicts...
:: fam and gamin are in conflict. Remove gamin? [y/N] y
error: failed to prepare transaction (could not satisfy dependencies)
:: courier-imap: requires gamin
:: courier-maildrop: requires gamin

Any help will be very appreciated...

Thanks smile

Offline

#5 2012-05-28 08:11:20

zbyshek
Member
Registered: 2011-01-03
Posts: 3

Re: Courier-IMAP disconnecting at successful login

Killing gam_server helped for me. Not sure whats wrong with it...

Offline

#6 2012-05-29 13:31:26

XT
Member
Registered: 2012-05-21
Posts: 14

Re: Courier-IMAP disconnecting at successful login

It definetely is a gamin issue: http://sourceforge.net/mailarchive/foru … urier-imap
This explains why killing gam_server (and rebooting) helps (didn't test this myself yet).

p4l4cl][n wrote:

Ok, I have another question... How can I switch to FAM? I get:

[paladin@jstation fam]$ sudo pacman -U fam-2.7.0-16-x86_64.pkg.tar.xz
loading packages...
resolving dependencies...
looking for inter-conflicts...
:: fam and gamin are in conflict. Remove gamin? [y/N] y
error: failed to prepare transaction (could not satisfy dependencies)
:: courier-imap: requires gamin
:: courier-maildrop: requires gamin

Any help will be very appreciated...

Thanks smile

You should probably use
  -d, --nodeps         skip dependency version checks (-dd to skip all checks)

Offline

#7 2012-06-04 10:22:10

shaggystyle
Member
Registered: 2012-06-04
Posts: 6

Re: Courier-IMAP disconnecting at successful login

How were you able to build FAM?  I'm getting a ton of build errors in DNotify:

DNotify.c++:627:14: error: redefinition of ‘int DNotify::pipe_write_fd’
DNotify.c++:44:5: error: ‘int DNotify::pipe_write_fd’ previously defined here
DNotify.c++:628:14: error: redefinition of ‘int DNotify::pipe_read_fd’
DNotify.c++:45:5: error: ‘int DNotify::pipe_read_fd’ previously defined here
DNotify.c++:629:32: error: redefinition of ‘volatile sig_atomic_t DNotify::queue_overflowed’
DNotify.c++:46:23: error: ‘volatile sig_atomic_t DNotify::queue_overflowed’ previously defined here
DNotify.c++:630:32: error: redefinition of ‘volatile sig_atomic_t DNotify::queue_changed’
DNotify.c++:47:23: error: ‘volatile sig_atomic_t DNotify::queue_changed’ previously defined here
DNotify.c++:631:36: error: redefinition of ‘int DNotify::change_queue [1024]’
DNotify.c++:48:5: error: ‘int DNotify::change_queue [1024]’ previously declared here
DNotify.c++:632:23: error: redefinition of ‘volatile int DNotify::queue_head’
DNotify.c++:49:14: error: ‘volatile int DNotify::queue_head’ previously defined here
DNotify.c++:633:23: error: redefinition of ‘volatile int DNotify::queue_tail’
DNotify.c++:50:14: error: ‘volatile int DNotify::queue_tail’ previously defined here
DNotify.c++:634:32: error: redefinition of ‘void (* DNotify::ehandler)(dev_t, ino_t, int)’
DNotify.c++:51:23: error: ‘void (* DNotify::ehandler)(dev_t, ino_t, int)’ previously declared here
DNotify.c++:636:50: error: redefinition of ‘DNotify::DirWatch* DNotify::dir_hash [367]’
DNotify.c++:53:20: error: ‘DNotify::DirWatch* DNotify::dir_hash [367]’ previously declared here
DNotify.c++:637:53: error: redefinition of ‘DNotify::FileWatch* DNotify::file_hash [823]’
DNotify.c++:54:21: error: ‘DNotify::FileWatch* DNotify::file_hash [823]’ previously declared here
DNotify.c++:639:17: error: redefinition of ‘struct DNotify::FileWatch’
DNotify.c++:56:17: error: previous definition of ‘struct DNotify::FileWatch’
DNotify.c++:648:17: error: redefinition of ‘struct DNotify::DirWatch’
DNotify.c++:65:17: error: previous definition of ‘struct DNotify::DirWatch’
DNotify.c++:658:17: error: redefinition of ‘struct DNotify::ChangeEventData’
DNotify.c++:75:17: error: previous definition of ‘struct DNotify::ChangeEventData’
DNotify.c++:664:1: error: redefinition of ‘DNotify::DNotify(Monitor::EventHandler)’
DNotify.c++:81:1: error: ‘DNotify::DNotify(Monitor::EventHandler)’ previously defined here
DNotify.c++:670:1: error: redefinition of ‘DNotify::~DNotify()’
DNotify.c++:87:1: error: ‘DNotify::~DNotify()’ previously defined here
DNotify.c++:695:1: error: redefinition of ‘static void DNotify::overflow_signal_handler(int, siginfo_t*, void*)’
DNotify.c++:112:1: error: ‘static void DNotify::overflow_signal_handler(int, siginfo_t*, void*)’ previously defined here
DNotify.c++:713:1: error: redefinition of ‘static void DNotify::signal_handler(int, siginfo_t*, void*)’
DNotify.c++:130:1: error: ‘static void DNotify::signal_handler(int, siginfo_t*, void*)’ previously defined here
DNotify.c++:748:1: error: redefinition of ‘static bool DNotify::is_active()’
DNotify.c++:165:1: error: ‘static bool DNotify::is_active()’ previously defined here
DNotify.c++:781:1: error: redefinition of ‘static DNotify::DirWatch* DNotify::lookup_dirwatch(int)’
DNotify.c++:198:1: error: ‘static DNotify::DirWatch* DNotify::lookup_dirwatch(int)’ previously defined here
DNotify.c++:804:1: error: redefinition of ‘static DNotify::DirWatch* DNotify::lookup_dirwatch(dev_t, ino_t)’
DNotify.c++:221:1: error: ‘static DNotify::DirWatch* DNotify::lookup_dirwatch(dev_t, ino_t)’ previously defined here
DNotify.c++:826:1: error: redefinition of ‘static DNotify::FileWatch* DNotify::lookup_filewatch(dev_t, ino_t)’
DNotify.c++:243:1: error: ‘static DNotify::FileWatch* DNotify::lookup_filewatch(dev_t, ino_t)’ previously defined here
DNotify.c++:849:1: error: redefinition of ‘static void DNotify::hash_dirwatch(DNotify::DirWatch*)’
DNotify.c++:266:1: error: ‘static void DNotify::hash_dirwatch(DNotify::DirWatch*)’ previously defined here
DNotify.c++:860:1: error: redefinition of ‘static void DNotify::hash_filewatch(DNotify::FileWatch*)’
DNotify.c++:277:1: error: ‘static void DNotify::hash_filewatch(DNotify::FileWatch*)’ previously defined here
DNotify.c++:869:1: error: redefinition of ‘static void DNotify::unhash_dirwatch(DNotify::DirWatch*)’
DNotify.c++:286:1: error: ‘static void DNotify::unhash_dirwatch(DNotify::DirWatch*)’ previously defined here
DNotify.c++:888:1: error: redefinition of ‘static void DNotify::unhash_filewatch(DNotify::FileWatch*)’
DNotify.c++:305:1: error: ‘static void DNotify::unhash_filewatch(DNotify::FileWatch*)’ previously defined here
DNotify.c++:907:1: error: redefinition of ‘static Monitor::Status DNotify::watch_dir(const char*, dev_t, ino_t)’
DNotify.c++:324:1: error: ‘static Monitor::Status DNotify::watch_dir(const char*, dev_t, ino_t)’ previously defined here
DNotify.c++: In function ‘char* dirname_dup(const char*)’:
DNotify.c++:956:1: error: redefinition of ‘char* dirname_dup(const char*)’
DNotify.c++:373:1: error: ‘char* dirname_dup(const char*)’ previously defined here
DNotify.c++: At global scope:
DNotify.c++:966:1: error: redefinition of ‘Monitor::Status DNotify::express(const char*, stat*)’
DNotify.c++:383:1: error: ‘virtual Monitor::Status DNotify::express(const char*, stat*)’ previously defined here
DNotify.c++:1026:1: error: redefinition of ‘Monitor::Status DNotify::revoke(const char*, dev_t, ino_t)’
DNotify.c++:443:1: error: ‘virtual Monitor::Status DNotify::revoke(const char*, dev_t, ino_t)’ previously defined here
DNotify.c++:1071:1: error: redefinition of ‘static void DNotify::all_watches_changed()’
DNotify.c++:488:1: error: ‘static void DNotify::all_watches_changed()’ previously defined here
DNotify.c++:1090:1: error: redefinition of ‘static void DNotify::read_handler(int, void*)’
DNotify.c++:507:1: error: ‘static void DNotify::read_handler(int, void*)’ previously defined here

*Edit: apologies to moderator for incorrect tagging

Last edited by shaggystyle (2012-06-04 12:39:06)

Offline

#8 2012-06-04 12:22:09

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: Courier-IMAP disconnecting at successful login

shaggystyle, please use [ code ] tags around your listing instead of [ quote ] ones. This will put the content in a scrollable window making it far better readable.


To know or not to know ...
... the questions remain forever.

Offline

#9 2012-06-04 12:43:43

shaggystyle
Member
Registered: 2012-06-04
Posts: 6

Re: Courier-IMAP disconnecting at successful login

Also, since it isn't clear from this thread.  Killing gam_server and disabling IDLE seems to bring back imap functionality (without rebooting the box). To do this you have to remove the IDLE option from the IMAP_CAPABILITY string as well as setting IMAP_ENHACNEDIDLE:0 and IMAP_USELOCKS:0.

I wasn't really all that attached to IDLE so it's no big loss for me.  I'll keep an eye on the gamin patches and see if this bug ever gets resolved.  but for now at least my mail server is stable again.

Offline

#10 2012-06-09 09:04:30

Cagnulein
Member
From: Modena, Italy
Registered: 2006-04-03
Posts: 260
Website

Re: Courier-IMAP disconnecting at successful login

same issue here (arch x64).
Solved too with @shaggystyle istructions

Offline

#11 2012-07-31 12:05:11

XT
Member
Registered: 2012-05-21
Posts: 14

Re: Courier-IMAP disconnecting at successful login

FYI: The issue just came up on my x86 machine when upgrading gamin from 0.1.10-5 to 0.1.10-6. Downgrading "solved" it.
Also, the kown "fix" seems to work.

Last edited by XT (2012-08-01 08:39:18)

Offline

#12 2012-07-31 16:22:01

mkaito
Member
From: Spain
Registered: 2010-06-12
Posts: 126
Website

Re: Courier-IMAP disconnecting at successful login

Is there a bug filed for this, in arch or upstream? I've been having this issue for a while now, and I'd like to know if the involved developers and maintainers are aware of this issue, and what their word is on it.


Fear me! I have root! Sometimes...

Offline

#13 2012-08-01 08:38:44

XT
Member
Registered: 2012-05-21
Posts: 14

Re: Courier-IMAP disconnecting at successful login

This should be the thing:
https://bugzilla.gnome.org/show_bug.cgi?id=678813
though I don't see any context to the number of files

It also refers to a discussion on ubuntu forums:
http://ubuntuforums.org/showthread.php?t=1970712

Offline

#14 2012-08-01 16:34:19

mkaito
Member
From: Spain
Registered: 2010-06-12
Posts: 126
Website

Re: Courier-IMAP disconnecting at successful login

Well that looks bleak. Thanks for sharing your findings, XT.

I wasn't very attached to IDLE, so I guess that's our fix for the time being.


Fear me! I have root! Sometimes...

Offline

Board footer

Powered by FluxBB