Author Topic: [SOLVED] IMAP Error: Could not save message in INBOX  (Read 10234 times)

Offline cl1cker

  • Newbie
  • *
  • Posts: 4
[SOLVED] IMAP Error: Could not save message in INBOX
« on: October 21, 2012, 04:54:57 PM »
When I attempt to save a sent message in INBOX, it fails with

Code: [Select]
IMAP Error: Could not save message in INBOX in /var/www/html/dmail/program/steps/mail/sendmail.inc on line 697 (POST /dmail/?_unlock=loading1350850580090&_lang=undefined?_task=mail&_action=send)
Additionally, imap_debug show no IMAP commands for the LOGIN, CAPABILITY or APPEND. If I log the messages manually, it appears as if it gets to the call to append without having logged in as the request is prepared with A0001, hence putLine returns false immediately (!fp).

Code: [Select]
A0001 APPEND INBOX (\Seen) {602}
vs 0.7.2:

Code: [Select]
A0004 APPEND INBOX (\Seen) {602+}
Saving sent messages in all other folders works because it appears folder_exists takes care of the imap connect.

Any help is much appreciated.
Thanks,
Steve
« Last Edit: October 22, 2012, 07:39:07 AM by cl1cker »

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365

Offline cl1cker

  • Newbie
  • *
  • Posts: 4
Re: IMAP Error: Could not save message in INBOX
« Reply #2 on: October 22, 2012, 07:38:39 AM »
Fantastic, thank you Alec!

Offline nulllptr

  • Newbie
  • *
  • Posts: 4
Re: [SOLVED] IMAP Error: Could not save message in INBOX
« Reply #3 on: November 05, 2012, 09:28:33 PM »
I'm using v0.8.2.

Applied the patch, the issue still occurs with courier-imap ?!

Below is the debug log, the error is the same sendmail.inc on line 697 as the original poster.

Code: [Select]
WRITE: L OK LOGIN Ok.
READ: ATOM: A0002
READ: ATOM: LSUB
READ: QUOTED_STRING:
READ: ATOM: INBOX.Sent
READ: EOL
WRITE: * LSUB (\HasNoChildren) "." "INBOX.Sent"
A0002 OK LSUB completed
READ: ATOM: A0003
READ: ATOM: LIST
READ: QUOTED_STRING:
READ: ATOM: INBOX.Sent
READ: EOL
WRITE: * LIST (\HasNoChildren) "." "INBOX.Sent"
A0003 OK LIST completed
READ: ATOM: A0004
READ: ATOM: APPEND
READ: ATOM: INBOX.Sent
READ: ATOM: \Seen
READ: RPAREN
WRITE: A0004 NO Error in IMAP command received by server.
READ: ATOM: MIME-Version:
READ: ATOM: 1.0
WRITE: MIME-Version: NO Error in IMAP command received by server.
READ: ATOM: Content-Type:
READ: ATOM: TEXT/PLAIN;
WRITE: Content-Type: NO Error in IMAP command received by server.
READ: ATOM: format=flowed
READ: EOL
WRITE: format=flowed NO Error in IMAP command received by server.
READ: ATOM: Content-Transfer-Encoding:
READ: ATOM: 7BIT
WRITE: Content-Transfer-Encoding: NO Error in IMAP command received by server.
READ: ATOM: Date:
READ: ATOM: MON,
WRITE: Date: NO Error in IMAP command received by server.
READ: ATOM: From:
READ: ATOM: TEST123@SAFDTECHS.COM
WRITE: From: NO Error in IMAP command received by server.
READ: ATOM: To:
READ: ATOM: <DENEDD@ASAFASHNSEIS.COM>
WRITE: To: NO Error in IMAP command received by server.
READ: ATOM: Subject:
READ: ATOM: TEST
WRITE: Subject: NO Error in IMAP command received by server.
READ: ATOM: Message-ID:
READ: ATOM: <F16A7B51F828F57087AB0E83E294864D@SAFDTECHS.COM>
WRITE: * BYE [ALERT] Fatal error: TOO MANY CONSECUTIVE PROTOCOL VIOLATIONS:
WRITE: L OK LOGIN Ok.

Any suggestions?

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: [SOLVED] IMAP Error: Could not save message in INBOX
« Reply #4 on: November 06, 2012, 02:24:18 AM »
This log is not clear to me. Enable imap_debug in Roundcube and provide the log.

Offline nulllptr

  • Newbie
  • *
  • Posts: 4
Re: [SOLVED] IMAP Error: Could not save message in INBOX
« Reply #5 on: November 06, 2012, 04:15:22 AM »
Here you go:

imap debug:

Code: [Select]

[06-Nov-2012 04:19:43 -0500]: [4B54] C: A0002 AUTHENTICATE PLAIN AHRlc3QxMjNAZWNsZWN0ZWNocy5jb20AdHVuYWZpc2gxMjM=
[06-Nov-2012 04:19:43 -0500]: [4B54] S: A0002 OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION] LOGIN Ok.
[06-Nov-2012 04:19:43 -0500]: [4B54] C: A0003 LSUB "" INBOX.Sent
[06-Nov-2012 04:19:43 -0500]: [4B54] S: * LSUB (\HasNoChildren) "." "INBOX.Sent"
[06-Nov-2012 04:19:43 -0500]: [4B54] S: A0003 OK LSUB completed
[06-Nov-2012 04:19:43 -0500]: [4B54] C: A0004 LIST "" INBOX.Sent
[06-Nov-2012 04:19:43 -0500]: [4B54] S: * LIST (\HasNoChildren) "." "INBOX.Sent"
[06-Nov-2012 04:19:43 -0500]: [4B54] S: A0004 OK LIST completed
[06-Nov-2012 04:19:43 -0500]: [4B54] C: A0005 APPEND INBOX.Sent (\Seen) {369+}
[06-Nov-2012 04:19:43 -0500]: [4B54] C: MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: 7bit
Date: Tue, 06 Nov 2012 04:19:43 -0500
From: test123@ecsfddsfa.com
To: <test123@ecsfddsfa.com>
Subject: testing1
Message-ID: <859df04b9e222d4e25696181e40e938e@ecsfddsfa.com>
X-Sender: test123@ecsfddsfa.com
User-Agent: ecsfddsfa.com Webmail/0.8.2

test
[06-Nov-2012 04:19:43 -0500]: [4B54] S: A0005 NO Error in IMAP command received by server.
[06-Nov-2012 04:19:43 -0500]: [4B54] C: A0006 LOGOUT
[06-Nov-2012 04:19:43 -0500]: [4B54] S: MIME-Version: NO Error in IMAP command received by server.


errors log:
Code: [Select]
[06-Nov-2012 04:04:24 -0500]: IMAP Error: Could not save message in INBOX.Sent in /usr/share/roundcube/program/steps/mail/sendmail.inc on line 697 (POST /rc/?_unlock=loading1352192946746&_lang=en?_task=mail&_action=send)

This occurs when saving a draft also.
« Last Edit: November 06, 2012, 04:30:35 AM by nulllptr »

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: [SOLVED] IMAP Error: Could not save message in INBOX
« Reply #6 on: November 06, 2012, 04:35:36 AM »
Code: [Select]
[06-Nov-2012 04:19:43 -0500]: [4B54] C: A0005 APPEND INBOX.Sent (\Seen) {369+}
[06-Nov-2012 04:19:43 -0500]: [4B54] C: MIME-Version: 1.0
[06-Nov-2012 04:19:43 -0500]: [4B54] S: A0005 NO Error in IMAP command received by server.
For me it looks like Courier-IMAP bug. You did cut CAPABILITY response, but I assume there was LITERAL+ on the list. Then the APPEND command syntax is correct, but Courier fails to parse it.

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: [SOLVED] IMAP Error: Could not save message in INBOX
« Reply #7 on: November 06, 2012, 04:40:36 AM »
Ops, sorry. You didn't cut it. There's no LITERAL+ indeed. However, maybe it was there in some previous CAPABILITY response? Please, check the full log from the beginning for LITARAL+. There must be some reason why Roundcube uses it.

Offline nulllptr

  • Newbie
  • *
  • Posts: 4
Re: [SOLVED] IMAP Error: Could not save message in INBOX
« Reply #8 on: November 06, 2012, 05:49:42 AM »
Thanks, you were right.

I'm connecting thru a dovecot proxy which forwards to a courier-box w/o support for LITERAL+ option. I ended up setting up a custom imap_capability in dovecot skipping it and now it flies right thru :)

I do have imap_force_caps=true in roundcube and thought the refreshed caps list would have been effectively used, but I guess the code is not flexible enough for that yet...
« Last Edit: November 06, 2012, 05:53:06 AM by nulllptr »