Opened 19 months ago
Closed 19 months ago
#1488176 closed Bugs (wontfix)
IMAP PERMANENTFLAG support missing in IMail
| Reported by: | jimbullington | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.7-beta |
| Component: | IMAP connection | Version: | 0.6 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
I have a client who is using IMail mail server software. The current IMail IMAP server does not appear to support the $Forwarded flag or permanent keywords. The displayed symptom was that forwarded messages were not being stored in the Sent folder. This was due to the previous STORE command that sets the forwarded flag being rejected by the IMAP server.
The server rejects the UID STORE xxx +FLAGS.SILENT ($Forwarded) command with a BAD UID Invalid Syntax message. When a folder is selected, no PERMANENTFLAG response is sent by the server. It's probably the only IMAP server in the world that does not support this, but I still have to work with it. Here is the patch I developed to work around this - I've tested on the IMail IMAP server as well as a server that supports the flag.
Index: program/include/rcube_imap_generic.php
===================================================================
--- program/include/rcube_imap_generic.php (revision 5405)
+++ program/include/rcube_imap_generic.php (working copy)
@@ -1852,6 +1852,15 @@
return false;
}
+ // Don't allow FORWARDED flag to be set if IMAP server does not support
+ // a permanent $Forwarded flag or user-defined keywords
+ if ($flag == 'FORWARDED') {
+ if (!$this->data['PERMANENTFLAGS'] ||
+ !in_array('$Forwarded', $this->data['PERMANENTFLAGS']) ||
+ !in_array('\*', $this->data['PERMANENTFLAGS']))
+ return false;
+ }
+
// Clear internal status cache
if ($flag == 'SEEN') {
unset($this->data['STATUS:'.$mailbox]['UNSEEN']);
Change History (6)
comment:1 Changed 19 months ago by alec
- Milestone changed from later to 0.7-beta
comment:2 follow-up: ↓ 3 Changed 19 months ago by alec
comment:3 in reply to: ↑ 2 Changed 19 months ago by jimbullington
Replying to alec:
I don't know. RFC3501 says about PERMANENTFLAGS:
A list of message flags that the client can change permanently. If this is missing, the client should assume that all flags can be changed permanently.
OK - Thanks for the response - I will attempt to contact the vendor about this.
comment:4 Changed 19 months ago by alec
BTW, the error in setting flag shouldn't prevent from storing the sent message. Please, enable imap_debug in Roundcube and provide the log.
comment:5 follow-up: ↓ 6 Changed 19 months ago by jimbullington
Here you go:
It was difficult to track down - after the UID was rejected, the server also rejected the LSUB command as well - went downhill from there...
[09-Nov-2011 10:04:00 -0500]: [DC4B] S: * OK IMAP4 Server (IMail 11.5) [09-Nov-2011 10:04:00 -0500]: [DC4B] C: A0001 CAPABILITY [09-Nov-2011 10:04:00 -0500]: [DC4B] S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=CRAM-MD5 AUTH=PLAIN AUTH=LOGIN [09-Nov-2011 10:04:00 -0500]: [DC4B] S: A0001 OK CAPABILITY completed [09-Nov-2011 10:04:00 -0500]: [DC4B] C: A0002 LOGIN jimb ******* [09-Nov-2011 10:04:00 -0500]: [DC4B] S: A0002 OK LOGIN successful [09-Nov-2011 10:04:00 -0500]: [DC4B] C: A0003 SELECT INBOX [09-Nov-2011 10:04:00 -0500]: [DC4B] S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft) [09-Nov-2011 10:04:00 -0500]: [DC4B] S: * 1245 EXISTS [09-Nov-2011 10:04:00 -0500]: [DC4B] S: * 1 RECENT [09-Nov-2011 10:04:00 -0500]: [DC4B] S: * OK [UNSEEN 1245] 1 Messages unseen [09-Nov-2011 10:04:00 -0500]: [DC4B] S: * OK [UIDVALIDITY 1100930] UIDs valid [09-Nov-2011 10:04:00 -0500]: [DC4B] S: * OK [UIDNEXT 620725541] Predicted next UID [09-Nov-2011 10:04:00 -0500]: [DC4B] S: A0003 OK [READ-WRITE] SELECT completed [09-Nov-2011 10:04:00 -0500]: [DC4B] C: A0004 UID STORE 620725530 +FLAGS.SILENT ($Forwarded) [09-Nov-2011 10:04:00 -0500]: [DC4B] S: A0004 BAD UID Invalid Syntax [09-Nov-2011 10:04:00 -0500]: [DC4B] C: A0005 LSUB "" Sent [09-Nov-2011 10:04:00 -0500]: [DC4B] S: BAD Null Commmand [09-Nov-2011 10:04:00 -0500]: [DC4B] S: * LSUB (\Marked) "/" Sent [09-Nov-2011 10:04:00 -0500]: [DC4B] S: A0005 OK LSUB completed [09-Nov-2011 10:04:00 -0500]: [DC4B] C: A0006 LIST "" Sent [09-Nov-2011 10:04:00 -0500]: [DC4B] S: * LIST (\Marked) "/" Sent [09-Nov-2011 10:04:00 -0500]: [DC4B] S: A0006 OK LIST completed [09-Nov-2011 10:04:00 -0500]: [DC4B] C: A0007 SUBSCRIBE Sent [09-Nov-2011 10:04:00 -0500]: [DC4B] S: A0007 NO SUBSCRIBE: Already subscribed to that mailbox [09-Nov-2011 10:04:00 -0500]: [DC4B] C: A0008 LOGOUT
comment:6 in reply to: ↑ 5 Changed 19 months ago by alec
- Resolution set to wontfix
- Status changed from new to closed
Replying to jimbullington:
[09-Nov-2011 10:04:00 -0500]: [DC4B] C: A0005 LSUB "" Sent [09-Nov-2011 10:04:00 -0500]: [DC4B] S: BAD Null Commmand
and this is something we cannot handle
[09-Nov-2011 10:04:00 -0500]: [DC4B] S: * LSUB (\Marked) "/" Sent [09-Nov-2011 10:04:00 -0500]: [DC4B] S: A0005 OK LSUB completed [09-Nov-2011 10:04:00 -0500]: [DC4B] C: A0006 LIST "" Sent [09-Nov-2011 10:04:00 -0500]: [DC4B] S: * LIST (\Marked) "/" Sent [09-Nov-2011 10:04:00 -0500]: [DC4B] S: A0006 OK LIST completed [09-Nov-2011 10:04:00 -0500]: [DC4B] C: A0007 SUBSCRIBE Sent [09-Nov-2011 10:04:00 -0500]: [DC4B] S: A0007 NO SUBSCRIBE: Already subscribed to that mailbox
This is the reason why the message is not saved to the Sent folder.

I don't know. RFC3501 says about PERMANENTFLAGS: