roundcube-0.5.2 doesn't save sent messages #3374

Closed
rcubetrac opened this Issue May 3, 2011 · 14 comments

1 participant

@rcubetrac

Reported by stuart on 3 May 2011 19:04 UTC as Trac ticket #1487900

roundcube has always worked for versions up to and including 0.5.1. Now, in 0.5.2, roundcube no longer saves sent messages to the defined Special Folder (e.g. "Sent").

The template configuration file differs only by a one-line comment, and I've manually re-run the installer in case of database schema changes.

If I revert back to 0.5.1, everything is again fine. As soon as I change to 0.5.2, sent messages aren't saved.

My IMAP server is dovecot, and this is reporting no errors in its logs. roundcube doesn't seem to be reporting anything untoward, either...

Migrated-From: http://trac.roundcube.net/ticket/1487900

@rcubetrac

Comment by @alecpl on 3 May 2011 19:07 UTC

Enable imap_debug and provide the log.

@rcubetrac

Milestone changed by @alecpl on 3 May 2011 19:07 UTC

later => 0.6-beta

@rcubetrac

Comment by stuart on 3 May 2011 20:01 UTC

I enabled IMAP logging, wrote an email with an easily-recognised title an content, and sent it... nothing in IMAP log, nothing in Sent messages.

Trying again by composing a new message, erasing the log, and then sending the message results in the following log:

[20:57:30 +0100](03-May-2011): S: * OK [IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE AUTH=PLAIN AUTH=LOGIN](CAPABILITY) Dovecot ready.
[20:57:30 +0100](03-May-2011): C: A0001 ID (name "Roundcube Webmail" version 0.5.2 php 5.3.6-pl0-gentoo os Linux command /?_unlock=loading1304452650160)
[20:57:30 +0100](03-May-2011): S: * ID NIL
[20:57:30 +0100](03-May-2011): S: A0001 OK ID completed.
[20:57:30 +0100](03-May-2011): C: A0002 AUTHENTICATE PLAIN <xxxx>=
[20:57:30 +0100](03-May-2011): S: A0002 OK [IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS](CAPABILITY) Logged in
[20:57:30 +0100](03-May-2011): C: A0003 LOGOUT
[20:57:30 +0100](03-May-2011): S: * BYE Logging out
[20:57:30 +0100](03-May-2011): S: A0003 OK Logout completed.
[20:57:32 +0100](03-May-2011): S: * OK [IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE AUTH=PLAIN AUTH=LOGIN](CAPABILITY) Dovecot ready.
[20:57:32 +0100](03-May-2011): C: A0001 ID (name "Roundcube Webmail" version 0.5.2 php 5.3.6-pl0-gentoo os Linux command /?_task=mail&_mbox=INBOX&_refresh=1)
[20:57:32 +0100](03-May-2011): S: * ID NIL
[20:57:32 +0100](03-May-2011): S: A0001 OK ID completed.
[20:57:32 +0100](03-May-2011): C: A0002 AUTHENTICATE PLAIN <xxxx>=
[20:57:32 +0100](03-May-2011): S: A0002 OK [IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS](CAPABILITY) Logged in
[20:57:32 +0100](03-May-2011): C: A0003 LIST (SUBSCRIBED) "" "*"
[20:57:32 +0100](03-May-2011): S: * LIST (\Subscribed) "." "Trash"
[20:57:32 +0100](03-May-2011): S: * LIST (\Subscribed) "." "Drafts"
[20:57:32 +0100](03-May-2011): S: * LIST (\Subscribed) "." "Sent"
[20:57:32 +0100](03-May-2011): S: * LIST (\Subscribed) "." "INBOX"
<etc>

... so no attempt seems to be being made via IMAP to save the sent message.

@rcubetrac

Comment by stuart on 3 May 2011 20:09 UTC

roundcube-0.5.1 on the same system, same settings, etc. shows the following instead:

[21:05:21 +0100](03-May-2011): S: * OK [IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE AUTH=PLAIN AUTH=LOGIN](CAPABILITY) Dovecot ready.
[21:05:21 +0100](03-May-2011): C: A0001 ID (name "Roundcube Webmail" version 0.5.1 php 5.3.6-pl0-gentoo os Linux command /?_unlock=loading1304453120742)
[21:05:21 +0100](03-May-2011): S: * ID NIL
[21:05:21 +0100](03-May-2011): S: A0001 OK ID completed.
[21:05:21 +0100](03-May-2011): C: A0002 AUTHENTICATE PLAIN <xxxx>=
[21:05:21 +0100](03-May-2011): S: A0002 OK [IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS](CAPABILITY) Logged in
[21:05:21 +0100](03-May-2011): C: A0003 LSUB "" Sent
[21:05:21 +0100](03-May-2011): S: * LSUB () "." "Sent"
[21:05:21 +0100](03-May-2011): S: A0003 OK Lsub completed.
[21:05:21 +0100](03-May-2011): C: A0004 LIST "" Sent
[21:05:21 +0100](03-May-2011): S: * LIST (\HasNoChildren) "." "Sent"
[21:05:21 +0100](03-May-2011): S: A0004 OK List completed.
[21:05:21 +0100](03-May-2011): C: A0005 APPEND Sent (\Seen) {605+}
[21:05:21 +0100](03-May-2011): C: Received: from
 <xxxx>
 by <xxxx>
 with HTTP (HTTP/1.1 POST); Tue, 03 May 2011 21:05:21 +0100
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: 7bit
Date: Tue, 03 May 2011 21:05:21 +0100
From: Stuart Shelton <xxxx>
To: <xxxx>
Subject: DEBUG Test Message #3
Message-ID: <53a12964619b22ab0ba1e467a9960237@xxxx>
X-Sender: xxxx
User-Agent: Roundcube Webmail/0.5.1

 Test Body #3
[21:05:22 +0100](03-May-2011): S: A0005 OK [1225464855 1514](APPENDUID) Append completed.
[21:05:22 +0100](03-May-2011): C: A0006 LOGOUT
[21:05:22 +0100](03-May-2011): S: * BYE Logging out
[21:05:22 +0100](03-May-2011): S: A0006 OK Logout completed.
[21:05:23 +0100](03-May-2011): S: * OK [IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE AUTH=PLAIN AUTH=LOGIN](CAPABILITY) Dovecot ready.
[21:05:23 +0100](03-May-2011): C: A0001 ID (name "Roundcube Webmail" version 0.5.1 php 5.3.6-pl0-gentoo os Linux command /?_task=mail&_mbox=INBOX&_refresh=1)
[21:05:23 +0100](03-May-2011): S: * ID NIL
[21:05:23 +0100](03-May-2011): S: A0001 OK ID completed.
[21:05:23 +0100](03-May-2011): C: A0002 AUTHENTICATE PLAIN <xxxx>=
[21:05:23 +0100](03-May-2011): S: A0002 OK [IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS](CAPABILITY) Logged in
[21:05:23 +0100](03-May-2011): C: A0003 LIST (SUBSCRIBED) "" "*"
[21:05:23 +0100](03-May-2011): S: * LIST (\Subscribed) "." "Trash"
[21:05:23 +0100](03-May-2011): S: * LIST (\Subscribed) "." "Drafts"
[21:05:23 +0100](03-May-2011): S: * LIST (\Subscribed) "." "Sent"
[21:05:23 +0100](03-May-2011): S: * LIST (\Subscribed) "." "INBOX"
<etc>
@rcubetrac

Comment by stuart on 3 May 2011 20:11 UTC

... so why is roundcube-0.5.2 logging in and then immediately logging out without even attempting to find a "Sent" mailbox, whereas roundcube-0.5.1 is (correctly) writing the message to the Sent folder?

@rcubetrac

Comment by stuart on 3 May 2011 20:13 UTC

Replying to alec:

Enable imap_debug and provide the log.

Information provided above, just in case you don't see non-reply comments (and because I only just noticed the "Reply" button ;)

@rcubetrac

Comment by @alecpl on 4 May 2011 07:41 UTC

In compose window is the Sent folder selected in "Save sent message in:" select field? Is the folder selected in Special Folders section of user preferences? Provide the log from the moment when you click Compose.

@rcubetrac

Comment by stuart on 4 May 2011 09:23 UTC

Replying to alec:

In compose window is the Sent folder selected in "Save sent message in:" select field? Is the folder selected in Special Folders section of user preferences? Provide the log from the moment when you click Compose.

Yes, the "Save sent message in" drop-box had "Sent" selected and yes, this is also the folder selected in Special Folders.

I'll try to get a log of everything from clicking Compose, but I seem to remember that the log was quite noisy and was still performing fetches of mailbox content. I'll confirm ASAP and include the log.

@rcubetrac

Comment by stuart on 6 May 2011 21:25 UTC

Replying to alec:

In compose window is the Sent folder selected in "Save sent message in:" select field? Is the folder selected in Special Folders section of user preferences? Provide the log from the moment when you click Compose.

Okay, log from when "Compose" is clicked (with sensitive information replaced with "xxxx"):

06-May-2011 22:04:33 +0100]: S: * OK [IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE AUTH=PLAIN AUTH=LOGIN](CAPABILITY) Dovecot ready.
[22:04:33 +0100](06-May-2011): C: A0001 ID (name "Roundcube Webmail" version 0.5.2 php 5.3.6-pl0-gentoo os Linux command /?_task=mail&_action=compose&_mbox=INBOX)
[22:04:33 +0100](06-May-2011): S: * ID NIL
[22:04:33 +0100](06-May-2011): S: A0001 OK ID completed.
[22:04:33 +0100](06-May-2011): C: A0002 AUTHENTICATE PLAIN xxxx=
[22:04:33 +0100](06-May-2011): S: A0002 OK [IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS](CAPABILITY) Logged in
[22:04:33 +0100](06-May-2011): C: A0003 LSUB "" Sent
[22:04:33 +0100](06-May-2011): S: * LSUB () "." "Sent"
[22:04:33 +0100](06-May-2011): S: A0003 OK Lsub completed.
[22:04:33 +0100](06-May-2011): S: * OK [IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE AUTH=PLAIN AUTH=LOGIN](CAPABILITY) Dovecot ready.
[22:04:33 +0100](06-May-2011): C: A0001 ID (name "Roundcube Webmail" version 0.5.2 php 5.3.6-pl0-gentoo os Linux command /?_task=mail&_id=5712702124dc46261320d8&_action=compose)
[22:04:33 +0100](06-May-2011): S: * ID NIL
[22:04:33 +0100](06-May-2011): S: A0001 OK ID completed.
[22:04:33 +0100](06-May-2011): C: A0002 AUTHENTICATE PLAIN xxxx=
[22:04:33 +0100](06-May-2011): S: A0002 OK [IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS](CAPABILITY) Logged in
[22:04:33 +0100](06-May-2011): C: A0003 LIST (SUBSCRIBED) "" "*"
[22:04:33 +0100](06-May-2011): S: * LIST (\Subscribed) "." "Trash"
[22:04:33 +0100](06-May-2011): S: * LIST (\Subscribed) "." "Drafts"
[22:04:33 +0100](06-May-2011): S: * LIST (\Subscribed) "." "Sent"
[22:04:33 +0100](06-May-2011): S: * LIST (\Subscribed) "." "INBOX"
[22:04:33 +0100](06-May-2011): S: A0003 OK List completed.
[22:04:56 +0100](06-May-2011): S: * OK [IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE AUTH=PLAIN AUTH=LOGIN](CAPABILITY) Dovecot ready.
[22:04:56 +0100](06-May-2011): C: A0001 ID (name "Roundcube Webmail" version 0.5.2 php 5.3.6-pl0-gentoo os Linux command /?_unlock=loading1304715894751)
[22:04:56 +0100](06-May-2011): S: * ID NIL
[22:04:56 +0100](06-May-2011): S: A0001 OK ID completed.
[22:04:56 +0100](06-May-2011): C: A0002 AUTHENTICATE PLAIN xxxx=
[22:04:56 +0100](06-May-2011): S: A0002 OK [IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS](CAPABILITY) Logged in
[22:04:56 +0100](06-May-2011): C: A0003 LOGOUT
[22:04:56 +0100](06-May-2011): S: * BYE Logging out
[22:04:56 +0100](06-May-2011): S: A0003 OK Logout completed.

... just as before, no message in Sent items and no log from roundcube showing any attempt to save the message.

@rcubetrac

Comment by @alecpl on 7 May 2011 06:20 UTC

I've reviewed the changes in the code and I've got no idea where's the problem. What PHP version? Consider giving me access to your box. Write to alec at alec.pl.

@rcubetrac

Comment by corbosman on 17 May 2011 13:58 UTC

I have the same issue in 0.5.2. Sent email is no longer being saved. I tracked the error to a local plugin using the message_outgoing_headers hook. In this plugin i use a function $rcmail->encrypt() to encrypt a string and add it as a header to the outgoing msg header.

Recently, this encrypt() function added the following code:

    if (is_object($this->imap))
      $this->imap->close();

This closes the imap session. Later, when RC wants to save the msg in the Sent folder the following code is triggered, causing RC to fail to find the Sent folder as an existing folder:

    function putLineC($string, $endln=true)
    {
        if (!$this->fp)
            return false;

Feedback requested on how to fix this problem.

@rcubetrac

Comment by corbosman on 17 May 2011 14:05 UTC

Btw, my log_sender plugin would cause this issue right now, so if you're using that plugin, you could disable it to probably fix your problem. Still wondering why the imap session is suddenly closed in encrypt() and how else I could then encrypt a string for using in message headers.

@rcubetrac

Comment by @alecpl on 17 May 2011 16:16 UTC

Fixed in r4779/svn. It was caused by invalid patch application.

@rcubetrac

Status changed by @alecpl on 17 May 2011 16:16 UTC

new => closed

@rcubetrac rcubetrac closed this May 17, 2011
@rcubetrac rcubetrac added this to the 0.6-beta milestone Mar 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment