[Dovecot] APPEND command truncates message

Chris Rodgers rodgers at physchem.ox.ac.uk
Wed Apr 19 01:12:00 EEST 2006


Hi,

I have been debugging a small perl script (see ShowBug2) that I use. In 
doing so, I think that I may have uncovered a problem with the dovecot 
IMAP server.

Attached are two packet traces for connections to two different IMAP 
servers. On both servers I run the script: i.e. I login, select a 
folder, search for messages and append a message. On the fvs5 server 
(Courier IMAP?), everything works as expected. However, on the dovecot 
server, the message that is saved into my mailbox has been truncated at 
the end of the line containing "26". I attach a copy of the saved 
message in MessageAsOnIMAPServer.txt.

I hope that this report might be useful. Please let me know if you 
require any further information.

Chris.
-------------- next part --------------
* OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS AUTH=LOGIN] fvs5 IMAP4rev1 2003.339p-cpanel at Tue, 18 Apr 2006 21:50:06 +0000 (GMT)


1 Login "*******" {7}


+ Ready for argument


*******


1 OK [CAPABILITY IMAP4REV1 IDLE NAMESPACE MAILBOX-REFERRALS BINARY UNSELECT SCAN SORT THREAD=REFERENCES THREAD=ORDEREDSUBJECT MULTIAPPEND] User Rodgers authenticated


2 SELECT IT-Lilac


* 0 EXISTS

* NO Trying to get mailbox lock from process 32317

* 0 RECENT

* OK [UIDVALIDITY 1145396966] UID validity status

* OK [UIDNEXT 1] Predicted next UID

* FLAGS (\Answered \Flagged \Deleted \Draft \Seen)

* OK [PERMANENTFLAGS (\* \Answered \Flagged \Deleted \Draft \Seen)] Permanent flags

2 OK [READ-WRITE] SELECT completed


3 UID SEARCH HEADER Subject "lilac gpg message"


* SEARCH

3 OK UID SEARCH completed


4 APPEND IT-Lilac {717}


+ Ready for argument


>From chris at rodgers.org.uk  Tue Apr 18 21:49:09 2006

Return-Path: <chris at rodgers.org.uk>

Received: from lilac.home (localhost.localdomain [127.0.0.1])

        by lilac.home (8.13.4/8.13.4) with ESMTP id k3IKn8cK004092

    for <chris at lilac.home>; Tue, 18 Apr 2006 21:49:08 +0100

Received: (from chris at localhost)

        by lilac.home (8.13.4/8.13.4/Submit) id k3IKn8Cm004091

    for chris; Tue, 18 Apr 2006 21:49:08 +0100

Date: Tue, 18 Apr 2006 21:49:08 +0100

From: Chris Rodgers <chris at rodgers.org.uk>

Message-Id: <200604182049.k3IKn8Cm004091 at lilac.home>

To: chris at lilac.home

Subject: test



1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30






* 1 EXISTS

* 1 RECENT

4 OK APPEND completed


5 LOGOUT


* BYE fvs5.freevirtualservers.com IMAP4rev1 server terminating connection

5 OK LOGOUT completed


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PTCL.cap
Type: application/octet-stream
Size: 3421 bytes
Desc: not available
Url : http://dovecot.org/pipermail/dovecot/attachments/20060418/f7ab24c1/PTCL-0001.obj
-------------- next part --------------
* OK dovecot ready.


1 Login "*******" {8}


+ OK


********


1 OK Logged in.


2 SELECT IT-Lilac


* FLAGS (\Answered \Flagged \Deleted \Seen \Draft NonJunk Junk)

* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft NonJunk Junk \*)] Flags permitted.

* 117 EXISTS

* 1 RECENT

* OK [UNSEEN 116] First unseen.

* OK [UIDVALIDITY 1136428693] UIDs valid

* OK [UIDNEXT 344] Predicted next UID

2 OK [READ-WRITE] Select completed.


3 UID SEARCH HEADER Subject "lilac gpg message"


* SEARCH

3 OK Search completed.


4 APPEND IT-Lilac {717}


+ OK


>From chris at rodgers.org.uk  Tue Apr 18 21:49:09 2006

Return-Path: <chris at rodgers.org.uk>

Received: from lilac.home (localhost.localdomain [127.0.0.1])

        by lilac.home (8.13.4/8.13.4) with ESMTP id k3IKn8cK004092

    for <chris at lilac.home>; Tue, 18 Apr 2006 21:49:08 +0100

Received: (from chris at localhost)

        by lilac.home (8.13.4/8.13.4/Submit) id k3IKn8Cm004091

    for chris; Tue, 18 Apr 2006 21:49:08 +0100

Date: Tue, 18 Apr 2006 21:49:08 +0100

From: Chris Rodgers <chris at rodgers.org.uk>

Message-Id: <200604182049.k3IKn8Cm004091 at lilac.home>

To: chris at lilac.home

Subject: test



1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30






* 118 EXISTS

* 2 RECENT

4 OK Append completed.


5 LOGOUT


* BYE Logging out

5 OK Logout completed.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: other.cap
Type: application/octet-stream
Size: 3607 bytes
Desc: not available
Url : http://dovecot.org/pipermail/dovecot/attachments/20060418/f7ab24c1/other-0001.obj
-------------- next part --------------
>From chris at rodgers.org.uk  Tue Apr 18 21: 49:09 2006
Return-Path: <chris at rodgers.org.uk>
Received: from lilac.home (localhost.localdomain [127.0.0.1])
        by lilac.home (8.13.4/8.13.4) with ESMTP id k3IKn8cK004092
    for <chris at lilac.home>; Tue, 18 Apr 2006 21:49:08 +0100
Received: (from chris at localhost)
        by lilac.home (8.13.4/8.13.4/Submit) id k3IKn8Cm004091
    for chris; Tue, 18 Apr 2006 21:49:08 +0100
Date: Tue, 18 Apr 2006 21:49:08 +0100
From: Chris Rodgers <chris at rodgers.org.uk>
Message-Id: <200604182049.k3IKn8Cm004091 at lilac.home>
To: chris at lilac.home
Subject: test
Content-Length: 113
Status: O
X-UID: 344
X-Keywords:                                                                                                    

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
-------------- next part --------------
#! /usr/bin/perl
use strict;

use Mail::IMAPClient;
use Term::ReadPassword;

# Check that username, password and server have been provided

my $Server = "imap.pcl.ox.ac.uk";
my $User = `whoami`;
chomp $User;
my $Password = read_password('Mail password: ');
my $INBOX = "IT-Lilac";

unless ($Server) { die "You must provide a server!"; }
unless ($User) { die "You must provide a user!"; }
unless ($Password) { die "You must provide a password!"; }

print "Connecting to $User\@$Server\n\n";

my $IMAP = Mail::IMAPClient -> new (Server   => $Server,
				    User     => $User,
				    Password => $Password,
				    Debug    => 1)
    or die "Could not connect to your IMAP server, stopping";

if (!$IMAP->IsAuthenticated())
{
    die "Could not log in to your IMAP server, stopping";
}

$IMAP -> Uid(1); # Use UID's for messages.

$IMAP -> select($INBOX);

my @msgs = $IMAP -> search("HEADER","Subject","lilac gpg message");

my $MessageBody = <<'EOM';
>From chris at rodgers.org.uk  Tue Apr 18 21:49:09 2006
Return-Path: <chris at rodgers.org.uk>
Received: from lilac.home (localhost.localdomain [127.0.0.1])
        by lilac.home (8.13.4/8.13.4) with ESMTP id k3IKn8cK004092
    for <chris at lilac.home>; Tue, 18 Apr 2006 21:49:08 +0100
Received: (from chris at localhost)
        by lilac.home (8.13.4/8.13.4/Submit) id k3IKn8Cm004091
    for chris; Tue, 18 Apr 2006 21:49:08 +0100
Date: Tue, 18 Apr 2006 21:49:08 +0100
From: Chris Rodgers <chris at rodgers.org.uk>
Message-Id: <200604182049.k3IKn8Cm004091 at lilac.home>
To: chris at lilac.home
Subject: test

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

EOM

print "Length is: {" . length($MessageBody) . "}";

$IMAP -> append("IT-Lilac",$MessageBody);
# BUG: For some reason, we lose a bit of the message!

print "\n";

$IMAP = $IMAP -> disconnect();

exit;


More information about the dovecot mailing list