#1486085 closed Bugs (fixed)
IMAP Error: Empty startup greeting
| Reported by: | waster | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.3.1 |
| Component: | IMAP connection | Version: | 0.3-stable |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Hello,
I've just started to upgrade 0.22. to 0.3 stable and got the following error in the error log after configuration:
"IMAP Error: Empty startup greeting"
I've checked imap.inc and tried to change buffer length at 623 line stream_get_line($conn->fp, 8192, "\r\n"); Login was successfull only after changing 8192 to 32?! Where is the problem?
Change History (7)
comment:1 Changed 4 years ago by waster
comment:2 Changed 4 years ago by waster
Nope, the same code in test php did not work.
Greeting from the IMAP server (Courier) is the following and it should be as $line, but stream_get_line returns string only if buffer length is less or equal 46 in my case, very strange:
- OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2008 Double Precision, Inc. See COPYING for distribution information.
comment:3 Changed 4 years ago by waster
fgets($conn,8192) work fine.
comment:4 Changed 4 years ago by alec
- Milestone changed from later to 0.3.1
Please, try with:
stream_get_line($conn->fp, 8192, "\n");
comment:5 Changed 4 years ago by waster
I've downgraded PHP 5.2.9 from Dotdeb to default 5.2.6 for Lenny and stream_get_line started to work fine. Some PHP bug?
comment:6 Changed 4 years ago by alec
- Resolution set to fixed
- Status changed from new to closed
Fixed in [587444f6].
comment:7 Changed 4 years ago by netbit
Just for documentation purposes, I'm running [4a941f73] under my production environment, and today the RoundCube suddenly started to drop the currently active sessions few minutes after the users logged in. The error log become full of "IMAP Error: Empty startup greeting", and before applying this patch ([587444f6]) I've restarted the Dovecot 1.2.5 service and the error was gone.

Bit if I'm trying to run the same IMAP connection code in test php it works fine.