Hi Andrew,

I had time to investigate and you were indeed right. The problem was
coming from the openchangeclient code when calling WriteStream.

There was different way to solve the issue. The one I've chosen is to
return the read size from WriteStream reply -- which we were ignoring so
far. It modifies the WriteStream API, but it is a necessary move (add an
additional uint16_t parameter).

I'll commit the patch later in the afternoon, once I finish 8 cups of
American coffee which is mostly the equivalent of a European double
espresso (-;

For example:

$ openchangeclient --sendmail --to=jkerihuel --subject="testme"
--body="plop twice" --attachments=/tmp/random-data-512k 
filename = /tmp/random-data-512k (size = 524288 / 524288)
Sending /tmp/random-data-512k:
We are about to write 524288 bytes in the stream
.................................    sendmail                 :
MAPI_E_SUCCESS (0x0)

$ openchangeclient --fetchmail --storemail=attrs
MAILBOX (1 messages)
+-------------------------------------+
message id:
<[EMAIL PROTECTED]>
subject: testme
From: Julien K. Kerihuel
To:  Julien
Cc:  
Bcc: 
Attachment: True
Codepage: CP_USASCII
Body:
plop twice
[0] /random-data-512k (524352 Bytes)
    fetchmail                : MAPI_E_SUCCESS (0x0)

$ ls -la /tmp/random-data-512k 
-rw-rw-r-- 1 jkerihuel jkerihuel 524288 2007-09-27
09:05 /tmp/random-data-512k
$ ls -la /tmp/attrs/random-data-512k 
-rwx------ 1 jkerihuel jkerihuel 524288 2007-09-27
10:30 /tmp/attrs/random-data-512k
$ diff /tmp/random-data-512k /tmp/attrs/random-data-512k 
$ 


On Fri, 2007-09-21 at 13:03 +0200, Andrew Gaylard wrote:
> If I create a file of data:
> 
>     dd if=/dev/urandom of=random-data-512k count=1024
> 
> ... and send it to myself:
> 
>     openchangeclient --sendmail --to=myself --profile=myself
> --body="attachment size test" --attachments="/$PWD/random-data-512k" 
> 
> ... and then read it back:
> 
>     openchangeclient --profile=myself --fetchmail --storemail=atts
> 
> ... then I see this:
> 
> [EMAIL PROTECTED]:~$ ls -l random-data-512k atts/random-data-512k 
> -rw------- 1 qualica qualica 540672 2007-09-21 12:57
> atts/random-data-512k 
> -rw-r--r-- 1 qualica qualica 524288 2007-09-21 12:07 random-data-512k
> 
> Somewhere, my file has gained exactly 16,384 bytes of data at the end.
> Looking at them with xxd, they're nearly all zeros.
> 
> Is Exchange doing something weird? 
> Or is this a problem with libmapi / openchangeclient?
> 
> Andrew
> _______________________________________________
> devel mailing list
> [email protected]
> http://mailman.openchange.org/listinfo/devel
-- 
Julien Kerihuel
[EMAIL PROTECTED]
OpenChange Project Manager

GPG Fingerprint: 0B55 783D A781 6329 108A  B609 7EF6 FE11 A35F 1F79

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
devel mailing list
[email protected]
http://mailman.openchange.org/listinfo/devel

Reply via email to